remove wxFileConfig tests: FileConfigTestCase already tests features tested by console sample and is much more complete.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -105,12 +105,10 @@
|
||||
|
||||
|
||||
#if TEST_ALL
|
||||
#define TEST_DATETIME
|
||||
#define TEST_DIR
|
||||
#define TEST_DYNLIB
|
||||
#define TEST_ENVIRON
|
||||
#define TEST_FILE
|
||||
#define TEST_FILECONF
|
||||
#define TEST_FILENAME
|
||||
#define TEST_FILETIME
|
||||
#define TEST_INFO_FUNCTIONS
|
||||
@@ -622,75 +620,6 @@ static void TestTempFile()
|
||||
|
||||
#endif // TEST_FILE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileConfig
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef TEST_FILECONF
|
||||
|
||||
#include "wx/confbase.h"
|
||||
#include "wx/fileconf.h"
|
||||
|
||||
static const struct FileConfTestData
|
||||
{
|
||||
const wxChar *name; // value name
|
||||
const wxChar *value; // the value from the file
|
||||
} fcTestData[] =
|
||||
{
|
||||
{ wxT("value1"), wxT("one") },
|
||||
{ wxT("value2"), wxT("two") },
|
||||
{ wxT("novalue"), wxT("default") },
|
||||
};
|
||||
|
||||
static void TestFileConfRead()
|
||||
{
|
||||
wxPuts(wxT("*** testing wxFileConfig loading/reading ***"));
|
||||
|
||||
wxFileConfig fileconf(wxT("test"), wxEmptyString,
|
||||
wxT("testdata.fc"), wxEmptyString,
|
||||
wxCONFIG_USE_RELATIVE_PATH);
|
||||
|
||||
// test simple reading
|
||||
wxPuts(wxT("\nReading config file:"));
|
||||
wxString defValue(wxT("default")), value;
|
||||
for ( size_t n = 0; n < WXSIZEOF(fcTestData); n++ )
|
||||
{
|
||||
const FileConfTestData& data = fcTestData[n];
|
||||
value = fileconf.Read(data.name, defValue);
|
||||
wxPrintf(wxT("\t%s = %s "), data.name, value.c_str());
|
||||
if ( value == data.value )
|
||||
{
|
||||
wxPuts(wxT("(ok)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wxPrintf(wxT("(ERROR: should be %s)\n"), data.value);
|
||||
}
|
||||
}
|
||||
|
||||
// test enumerating the entries
|
||||
wxPuts(wxT("\nEnumerating all root entries:"));
|
||||
long dummy;
|
||||
wxString name;
|
||||
bool cont = fileconf.GetFirstEntry(name, dummy);
|
||||
while ( cont )
|
||||
{
|
||||
wxPrintf(wxT("\t%s = %s\n"),
|
||||
name.c_str(),
|
||||
fileconf.Read(name.c_str(), wxT("ERROR")).c_str());
|
||||
|
||||
cont = fileconf.GetNextEntry(name, dummy);
|
||||
}
|
||||
|
||||
static const wxChar *testEntry = wxT("TestEntry");
|
||||
wxPrintf(wxT("\nTesting deletion of newly created \"Test\" entry: "));
|
||||
fileconf.Write(testEntry, wxT("A value"));
|
||||
fileconf.DeleteEntry(testEntry);
|
||||
wxPrintf(fileconf.HasEntry(testEntry) ? wxT("ERROR\n") : wxT("ok\n"));
|
||||
}
|
||||
|
||||
#endif // TEST_FILECONF
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileName
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -1999,10 +1928,6 @@ int main(int argc, char **argv)
|
||||
TestEnvironment();
|
||||
#endif // TEST_ENVIRON
|
||||
|
||||
#ifdef TEST_FILECONF
|
||||
TestFileConfRead();
|
||||
#endif // TEST_FILECONF
|
||||
|
||||
#ifdef TEST_LOCALE
|
||||
TestDefaultLang();
|
||||
#endif // TEST_LOCALE
|
||||
|
Reference in New Issue
Block a user