| OLD | NEW |
| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 REPORTER_ASSERT(reporter, buffer[20] == 'a'); | 185 REPORTER_ASSERT(reporter, buffer[20] == 'a'); |
| 186 printfAnalog(buffer, 20, "%30d", 0); | 186 printfAnalog(buffer, 20, "%30d", 0); |
| 187 REPORTER_ASSERT(reporter, buffer[18] == ' '); | 187 REPORTER_ASSERT(reporter, buffer[18] == ' '); |
| 188 REPORTER_ASSERT(reporter, buffer[19] == 0); | 188 REPORTER_ASSERT(reporter, buffer[19] == 0); |
| 189 REPORTER_ASSERT(reporter, buffer[20] == 'a'); | 189 REPORTER_ASSERT(reporter, buffer[20] == 'a'); |
| 190 | 190 |
| 191 } | 191 } |
| 192 | 192 |
| 193 #include "TestClassDef.h" | 193 #include "TestClassDef.h" |
| 194 DEFINE_TESTCLASS("String", StringTestClass, TestString) | 194 DEFINE_TESTCLASS("String", StringTestClass, TestString) |
| 195 |
| 196 DEF_TEST(String_SkStrSplit, r) { |
| 197 SkTArray<SkString> results; |
| 198 |
| 199 SkStrSplit("a-_b_c-dee--f-_-_-g-", "-_", &results); |
| 200 REPORTER_ASSERT(r, results.count() == 6); |
| 201 REPORTER_ASSERT(r, results[0].equals("a")); |
| 202 REPORTER_ASSERT(r, results[1].equals("b")); |
| 203 REPORTER_ASSERT(r, results[2].equals("c")); |
| 204 REPORTER_ASSERT(r, results[3].equals("dee")); |
| 205 REPORTER_ASSERT(r, results[4].equals("f")); |
| 206 REPORTER_ASSERT(r, results[5].equals("g")); |
| 207 } |
| OLD | NEW |