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:
Francesco Montorsi
2010-06-02 14:51:45 +00:00
parent 3634064463
commit a05e050bd4
8 changed files with 7 additions and 120 deletions

View File

@@ -84,7 +84,7 @@ COND_wxUSE_REGEX_builtin___LIB_REGEX_p = \
### Targets: ###
all: console$(EXEEXT) data
all: console$(EXEEXT)
install:
@@ -105,18 +105,6 @@ console$(EXEEXT): $(CONSOLE_OBJECTS)
$(__console___mac_setfilecmd)
data:
@mkdir -p .
@for f in testdata.fc; do \
if test ! -f ./$$f -a ! -d ./$$f ; \
then x=yep ; \
else x=`find $(srcdir)/$$f -newer ./$$f -print` ; \
fi; \
case "$$x" in ?*) \
cp -pRf $(srcdir)/$$f . ;; \
esac; \
done
console_console.o: $(srcdir)/console.cpp
$(CXXC) -c -o $@ $(CONSOLE_CXXFLAGS) $(srcdir)/console.cpp
@@ -124,4 +112,4 @@ console_console.o: $(srcdir)/console.cpp
# Include dependency info, if present:
@IF_GNU_MAKE@-include ./.deps/*.d
.PHONY: all install uninstall clean distclean data
.PHONY: all install uninstall clean distclean

View File

@@ -10,8 +10,4 @@
<wx-lib>base</wx-lib>
</exe>
<wx-data id="data">
<files>testdata.fc</files>
</wx-data>
</makefile>

View File

@@ -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

View File

@@ -174,7 +174,7 @@ $(OBJS):
### Targets: ###
all: $(OBJS)\console.exe data
all: $(OBJS)\console.exe
clean:
-if exist $(OBJS)\*.obj del $(OBJS)\*.obj
@@ -192,10 +192,6 @@ $(OBJS)\console.exe: $(CONSOLE_OBJECTS)
c0x32.obj $(CONSOLE_OBJECTS),$@,, $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__CAIRO_LIB_p) ole2w32.lib oleacc.lib import32.lib cw32$(__THREADSFLAG_5)$(__RUNTIME_LIBS_8).lib,,
|
data:
if not exist $(OBJS) mkdir $(OBJS)
for %f in (testdata.fc) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
$(OBJS)\console_console.obj: .\console.cpp
$(CXX) -q -c -P -o$@ $(CONSOLE_CXXFLAGS) .\console.cpp

View File

@@ -168,7 +168,7 @@ $(OBJS):
### Targets: ###
all: $(OBJS)\console.exe data
all: $(OBJS)\console.exe
clean:
-if exist $(OBJS)\*.o del $(OBJS)\*.o
@@ -178,14 +178,10 @@ clean:
$(OBJS)\console.exe: $(CONSOLE_OBJECTS)
$(CXX) -o $@ $(CONSOLE_OBJECTS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwininet
data:
if not exist $(OBJS) mkdir $(OBJS)
for %%f in (testdata.fc) do if not exist $(OBJS)\%%f copy .\%%f $(OBJS)
$(OBJS)\console_console.o: ./console.cpp
$(CXX) -c -o $@ $(CONSOLE_CXXFLAGS) $(CPPDEPS) $<
.PHONY: all clean data
.PHONY: all clean
SHELL := $(COMSPEC)

View File

@@ -264,7 +264,7 @@ $(OBJS):
### Targets: ###
all: $(OBJS)\console.exe data
all: $(OBJS)\console.exe
clean:
-if exist $(OBJS)\*.obj del $(OBJS)\*.obj
@@ -279,10 +279,6 @@ $(OBJS)\console.exe: $(CONSOLE_OBJECTS)
$(CONSOLE_OBJECTS) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wininet.lib
<<
data:
if not exist $(OBJS) mkdir $(OBJS)
for %f in (testdata.fc) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
$(OBJS)\console_console.obj: .\console.cpp
$(CXX) /c /nologo /TP /Fo$@ $(CONSOLE_CXXFLAGS) .\console.cpp

View File

@@ -226,7 +226,7 @@ $(OBJS) :
### Targets: ###
all : .SYMBOLIC $(OBJS)\console.exe data
all : .SYMBOLIC $(OBJS)\console.exe
clean : .SYMBOLIC
-if exist $(OBJS)\*.obj del $(OBJS)\*.obj
@@ -248,10 +248,6 @@ $(OBJS)\console.exe : $(CONSOLE_OBJECTS)
@for %i in () do @%append $(OBJS)\console.lbc option stack=%i
wlink @$(OBJS)\console.lbc
data : .SYMBOLIC
if not exist $(OBJS) mkdir $(OBJS)
for %f in (testdata.fc) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
$(OBJS)\console_console.obj : .AUTODEPEND .\console.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(CONSOLE_CXXFLAGS) $<

View File

@@ -1,6 +0,0 @@
# this is the test data file for wxFileConfig tests
value1=one
# a comment here
value2=two
value\ with\ spaces\ inside\ it=nothing special
path=$PATH