OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkRTConf.h" | 8 #include "SkRTConf.h" |
9 #include "SkOSFile.h" | 9 #include "SkOSFile.h" |
10 | 10 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 template void SkRTConfRegistry::set(const char *name, int value, bool); | 314 template void SkRTConfRegistry::set(const char *name, int value, bool); |
315 template void SkRTConfRegistry::set(const char *name, unsigned int value, bool); | 315 template void SkRTConfRegistry::set(const char *name, unsigned int value, bool); |
316 template void SkRTConfRegistry::set(const char *name, float value, bool); | 316 template void SkRTConfRegistry::set(const char *name, float value, bool); |
317 template void SkRTConfRegistry::set(const char *name, double value, bool); | 317 template void SkRTConfRegistry::set(const char *name, double value, bool); |
318 template void SkRTConfRegistry::set(const char *name, char * value, bool); | 318 template void SkRTConfRegistry::set(const char *name, char * value, bool); |
319 | 319 |
320 SkRTConfRegistry &skRTConfRegistry() { | 320 SkRTConfRegistry &skRTConfRegistry() { |
321 static SkRTConfRegistry r; | 321 static SkRTConfRegistry r; |
322 return r; | 322 return r; |
323 } | 323 } |
324 | |
325 | |
326 #ifdef SK_SUPPORT_UNITTEST | |
327 | |
328 #ifdef SK_BUILD_FOR_WIN32 | |
329 static void sk_setenv(const char* key, const char* value) { | |
330 _putenv_s(key, value); | |
331 } | |
332 #else | |
333 static void sk_setenv(const char* key, const char* value) { | |
334 setenv(key, value, 1); | |
335 } | |
336 #endif | |
337 | |
338 void SkRTConfRegistry::UnitTest() { | |
339 SkRTConfRegistry registryWithoutContents(true); | |
340 | |
341 sk_setenv("skia_nonexistent_item", "132"); | |
342 int result = 0; | |
343 registryWithoutContents.parse("nonexistent.item", &result); | |
344 SkASSERT(result == 132); | |
345 } | |
346 | |
347 SkRTConfRegistry::SkRTConfRegistry(bool) | |
348 : fConfs(100) { | |
349 } | |
350 #endif | |
OLD | NEW |