added wxRegConfig read test

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-11-30 13:53:04 +00:00
parent deadb443c6
commit 0aa29b6bfb

View File

@@ -74,6 +74,7 @@
#define TEST_PRINTF #define TEST_PRINTF
#define TEST_REGCONF #define TEST_REGCONF
#define TEST_REGEX #define TEST_REGEX
#define TEST_REGEX
#define TEST_REGISTRY #define TEST_REGISTRY
#define TEST_SCOPEGUARD #define TEST_SCOPEGUARD
#define TEST_SNGLINST #define TEST_SNGLINST
@@ -93,9 +94,7 @@
#undef TEST_ALL #undef TEST_ALL
static const bool TEST_ALL = true; static const bool TEST_ALL = true;
#else #else
#define TEST_HASH #define TEST_FILENAME
#define TEST_HASHMAP
#define TEST_HASHSET
static const bool TEST_ALL = false; static const bool TEST_ALL = false;
#endif #endif
@@ -1061,6 +1060,11 @@ static void TestFileNameMakeAbsolute()
wxPuts(_T("")); wxPuts(_T(""));
} }
static void TestFileNameDirManip()
{
// TODO: test AppendDir(), RemoveDir(), ...
}
static void TestFileNameComparison() static void TestFileNameComparison()
{ {
// TODO! // TODO!
@@ -3216,8 +3220,27 @@ rfg2 (void)
static void TestRegConfWrite() static void TestRegConfWrite()
{ {
wxRegConfig regconf(_T("console"), _T("wxwindows")); wxConfig *config = new wxConfig("myapp");
regconf.Write(_T("Hello"), wxString(_T("world"))); config->SetPath("/group1");
config->Write("entry1", "foo");
config->SetPath("/group2");
config->Write("entry1", "bar");
}
static void TestRegConfRead()
{
wxConfig *config = new wxConfig("myapp");
wxString str;
long dummy;
config->SetPath("/");
puts("Enumerating / subgroups:");
bool bCont = config->GetFirstGroup(str, dummy);
while(bCont)
{
puts(str);
bCont = config->GetNextGroup(str, dummy);
}
} }
#endif // TEST_REGCONF #endif // TEST_REGCONF
@@ -7229,15 +7252,6 @@ int main(int argc, char **argv)
#endif // TEST_FILE #endif // TEST_FILE
#ifdef TEST_FILENAME #ifdef TEST_FILENAME
if ( 1 )
{
wxFileName fn(_T("c:\\foo"), _T("bar.baz"));
DumpFileName(_T("Before Normalize():"), fn);
fn.Normalize();
DumpFileName(_T("After Normalize():"), fn);
}
if ( TEST_ALL ) if ( TEST_ALL )
{ {
TestFileNameConstruction(); TestFileNameConstruction();
@@ -7246,6 +7260,7 @@ int main(int argc, char **argv)
TestFileNameSplit(); TestFileNameSplit();
TestFileNameTemp(); TestFileNameTemp();
TestFileNameCwd(); TestFileNameCwd();
TestFileNameDirManip();
TestFileNameComparison(); TestFileNameComparison();
TestFileNameOperations(); TestFileNameOperations();
} }
@@ -7348,7 +7363,8 @@ int main(int argc, char **argv)
#endif // TEST_PRINTF #endif // TEST_PRINTF
#ifdef TEST_REGCONF #ifdef TEST_REGCONF
TestRegConfWrite(); //TestRegConfWrite();
TestRegConfRead();
#endif // TEST_REGCONF #endif // TEST_REGCONF
#ifdef TEST_REGEX #ifdef TEST_REGEX