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

Side by Side Diff: tests/RTConfRegistryTest.cpp

Issue 1538863002: Enable NVPR with command buffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | « src/ports/SkOSEnvironment.cpp ('k') | no next file » | 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 "SkOSEnvironment.h"
9 #include "Test.h" 10 #include "Test.h"
10 11
11 #include <stdlib.h>
12
13 // Friended proxy for SkRTConfRegistry::parse() 12 // Friended proxy for SkRTConfRegistry::parse()
14 template <typename T> 13 template <typename T>
15 bool test_rt_conf_parse(SkRTConfRegistry* reg, const char* key, T* value) { 14 bool test_rt_conf_parse(SkRTConfRegistry* reg, const char* key, T* value) {
16 return reg->parse(key, value); 15 return reg->parse(key, value);
17 } 16 }
18 17
19 static void portable_setenv(const char* key, const char* value) {
20 #ifdef SK_BUILD_FOR_WIN32
21 _putenv_s(key, value);
22 #else
23 setenv(key, value, 1);
24 #endif
25 }
26
27 DEF_TEST(SkRTConfRegistry, reporter) { 18 DEF_TEST(SkRTConfRegistry, reporter) {
28 SkRTConfRegistry reg; 19 SkRTConfRegistry reg;
29 20
30 portable_setenv("skia_nonexistent_item", "132"); 21 sk_setenv("skia_nonexistent_item", "132");
31 int result = 0; 22 int result = 0;
32 test_rt_conf_parse(&reg, "nonexistent.item", &result); 23 test_rt_conf_parse(&reg, "nonexistent.item", &result);
33 REPORTER_ASSERT(reporter, result == 132); 24 REPORTER_ASSERT(reporter, result == 132);
34 } 25 }
OLDNEW
« no previous file with comments | « src/ports/SkOSEnvironment.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698