'../tests/TSetTest.cpp',
'../tests/ToUnicode.cpp',
'../tests/UnicodeTest.cpp',
- '../tests/UnitTestTest.cpp',
'../tests/UtilsTest.cpp',
'../tests/WArrayTest.cpp',
'../tests/WritePixelsTest.cpp',
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;
SkTDArray<SkString *> fConfigFileKeys, fConfigFileValues;
typedef SkTDict< SkTDArray<SkRTConfBase *> * > ConfMap;
ConfMap fConfs;
-#ifdef SK_SUPPORT_UNITTEST
- SkRTConfRegistry(bool);
-#endif
};
// our singleton registry
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)) {
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
sk_free(underscore_name);
environment_value = getenv(underscore_environment_variable.c_str());
if (environment_value) {
- if (NULL == str) {
- str = &tmp;
- }
str->set(environment_value);
}
}
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
+++ /dev/null
-/*
- * 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)