Index: tests/RTConfRegistryTest.cpp |
diff --git a/tests/RTConfRegistryTest.cpp b/tests/RTConfRegistryTest.cpp |
index f42281fa22f9bb75aa8e31aa3b5807b495b07556..59fb3e9142c81f8b1692738d1fdacac6bdda77ed 100644 |
--- a/tests/RTConfRegistryTest.cpp |
+++ b/tests/RTConfRegistryTest.cpp |
@@ -8,8 +8,25 @@ |
#include "SkRTConf.h" |
#include "Test.h" |
-DEF_TEST(SkRTConfRegistry, reporter) { |
-#ifdef SK_SUPPORT_UNITTEST |
- SkRTConfRegistry::UnitTest(); |
+// Friended proxy for SkRTConfRegistry::parse() |
+template <typename T> |
+bool test_rt_conf_parse(SkRTConfRegistry* reg, const char* key, T* value) { |
+ return reg->parse(key, value); |
+} |
+ |
+static void portable_setenv(const char* key, const char* value) { |
+#ifdef SK_BUILD_FOR_WIN32 |
+ _putenv_s(key, value); |
+#else |
+ setenv(key, value, 1); |
#endif |
} |
+ |
+DEF_TEST(SkRTConfRegistry, reporter) { |
+ SkRTConfRegistry reg; |
+ |
+ portable_setenv("skia_nonexistent_item", "132"); |
+ int result = 0; |
+ test_rt_conf_parse(®, "nonexistent.item", &result); |
+ REPORTER_ASSERT(reporter, result == 132); |
+} |