Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Unified Diff: test/cctest/test-strings.cc

Issue 11428106: Add StringBufferStream (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Style update Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/objects.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index 5a9ccbb5790732cb0b42528860867bcbafa811be..68e735b886e45c9a8dbfa53c3330f1af0c0ac6f9 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -198,18 +198,22 @@ static Handle<String> ConstructBalanced(
static StringInputBuffer buffer;
-
+static ConsStringIteratorOp consStringIteratorOp;
static void Traverse(Handle<String> s1, Handle<String> s2) {
int i = 0;
buffer.Reset(*s1);
+ StringCharacterStream characterStream(*s1, 0, &consStringIteratorOp);
StringInputBuffer buffer2(*s2);
while (buffer.has_more()) {
CHECK(buffer2.has_more());
+ CHECK(characterStream.HasMore());
uint16_t c = buffer.GetNext();
CHECK_EQ(c, buffer2.GetNext());
+ CHECK_EQ(c, characterStream.GetNext());
i++;
}
+ CHECK(!characterStream.HasMore());
CHECK_EQ(s1->length(), i);
CHECK_EQ(s2->length(), i);
}
@@ -219,10 +223,13 @@ static void TraverseFirst(Handle<String> s1, Handle<String> s2, int chars) {
int i = 0;
buffer.Reset(*s1);
StringInputBuffer buffer2(*s2);
+ StringCharacterStream characterStream(*s1, 0, &consStringIteratorOp);
while (buffer.has_more() && i < chars) {
CHECK(buffer2.has_more());
+ CHECK(characterStream.HasMore());
uint16_t c = buffer.GetNext();
CHECK_EQ(c, buffer2.GetNext());
+ CHECK_EQ(c, characterStream.GetNext());
i++;
}
s1->Get(s1->length() - 1);
« src/objects.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698