| commit-bot@chromium.org | c1bf2de | 2013-08-14 18:14:37 +0000 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright 2013 Google Inc. | 
|  | 3 | * | 
|  | 4 | * Use of this source code is governed by a BSD-style license that can be | 
|  | 5 | * found in the LICENSE file. | 
|  | 6 | */ | 
|  | 7 |  | 
| tfarina@chromium.org | e4fafb1 | 2013-12-12 21:11:12 +0000 | [diff] [blame] | 8 | #include "SkRTConf.h" | 
| kkinnunen | dd180e7 | 2015-12-21 04:05:53 -0800 | [diff] [blame] | 9 | #include "SkOSEnvironment.h" | 
| tfarina@chromium.org | 8f6884a | 2014-01-24 20:56:26 +0000 | [diff] [blame] | 10 | #include "Test.h" | 
| commit-bot@chromium.org | c1bf2de | 2013-08-14 18:14:37 +0000 | [diff] [blame] | 11 |  | 
| tfarina | 35fbd01 | 2014-08-12 09:03:16 -0700 | [diff] [blame] | 12 | // Friended proxy for SkRTConfRegistry::parse() | 
|  | 13 | template <typename T> | 
|  | 14 | bool test_rt_conf_parse(SkRTConfRegistry* reg, const char* key, T* value) { | 
|  | 15 | return reg->parse(key, value); | 
|  | 16 | } | 
|  | 17 |  | 
| tfarina | 35fbd01 | 2014-08-12 09:03:16 -0700 | [diff] [blame] | 18 | DEF_TEST(SkRTConfRegistry, reporter) { | 
|  | 19 | SkRTConfRegistry reg; | 
|  | 20 |  | 
| kkinnunen | dd180e7 | 2015-12-21 04:05:53 -0800 | [diff] [blame] | 21 | sk_setenv("skia_nonexistent_item", "132"); | 
| tfarina | 35fbd01 | 2014-08-12 09:03:16 -0700 | [diff] [blame] | 22 | int result = 0; | 
|  | 23 | test_rt_conf_parse(®, "nonexistent.item", &result); | 
|  | 24 | REPORTER_ASSERT(reporter, result == 132); | 
|  | 25 | } |