mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-13 22:50:19 +02:00
Fix compile errors on OS X due to signed-unsigned comparison in tests
This commit is contained in:
@@ -5,11 +5,11 @@ TEST(zone, allocate_align)
|
||||
{
|
||||
msgpack::zone z;
|
||||
char* start = (char*)z.allocate_align(1);
|
||||
EXPECT_EQ(reinterpret_cast<std::size_t>(start) % sizeof(int), 0);
|
||||
EXPECT_EQ(0ul, reinterpret_cast<std::size_t>(start) % sizeof(int));
|
||||
for (std::size_t s = 1; s < sizeof(int); ++s) {
|
||||
z.allocate_no_align(s);
|
||||
char* buf_a = (char*)z.allocate_align(1);
|
||||
EXPECT_EQ(0, reinterpret_cast<std::size_t>(buf_a) % sizeof(int));
|
||||
EXPECT_EQ(0ul, reinterpret_cast<std::size_t>(buf_a) % sizeof(int));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ TEST(zone, allocate_align_custom)
|
||||
msgpack::zone z;
|
||||
for (std::size_t align = 1; align < 64; ++align) {
|
||||
char* start = (char*)z.allocate_align(1, align);
|
||||
EXPECT_EQ(reinterpret_cast<std::size_t>(start) % align, 0);
|
||||
EXPECT_EQ(0ul, reinterpret_cast<std::size_t>(start) % align);
|
||||
for (std::size_t s = 1; s < align; ++s) {
|
||||
z.allocate_no_align(s);
|
||||
char* buf_a = (char*)z.allocate_align(1, align);
|
||||
EXPECT_EQ(0, reinterpret_cast<std::size_t>(buf_a) % align);
|
||||
EXPECT_EQ(0ul, reinterpret_cast<std::size_t>(buf_a) % align);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user