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

Side by Side Diff: src/utils/SkRTConf.cpp

Issue 444303002: Migrate SkRTConfRegistry test to DEF_TEST(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: mtklein changes Created 6 years, 4 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
« no previous file with comments | « include/utils/SkRTConf.h ('k') | tests/RTConfRegistryTest.cpp » ('j') | 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 * 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
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
OLDNEW
« no previous file with comments | « include/utils/SkRTConf.h ('k') | tests/RTConfRegistryTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698