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> |
11 | 11 #include <stdio.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 163 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) |
OLD | NEW |