From 1c0ade7fc67a45f0c3068303aefaba846e2ffa05 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Sun, 11 Aug 2013 13:20:18 +0000 Subject: [PATCH] Reverted r10654 (Fix crash when querying a runtime config that is defined in environment) due to compilation failure on Chromium win_layout bot git-svn-id: http://skia.googlecode.com/svn/trunk@10669 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gyp/tests.gyp | 1 - include/utils/SkRTConf.h | 6 ------ src/utils/SkRTConf.cpp | 22 ---------------------- tests/UnitTestTest.cpp | 18 ------------------ 4 files changed, 47 deletions(-) delete mode 100644 tests/UnitTestTest.cpp diff --git a/gyp/tests.gyp b/gyp/tests.gyp index 9062446c73..f58b0abff0 100644 --- a/gyp/tests.gyp +++ b/gyp/tests.gyp @@ -127,7 +127,6 @@ '../tests/TSetTest.cpp', '../tests/ToUnicode.cpp', '../tests/UnicodeTest.cpp', - '../tests/UnitTestTest.cpp', '../tests/UtilsTest.cpp', '../tests/WArrayTest.cpp', '../tests/WritePixelsTest.cpp', diff --git a/include/utils/SkRTConf.h b/include/utils/SkRTConf.h index dc1f461b11..ea6e99ed89 100644 --- a/include/utils/SkRTConf.h +++ b/include/utils/SkRTConf.h @@ -73,9 +73,6 @@ public: void possiblyDumpFile() const; void validate() const; template void set(const char *confname, T value); -#ifdef SK_SUPPORT_UNITTEST - static void UnitTest(); -#endif private: template friend class SkRTConf; @@ -85,9 +82,6 @@ private: SkTDArray fConfigFileKeys, fConfigFileValues; typedef SkTDict< SkTDArray * > ConfMap; ConfMap fConfs; -#ifdef SK_SUPPORT_UNITTEST - SkRTConfRegistry(bool); -#endif }; // our singleton registry diff --git a/src/utils/SkRTConf.cpp b/src/utils/SkRTConf.cpp index 18b7ca32bb..e0977fe42f 100644 --- a/src/utils/SkRTConf.cpp +++ b/src/utils/SkRTConf.cpp @@ -214,7 +214,6 @@ static inline void str_replace(char *s, char search, char replace) { template bool SkRTConfRegistry::parse(const char *name, T* value) { SkString *str = NULL; - SkString tmp; for (int i = fConfigFileKeys.count() - 1 ; i >= 0; i--) { if (fConfigFileKeys[i]->equals(name)) { @@ -228,9 +227,6 @@ template bool SkRTConfRegistry::parse(const char *name, T* value) { const char *environment_value = getenv(environment_variable.c_str()); if (environment_value) { - if (NULL == str) { - str = &tmp; - } str->set(environment_value); } else { // apparently my shell doesn't let me have environment variables that @@ -242,9 +238,6 @@ template bool SkRTConfRegistry::parse(const char *name, T* value) { sk_free(underscore_name); environment_value = getenv(underscore_environment_variable.c_str()); if (environment_value) { - if (NULL == str) { - str = &tmp; - } str->set(environment_value); } } @@ -301,18 +294,3 @@ SkRTConfRegistry &skRTConfRegistry() { static SkRTConfRegistry r; return r; } - -#ifdef SK_SUPPORT_UNITTEST -void SkRTConfRegistry::UnitTest() { - SkRTConfRegistry registryWithoutContents(true); - - setenv("skia_nonexistent_item", "132", 1); - int result = 0; - registryWithoutContents.parse("nonexistent.item", &result); - SkASSERT(result == 132); -} - -SkRTConfRegistry::SkRTConfRegistry(bool) - : fConfs(100) { -} -#endif diff --git a/tests/UnitTestTest.cpp b/tests/UnitTestTest.cpp deleted file mode 100644 index e3e1b97685..0000000000 --- a/tests/UnitTestTest.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2013 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkRTConf.h" -#include "Test.h" - -static void test_runUnitTests(skiatest::Reporter* reporter) { -#ifdef SK_SUPPORT_UNITTEST - SkRTConfRegistry::UnitTest(); -#endif -} - -#include "TestClassDef.h" -DEFINE_TESTCLASS("UnitTest", UnitTestTestClass, test_runUnitTests)