Home | History | Annotate | Download | only in test

Lines Matching defs:ba

29 void FillTestByteArray(ByteArray* ba, int32_t size) {
31 ba->Put(i, (byte_t)(i % 256));
35 void ReadByteArrayWithBuffer(ByteArray* ba, ByteVector* buffer, ByteVector* b) {
36 b->resize(ba->Length());
38 while (index < ba->Length()) {
39 int32_t bytes_read = ba->Get(index, buffer);
46 void ReadByteArrayWithSlidingWindow(ByteArray* ba, int window_size,
48 b->resize(ba->Length());
51 while (index < ba->Length()) {
54 int32_t bytes_read = ba->Get(index, &((*b)[0]), index, actual_window_size);
93 bool CopyTest(ByteArray* ba) {
94 ByteArrayPtr fixed_copy = new MemoryByteArray(ba->Length());
95 ba->CopyTo(fixed_copy);
96 EXPECT_EQ(ba->Length(), fixed_copy->Length());
97 EXPECT_TRUE(ReadComparison(ba, fixed_copy));
100 ba->CopyTo(growable_copy);
101 EXPECT_EQ(ba->Length(), growable_copy->Length());
102 EXPECT_TRUE(ReadComparison(ba, growable_copy));
107 bool ByteArrayTester(ByteArray* ba) {
108 return CopyTest(ba);
119 ByteArrayPtr ba = new MemoryByteArray(size);
120 byte_array_test::FillTestByteArray(ba, size);
121 EXPECT_TRUE(byte_array_test::ByteArrayTester(ba));
133 ByteArrayPtr ba = new GrowableMemoryByteArray();
134 byte_array_test::FillTestByteArray(ba, size);
135 EXPECT_TRUE(byte_array_test::ByteArrayTester(ba));