diff options
Diffstat (limited to 'libutils/tests/BlobCache_test.cpp')
-rw-r--r-- | libutils/tests/BlobCache_test.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libutils/tests/BlobCache_test.cpp b/libutils/tests/BlobCache_test.cpp index 7202123eb..dac4e2c26 100644 --- a/libutils/tests/BlobCache_test.cpp +++ b/libutils/tests/BlobCache_test.cpp @@ -44,7 +44,7 @@ protected: }; TEST_F(BlobCacheTest, CacheSingleValueSucceeds) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); ASSERT_EQ('e', buf[0]); @@ -54,7 +54,7 @@ TEST_F(BlobCacheTest, CacheSingleValueSucceeds) { } TEST_F(BlobCacheTest, CacheTwoValuesSucceeds) { - char buf[2] = { 0xee, 0xee }; + unsigned char buf[2] = { 0xee, 0xee }; mBC->set("ab", 2, "cd", 2); mBC->set("ef", 2, "gh", 2); ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2)); @@ -66,7 +66,7 @@ TEST_F(BlobCacheTest, CacheTwoValuesSucceeds) { } TEST_F(BlobCacheTest, GetOnlyWritesInsideBounds) { - char buf[6] = { 0xee, 0xee, 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[6] = { 0xee, 0xee, 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf+1, 4)); ASSERT_EQ(0xee, buf[0]); @@ -78,7 +78,7 @@ TEST_F(BlobCacheTest, GetOnlyWritesInsideBounds) { } TEST_F(BlobCacheTest, GetOnlyWritesIfBufferIsLargeEnough) { - char buf[3] = { 0xee, 0xee, 0xee }; + unsigned char buf[3] = { 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 3)); ASSERT_EQ(0xee, buf[0]); @@ -92,7 +92,7 @@ TEST_F(BlobCacheTest, GetDoesntAccessNullBuffer) { } TEST_F(BlobCacheTest, MultipleSetsCacheLatestValue) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); mBC->set("abcd", 4, "ijkl", 4); ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); @@ -103,7 +103,7 @@ TEST_F(BlobCacheTest, MultipleSetsCacheLatestValue) { } TEST_F(BlobCacheTest, SecondSetKeepsFirstValueIfTooLarge) { - char buf[MAX_VALUE_SIZE+1] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[MAX_VALUE_SIZE+1] = { 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); mBC->set("abcd", 4, buf, MAX_VALUE_SIZE+1); ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); @@ -115,7 +115,7 @@ TEST_F(BlobCacheTest, SecondSetKeepsFirstValueIfTooLarge) { TEST_F(BlobCacheTest, DoesntCacheIfKeyIsTooBig) { char key[MAX_KEY_SIZE+1]; - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; for (int i = 0; i < MAX_KEY_SIZE+1; i++) { key[i] = 'a'; } @@ -165,7 +165,7 @@ TEST_F(BlobCacheTest, DoesntCacheIfKeyValuePairIsTooBig) { TEST_F(BlobCacheTest, CacheMaxKeySizeSucceeds) { char key[MAX_KEY_SIZE]; - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; for (int i = 0; i < MAX_KEY_SIZE; i++) { key[i] = 'a'; } @@ -214,7 +214,7 @@ TEST_F(BlobCacheTest, CacheMaxKeyValuePairSizeSucceeds) { } TEST_F(BlobCacheTest, CacheMinKeyAndValueSizeSucceeds) { - char buf[1] = { 0xee }; + unsigned char buf[1] = { 0xee }; mBC->set("x", 1, "y", 1); ASSERT_EQ(size_t(1), mBC->get("x", 1, buf, 1)); ASSERT_EQ('y', buf[0]); @@ -282,7 +282,7 @@ protected: }; TEST_F(BlobCacheFlattenTest, FlattenOneValue) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); roundTrip(); ASSERT_EQ(size_t(4), mBC2->get("abcd", 4, buf, 4)); @@ -348,7 +348,7 @@ TEST_F(BlobCacheFlattenTest, FlattenCatchesBufferTooSmall) { } TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadMagic) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); size_t size = mBC->getFlattenedSize(); @@ -365,7 +365,7 @@ TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadMagic) { } TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadBlobCacheVersion) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); size_t size = mBC->getFlattenedSize(); @@ -384,7 +384,7 @@ TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadBlobCacheVersion) { } TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadBlobCacheDeviceVersion) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); size_t size = mBC->getFlattenedSize(); @@ -403,7 +403,7 @@ TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadBlobCacheDeviceVersion) { } TEST_F(BlobCacheFlattenTest, UnflattenCatchesBufferTooSmall) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; mBC->set("abcd", 4, "efgh", 4); size_t size = mBC->getFlattenedSize(); |