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

Side by Side Diff: tests/StringTest.cpp

Issue 14773022: Revert r9081 (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkString.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "Test.h" 8 #include "Test.h"
9 #include "SkString.h" 9 #include "SkString.h"
10 #include <stdarg.h> 10 #include <stdarg.h>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 REPORTER_ASSERT(reporter, a != b && a != c && b == c); 86 REPORTER_ASSERT(reporter, a != b && a != c && b == c);
87 87
88 a.append(" world"); 88 a.append(" world");
89 e.append("worldz", 5); 89 e.append("worldz", 5);
90 e.insert(5, " "); 90 e.insert(5, " ");
91 f.set("world"); 91 f.set("world");
92 f.prepend("hello "); 92 f.prepend("hello ");
93 REPORTER_ASSERT(reporter, a.equals("hello world") && a == e && a == f); 93 REPORTER_ASSERT(reporter, a.equals("hello world") && a == e && a == f);
94 94
95 a.reset(); 95 a.reset();
96 a.append(SkString("string"));
97 a.append("text");
98 a.append('c');
99 REPORTER_ASSERT(reporter, a.equals("stringtextc"));
100
101 a.reset();
102 a += 'c';
103 a += "text";
104 a += SkString("string");
105 REPORTER_ASSERT(reporter, a.equals("ctextstring"));
106
107 a.reset();
108 b.resize(0); 96 b.resize(0);
109 REPORTER_ASSERT(reporter, a.isEmpty() && b.isEmpty() && a == b); 97 REPORTER_ASSERT(reporter, a.isEmpty() && b.isEmpty() && a == b);
110 98
111 a.set("a"); 99 a.set("a");
112 a.set("ab"); 100 a.set("ab");
113 a.set("abc"); 101 a.set("abc");
114 a.set("abcd"); 102 a.set("abcd");
115 103
116 a.set(""); 104 a.set("");
117 a.appendS64(72036854775808LL, 0); 105 a.appendS64(72036854775808LL, 0);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 REPORTER_ASSERT(reporter, buffer[20] == 'a'); 152 REPORTER_ASSERT(reporter, buffer[20] == 'a');
165 printfAnalog(buffer, 20, "%30d", 0); 153 printfAnalog(buffer, 20, "%30d", 0);
166 REPORTER_ASSERT(reporter, buffer[18] == ' '); 154 REPORTER_ASSERT(reporter, buffer[18] == ' ');
167 REPORTER_ASSERT(reporter, buffer[19] == 0); 155 REPORTER_ASSERT(reporter, buffer[19] == 0);
168 REPORTER_ASSERT(reporter, buffer[20] == 'a'); 156 REPORTER_ASSERT(reporter, buffer[20] == 'a');
169 157
170 } 158 }
171 159
172 #include "TestClassDef.h" 160 #include "TestClassDef.h"
173 DEFINE_TESTCLASS("String", StringTestClass, TestString) 161 DEFINE_TESTCLASS("String", StringTestClass, TestString)
OLDNEW
« no previous file with comments | « include/core/SkString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698