Home | History | Annotate | Download | only in disk_cache

Lines Matching refs:buffer2

91   scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize2));
94 CacheTestFillBuffer(buffer2->data(), kSize2, false);
95 base::strlcpy(buffer2->data(), "The really big data goes here", kSize2);
96 EXPECT_EQ(5000, entry->WriteData(1, 1500, buffer2, kSize2, NULL, false));
97 memset(buffer2->data(), 0, kSize2);
98 EXPECT_EQ(4989, entry->ReadData(1, 1511, buffer2, kSize2, NULL));
99 EXPECT_STREQ("big data goes here", buffer2->data());
100 EXPECT_EQ(5000, entry->ReadData(1, 0, buffer2, kSize2, NULL));
101 EXPECT_EQ(0, memcmp(buffer2->data(), buffer3->data(), 1500));
102 EXPECT_EQ(1500, entry->ReadData(1, 5000, buffer2, kSize2, NULL));
104 EXPECT_EQ(0, entry->ReadData(1, 6500, buffer2, kSize2, NULL));
184 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize2));
187 CacheTestFillBuffer(buffer2->data(), kSize2, false);
199 memset(buffer2->data(), 0, kSize2);
200 ret = entry->ReadData(0, 0, buffer2, kSize1, &callback3);
206 EXPECT_STREQ("the data", buffer2->data());
208 base::strlcpy(buffer2->data(), "The really big data goes here", kSize2);
209 ret = entry->WriteData(1, 1500, buffer2, kSize2, &callback4, true);
223 ret = entry->ReadData(1, 0, buffer2, kSize2, &callback6);
231 EXPECT_EQ(0, memcmp(buffer2->data(), buffer3->data(), 1500));
232 ret = entry->ReadData(1, 5000, buffer2, kSize2, &callback7);
260 ret = entry->ReadData(1, 0, buffer2, kSize2, &callback13);
303 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize2));
305 CacheTestFillBuffer(buffer2->data(), kSize2, false);
312 base::strlcpy(buffer2->data(), "The really big data goes here", kSize2);
313 EXPECT_EQ(25000, entry->WriteData(1, 10000, buffer2, kSize2, NULL, false));
314 memset(buffer2->data(), 0, kSize2);
315 EXPECT_EQ(24989, entry->ReadData(1, 10011, buffer2, kSize2, NULL));
316 EXPECT_STREQ("big data goes here", buffer2->data());
317 EXPECT_EQ(25000, entry->ReadData(1, 0, buffer2, kSize2, NULL));
318 EXPECT_EQ(0, memcmp(buffer2->data(), buffer2->data(), 10000));
319 EXPECT_EQ(5000, entry->ReadData(1, 30000, buffer2, kSize2, NULL));
321 EXPECT_EQ(0, entry->ReadData(1, 35000, buffer2, kSize2, NULL));
388 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize2));
391 CacheTestFillBuffer(buffer2->data(), kSize2, false);
401 memset(buffer2->data(), 0, kSize1);
402 ret = entry->ReadData(0, 0, buffer2, kSize1, &callback2);
410 base::strlcpy(buffer2->data(), "The really big data goes here", kSize2);
411 ret = entry->WriteData(1, 10000, buffer2, kSize2, &callback3, false);
426 ret = entry->ReadData(1, 0, buffer2, kSize2, &callback5);
432 EXPECT_EQ(0, memcmp(buffer2->data(), buffer2->data(), 10000));
433 ret = entry->ReadData(1, 30000, buffer2, kSize2, &callback6);
438 EXPECT_EQ(0, entry->ReadData(1, 35000, buffer2, kSize2, &callback7));
486 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kBufferSize));
492 memset(buffer2->data(), 0, kBufferSize);
493 EXPECT_EQ(kBufferSize, ReadData(entry, i, 0, buffer2, kBufferSize));
494 EXPECT_EQ(0, memcmp(buffer1->data(), buffer2->data(), kBufferSize));
619 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize));
621 memset(buffer2->data(), 0, kSize);
625 EXPECT_EQ(10, ReadData(entry, 0, 0, buffer2, 10));
626 EXPECT_STREQ("the data", buffer2->data());
631 EXPECT_EQ(2000, ReadData(entry, 0, 0, buffer2, 2000));
632 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 2000));
636 EXPECT_EQ(20000, ReadData(entry, 0, 0, buffer2, kSize));
637 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), kSize));
640 memset(buffer2->data(), 0, kSize);
651 EXPECT_EQ(2000, ReadData(entry, 0, 0, buffer2, 2000));
652 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 2000));
654 memset(buffer2->data(), 0, kSize);
660 EXPECT_EQ(20000, ReadData(entry, 0, 0, buffer2, kSize));
661 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), kSize));
704 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize2));
707 memset(buffer2->data(), 0, kSize2);
726 EXPECT_EQ(20000, ReadData(entry, 0, 0, buffer2, 20000));
727 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 20000));
728 memset(buffer2->data(), 0, kSize2);
741 EXPECT_EQ(600, ReadData(entry, 0, 1000, buffer2, 600));
742 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 600));
743 EXPECT_EQ(1000, ReadData(entry, 0, 0, buffer2, 1000));
744 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 1000)) <<
838 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize));
840 CacheTestFillBuffer(buffer2->data(), kSize, true);
848 EXPECT_EQ(kSize, ReadData(entry, 1, 0, buffer2, kSize));
849 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
858 CacheTestFillBuffer(buffer2->data(), kSize, true);
859 EXPECT_EQ(kSize, ReadData(entry, 1, 5000, buffer2, kSize));
860 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
861 CacheTestFillBuffer(buffer2->data(), kSize, true);
862 EXPECT_EQ(kSize, ReadData(entry, 1, 0, buffer2, kSize));
863 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
864 CacheTestFillBuffer(buffer2->data(), kSize, true);
865 EXPECT_EQ(kSize, ReadData(entry, 1, 18000, buffer2, kSize));
866 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
878 CacheTestFillBuffer(buffer2->data(), kSize, true);
879 EXPECT_EQ(kSize, ReadData(entry, 1, 18000, buffer2, kSize));
880 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
881 CacheTestFillBuffer(buffer2->data(), kSize, true);
882 EXPECT_EQ(kSize, ReadData(entry, 1, 17000, buffer2, kSize));
883 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
886 CacheTestFillBuffer(buffer2->data(), kSize, true);
887 EXPECT_EQ(100, ReadData(entry, 1, 23000, buffer2, kSize));
888 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data() + 100, 100));
890 CacheTestFillBuffer(buffer2->data(), kSize, true);
891 EXPECT_EQ(100, ReadData(entry, 1, 23100, buffer2, kSize));
892 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data() + 100, 100));
897 CacheTestFillBuffer(buffer2->data(), kSize, true);
898 EXPECT_EQ(kSize, ReadData(entry, 1, 25000, buffer2, kSize));
899 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
900 CacheTestFillBuffer(buffer2->data(), kSize, true);
901 EXPECT_EQ(kSize, ReadData(entry, 1, 45000, buffer2, kSize));
902 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
929 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize));
931 CacheTestFillBuffer(buffer2->data(), kSize, true);
943 EXPECT_EQ(kSize, ReadData(entry, 1, 24000, buffer2, kSize));
944 EXPECT_TRUE(!memcmp(buffer2->data(), zeros, kSize));
947 EXPECT_EQ(kSize, ReadData(entry, 1, 23000 + kSize - 35, buffer2, kSize));
948 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data() + kSize - 35, 35));
951 CacheTestFillBuffer(buffer2->data(), kSize, true);
952 EXPECT_EQ(kSize, ReadData(entry, 1, 24900, buffer2, kSize));
953 EXPECT_TRUE(!memcmp(buffer2->data(), zeros, 100));
954 EXPECT_TRUE(!memcmp(buffer2->data() + 100, buffer1->data(), kSize - 100));
959 CacheTestFillBuffer(buffer2->data(), kSize, true);
960 EXPECT_EQ(kSize, ReadData(entry, 1, 25900, buffer2, kSize));
961 EXPECT_TRUE(!memcmp(buffer2->data(), zeros, 100));
962 EXPECT_TRUE(!memcmp(buffer2->data() + 100, buffer1->data(), kSize - 100));
967 EXPECT_EQ(28, ReadData(entry, 1, 25000 + kSize - 28, buffer2, kSize));
968 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data() + kSize - 28, 28));
975 EXPECT_EQ(kSize, ReadData(entry, 1, 23900, buffer2, kSize));
976 EXPECT_TRUE(!memcmp(buffer2->data(), zeros, 100));
977 EXPECT_TRUE(!memcmp(buffer2->data() + 100, buffer1->data(), kSize - 100));
982 EXPECT_EQ(kSize, ReadData(entry, 1, 18900, buffer2, kSize));
983 EXPECT_TRUE(!memcmp(buffer2->data(), zeros, 100));
984 EXPECT_TRUE(!memcmp(buffer2->data() + 100, buffer1->data(), kSize - 100));
1072 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize2));
1076 memset(buffer2->data(), 0, kSize2);
1082 EXPECT_TRUE(!memcmp(buffer3->data(), buffer2->data(), 100));
1090 EXPECT_TRUE(!memcmp(buffer3->data(), buffer2->data(), 100));
1098 EXPECT_TRUE(!memcmp(buffer3->data(), buffer2->data(), 100));
1104 EXPECT_TRUE(!memcmp(buffer3->data(), buffer2->data(), 4000));
1116 EXPECT_TRUE(!memcmp(buffer3->data(), buffer2->data(), 200));
1122 EXPECT_TRUE(!memcmp(buffer3->data(), buffer2->data(), 200));
1225 scoped_refptr<net::IOBuffer> buffer2(new net::IOBuffer(kSize2));
1227 memset(buffer2->data(), 0, kSize2);
1230 EXPECT_EQ(2000, ReadData(entry, 0, 0, buffer2, 2000));
1231 EXPECT_EQ(0, memcmp(buffer1->data(), buffer2->data(), kSize1));