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
This commit is contained in:
parent
3de23b1aa1
commit
1c0ade7fc6
@ -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',
|
||||
|
@ -73,9 +73,6 @@ public:
|
||||
void possiblyDumpFile() const;
|
||||
void validate() const;
|
||||
template <typename T> void set(const char *confname, T value);
|
||||
#ifdef SK_SUPPORT_UNITTEST
|
||||
static void UnitTest();
|
||||
#endif
|
||||
private:
|
||||
template<typename T> friend class SkRTConf;
|
||||
|
||||
@ -85,9 +82,6 @@ private:
|
||||
SkTDArray<SkString *> fConfigFileKeys, fConfigFileValues;
|
||||
typedef SkTDict< SkTDArray<SkRTConfBase *> * > ConfMap;
|
||||
ConfMap fConfs;
|
||||
#ifdef SK_SUPPORT_UNITTEST
|
||||
SkRTConfRegistry(bool);
|
||||
#endif
|
||||
};
|
||||
|
||||
// our singleton registry
|
||||
|
@ -214,7 +214,6 @@ static inline void str_replace(char *s, char search, char replace) {
|
||||
|
||||
template<typename T> 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<typename T> 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<typename T> 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
|
||||
|
@ -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)
|
Loading…
Reference in New Issue
Block a user