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

Side by Side Diff: tests/RTConfRegistryTest.cpp

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

Powered by Google App Engine
This is Rietveld 408576698