@@ -11,9 +11,6 @@ namespace {
11
11
GTEST_SKIP () << " Required map is to large for memory" ;
12
12
msgpack23::Packer packer{};
13
13
std::map<std::size_t , std::size_t > expected{};
14
- static_assert (
15
- std::numeric_limits<std::uint32_t >::max () < std::numeric_limits<std::map<std::size_t ,
16
- std::size_t >::size_type>::max (), " Maps cannot be larger than uint32_t." );
17
14
for (std::map<std::size_t , std::size_t >::size_type i = 0 ;
18
15
i < static_cast <std::map<std::size_t , std::size_t >::size_type>(std::numeric_limits<std::uint32_t >::max ()) +
19
16
1 ; ++i) {
@@ -23,11 +20,9 @@ namespace {
23
20
}
24
21
25
22
TEST (msgpack23, CollectionTooLargeTest) {
23
+ GTEST_SKIP () << " Required collection is to large for memory" ;
26
24
msgpack23::Packer packer{};
27
25
std::vector<std::size_t > expected{};
28
- static_assert (
29
- std::numeric_limits<std::uint32_t >::max () < std::numeric_limits<std::vector<std::size_t >::size_type>::max (),
30
- " Vectors cannot be larger than uint32_t." );
31
26
expected.resize (
32
27
static_cast <std::vector<std::size_t >::size_type>(std::numeric_limits<std::uint32_t >::max ()) + 1 );
33
28
EXPECT_THROW (auto _ = packer (expected), std::length_error);
@@ -36,18 +31,13 @@ namespace {
36
31
TEST (msgpack23, StringTooLargeTest) {
37
32
msgpack23::Packer packer{};
38
33
std::string expected{};
39
- static_assert (std::numeric_limits<std::uint32_t >::max () < std::numeric_limits<std::string::size_type>::max (),
40
- " Strings cannot be larger than uint32_t." );
41
34
expected.resize (static_cast <std::string::size_type>(std::numeric_limits<std::uint32_t >::max ()) + 1 );
42
35
EXPECT_THROW (auto _ = packer (expected), std::length_error);
43
36
}
44
37
45
38
TEST (msgpack23, VectorTooLargeTest) {
46
39
msgpack23::Packer packer{};
47
40
std::vector<std::uint8_t > expected{};
48
- static_assert (
49
- std::numeric_limits<std::uint32_t >::max () < std::numeric_limits<std::vector<
50
- std::uint8_t >::size_type>::max (), " Vectors cannot be larger than uint32_t." );
51
41
expected.resize (
52
42
static_cast <std::vector<std::uint8_t >::size_type>(std::numeric_limits<std::uint32_t >::max ()) + 1 );
53
43
EXPECT_THROW (auto _ = packer (expected), std::length_error);
0 commit comments