From: Francesco Montorsi Date: Wed, 2 Jun 2010 14:51:45 +0000 (+0000) Subject: remove wxFileConfig tests: FileConfigTestCase already tests features tested by consol... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a05e050bd4209ed08afb73ea34a5f5adab25be87 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 --- diff --git a/samples/console/Makefile.in b/samples/console/Makefile.in index 5cfee52699..e0c6aa1903 100644 --- a/samples/console/Makefile.in +++ b/samples/console/Makefile.in @@ -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 diff --git a/samples/console/console.bkl b/samples/console/console.bkl index d027940754..27bb85e9a4 100644 --- a/samples/console/console.bkl +++ b/samples/console/console.bkl @@ -10,8 +10,4 @@ base - - testdata.fc - - diff --git a/samples/console/console.cpp b/samples/console/console.cpp index 29bdee5627..85ea17dc28 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -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 diff --git a/samples/console/makefile.bcc b/samples/console/makefile.bcc index 10762ff683..584fa09c05 100644 --- a/samples/console/makefile.bcc +++ b/samples/console/makefile.bcc @@ -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 diff --git a/samples/console/makefile.gcc b/samples/console/makefile.gcc index 8ef0868dcf..c7555c2e76 100644 --- a/samples/console/makefile.gcc +++ b/samples/console/makefile.gcc @@ -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) diff --git a/samples/console/makefile.vc b/samples/console/makefile.vc index b614610f1e..b63659d166 100644 --- a/samples/console/makefile.vc +++ b/samples/console/makefile.vc @@ -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 diff --git a/samples/console/makefile.wat b/samples/console/makefile.wat index 6906d0c5e8..10640b73b0 100644 --- a/samples/console/makefile.wat +++ b/samples/console/makefile.wat @@ -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) $< diff --git a/samples/console/testdata.fc b/samples/console/testdata.fc deleted file mode 100644 index fd8d907f79..0000000000 --- a/samples/console/testdata.fc +++ /dev/null @@ -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