blob: be019f70b418507a3df49c7b30f806c33c9c35bc [file] [log] [blame]
commit-bot@chromium.orgc1bf2de2013-08-14 18:14:37 +00001/*
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.orge4fafb12013-12-12 21:11:12 +00008#include "SkRTConf.h"
kkinnunendd180e72015-12-21 04:05:53 -08009#include "SkOSEnvironment.h"
tfarina@chromium.org8f6884a2014-01-24 20:56:26 +000010#include "Test.h"
commit-bot@chromium.orgc1bf2de2013-08-14 18:14:37 +000011
tfarina35fbd012014-08-12 09:03:16 -070012// Friended proxy for SkRTConfRegistry::parse()
13template <typename T>
14bool test_rt_conf_parse(SkRTConfRegistry* reg, const char* key, T* value) {
15 return reg->parse(key, value);
16}
17
tfarina35fbd012014-08-12 09:03:16 -070018DEF_TEST(SkRTConfRegistry, reporter) {
19 SkRTConfRegistry reg;
20
kkinnunendd180e72015-12-21 04:05:53 -080021 sk_setenv("skia_nonexistent_item", "132");
tfarina35fbd012014-08-12 09:03:16 -070022 int result = 0;
23 test_rt_conf_parse(&reg, "nonexistent.item", &result);
24 REPORTER_ASSERT(reporter, result == 132);
25}