OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Test.h" | |
9 #include "SkString.h" | |
10 #include <stdarg.h> | 8 #include <stdarg.h> |
11 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include "SkString.h" |
| 11 #include "Test.h" |
12 | 12 |
13 // Windows vsnprintf doesn't 0-terminate safely), but is so far | 13 // Windows vsnprintf doesn't 0-terminate safely), but is so far |
14 // encapsulated in SkString that we can't test it directly. | 14 // encapsulated in SkString that we can't test it directly. |
15 | 15 |
16 #ifdef SK_BUILD_FOR_WIN | 16 #ifdef SK_BUILD_FOR_WIN |
17 #define VSNPRINTF(buffer, size, format, args) \ | 17 #define VSNPRINTF(buffer, size, format, args) \ |
18 vsnprintf_s(buffer, size, _TRUNCATE, format, args) | 18 vsnprintf_s(buffer, size, _TRUNCATE, format, args) |
19 #else | 19 #else |
20 #define VSNPRINTF vsnprintf | 20 #define VSNPRINTF vsnprintf |
21 #endif | 21 #endif |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 SkStrSplit("a-_b_c-dee--f-_-_-g-", "-_", &results); | 192 SkStrSplit("a-_b_c-dee--f-_-_-g-", "-_", &results); |
193 REPORTER_ASSERT(r, results.count() == 6); | 193 REPORTER_ASSERT(r, results.count() == 6); |
194 REPORTER_ASSERT(r, results[0].equals("a")); | 194 REPORTER_ASSERT(r, results[0].equals("a")); |
195 REPORTER_ASSERT(r, results[1].equals("b")); | 195 REPORTER_ASSERT(r, results[1].equals("b")); |
196 REPORTER_ASSERT(r, results[2].equals("c")); | 196 REPORTER_ASSERT(r, results[2].equals("c")); |
197 REPORTER_ASSERT(r, results[3].equals("dee")); | 197 REPORTER_ASSERT(r, results[3].equals("dee")); |
198 REPORTER_ASSERT(r, results[4].equals("f")); | 198 REPORTER_ASSERT(r, results[4].equals("f")); |
199 REPORTER_ASSERT(r, results[5].equals("g")); | 199 REPORTER_ASSERT(r, results[5].equals("g")); |
200 } | 200 } |
OLD | NEW |