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

Unified Diff: tests/RTConfRegistryTest.cpp

Issue 444303002: Migrate SkRTConfRegistry test to DEF_TEST(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« include/utils/SkRTConf.h ('K') | « src/utils/SkRTConf.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RTConfRegistryTest.cpp
diff --git a/tests/RTConfRegistryTest.cpp b/tests/RTConfRegistryTest.cpp
index f42281fa22f9bb75aa8e31aa3b5807b495b07556..2b61256f5b99c1f787d2b49381b9af971532288d 100644
--- a/tests/RTConfRegistryTest.cpp
+++ b/tests/RTConfRegistryTest.cpp
@@ -8,8 +8,21 @@
#include "SkRTConf.h"
#include "Test.h"
-DEF_TEST(SkRTConfRegistry, reporter) {
-#ifdef SK_SUPPORT_UNITTEST
- SkRTConfRegistry::UnitTest();
+#ifdef SK_BUILD_FOR_WIN32
+static void sk_setenv(const char* key, const char* value) {
+ _putenv_s(key, value);
+}
+#else
+static void sk_setenv(const char* key, const char* value) {
+ setenv(key, value, 1);
+}
#endif
+
+DEF_TEST(SkRTConfRegistry, reporter) {
+ SkRTConfRegistry registryWithoutContents;
+
+ sk_setenv("skia_nonexistent_item", "132");
+ int result = 0;
+ registryWithoutContents.parse("nonexistent.item", &result);
+ SkASSERT(result == 132);
mtklein 2014/08/07 12:26:14 REPORTER_ASSERT?
tfarina 2014/08/07 14:11:27 Done.
}
« include/utils/SkRTConf.h ('K') | « src/utils/SkRTConf.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698