Lines Matching refs:buf
51 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
53 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); in TEST_F()
54 ASSERT_EQ('e', buf[0]); in TEST_F()
55 ASSERT_EQ('f', buf[1]); in TEST_F()
56 ASSERT_EQ('g', buf[2]); in TEST_F()
57 ASSERT_EQ('h', buf[3]); in TEST_F()
61 unsigned char buf[2] = {0xee, 0xee}; in TEST_F() local
64 ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2)); in TEST_F()
65 ASSERT_EQ('c', buf[0]); in TEST_F()
66 ASSERT_EQ('d', buf[1]); in TEST_F()
67 ASSERT_EQ(size_t(2), mBC->get("ef", 2, buf, 2)); in TEST_F()
68 ASSERT_EQ('g', buf[0]); in TEST_F()
69 ASSERT_EQ('h', buf[1]); in TEST_F()
73 unsigned char buf[6] = {0xee, 0xee, 0xee, 0xee, 0xee, 0xee}; in TEST_F() local
75 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf + 1, 4)); in TEST_F()
76 ASSERT_EQ(0xee, buf[0]); in TEST_F()
77 ASSERT_EQ('e', buf[1]); in TEST_F()
78 ASSERT_EQ('f', buf[2]); in TEST_F()
79 ASSERT_EQ('g', buf[3]); in TEST_F()
80 ASSERT_EQ('h', buf[4]); in TEST_F()
81 ASSERT_EQ(0xee, buf[5]); in TEST_F()
85 unsigned char buf[3] = {0xee, 0xee, 0xee}; in TEST_F() local
87 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 3)); in TEST_F()
88 ASSERT_EQ(0xee, buf[0]); in TEST_F()
89 ASSERT_EQ(0xee, buf[1]); in TEST_F()
90 ASSERT_EQ(0xee, buf[2]); in TEST_F()
99 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
102 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); in TEST_F()
103 ASSERT_EQ('i', buf[0]); in TEST_F()
104 ASSERT_EQ('j', buf[1]); in TEST_F()
105 ASSERT_EQ('k', buf[2]); in TEST_F()
106 ASSERT_EQ('l', buf[3]); in TEST_F()
110 unsigned char buf[MAX_VALUE_SIZE + 1] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
112 ASSERT_EQ(BlobCache::InsertResult::kValueTooBig, mBC->set("abcd", 4, buf, MAX_VALUE_SIZE + 1)); in TEST_F()
113 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); in TEST_F()
114 ASSERT_EQ('e', buf[0]); in TEST_F()
115 ASSERT_EQ('f', buf[1]); in TEST_F()
116 ASSERT_EQ('g', buf[2]); in TEST_F()
117 ASSERT_EQ('h', buf[3]); in TEST_F()
122 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
127 ASSERT_EQ(size_t(0), mBC->get(key, MAX_KEY_SIZE + 1, buf, 4)); in TEST_F()
128 ASSERT_EQ(0xee, buf[0]); in TEST_F()
129 ASSERT_EQ(0xee, buf[1]); in TEST_F()
130 ASSERT_EQ(0xee, buf[2]); in TEST_F()
131 ASSERT_EQ(0xee, buf[3]); in TEST_F()
135 char buf[MAX_VALUE_SIZE + 1]; in TEST_F() local
137 buf[i] = 'b'; in TEST_F()
139 ASSERT_EQ(BlobCache::InsertResult::kValueTooBig, mBC->set("abcd", 4, buf, MAX_VALUE_SIZE + 1)); in TEST_F()
141 buf[i] = 0xee; in TEST_F()
143 ASSERT_EQ(size_t(0), mBC->get("abcd", 4, buf, MAX_VALUE_SIZE + 1)); in TEST_F()
146 ASSERT_EQ(0xee, buf[i]); in TEST_F()
158 char buf[bufSize]; in TEST_F() local
163 buf[i] = 'b'; in TEST_F()
167 mBC->set(key, MAX_KEY_SIZE, buf, MAX_VALUE_SIZE)); in TEST_F()
173 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
178 ASSERT_EQ(size_t(4), mBC->get(key, MAX_KEY_SIZE, buf, 4)); in TEST_F()
179 ASSERT_EQ('w', buf[0]); in TEST_F()
180 ASSERT_EQ('x', buf[1]); in TEST_F()
181 ASSERT_EQ('y', buf[2]); in TEST_F()
182 ASSERT_EQ('z', buf[3]); in TEST_F()
186 char buf[MAX_VALUE_SIZE]; in TEST_F() local
188 buf[i] = 'b'; in TEST_F()
190 ASSERT_EQ(BlobCache::InsertResult::kInserted, mBC->set("abcd", 4, buf, MAX_VALUE_SIZE)); in TEST_F()
192 buf[i] = 0xee; in TEST_F()
194 ASSERT_EQ(size_t(MAX_VALUE_SIZE), mBC->get("abcd", 4, buf, MAX_VALUE_SIZE)); in TEST_F()
197 ASSERT_EQ('b', buf[i]); in TEST_F()
208 char buf[bufSize]; in TEST_F() local
213 buf[i] = 'b'; in TEST_F()
216 ASSERT_EQ(BlobCache::InsertResult::kInserted, mBC->set(key, MAX_KEY_SIZE, buf, bufSize)); in TEST_F()
235 char buf[bufSize]; in TEST_F() local
240 buf[i] = 'b'; in TEST_F()
243 ASSERT_EQ(BlobCache::InsertResult::kNotEnoughSpace, mBC->set(key, MAX_KEY_SIZE, buf, bufSize)); in TEST_F()
253 unsigned char buf[1] = {0xee}; in TEST_F() local
255 ASSERT_EQ(size_t(1), mBC->get("x", 1, buf, 1)); in TEST_F()
256 ASSERT_EQ('y', buf[0]); in TEST_F()
329 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
332 ASSERT_EQ(size_t(4), mBC2->get("abcd", 4, buf, 4)); in TEST_F()
333 ASSERT_EQ('e', buf[0]); in TEST_F()
334 ASSERT_EQ('f', buf[1]); in TEST_F()
335 ASSERT_EQ('g', buf[2]); in TEST_F()
336 ASSERT_EQ('h', buf[3]); in TEST_F()
397 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
410 ASSERT_EQ(size_t(0), mBC2->get("abcd", 4, buf, 4)); in TEST_F()
414 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
429 ASSERT_EQ(size_t(0), mBC2->get("abcd", 4, buf, 4)); in TEST_F()
433 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
448 ASSERT_EQ(size_t(0), mBC2->get("abcd", 4, buf, 4)); in TEST_F()
452 unsigned char buf[4] = {0xee, 0xee, 0xee, 0xee}; in TEST_F() local
466 ASSERT_EQ(size_t(0), mBC2->get("abcd", 4, buf, 4)); in TEST_F()