// what to test (in alphabetic order)?
-//#define TEST_ARRAYS
-//#define TEST_CHARSET
-//#define TEST_CMDLINE
-//#define TEST_DATETIME
-//#define TEST_DIR
-//#define TEST_DLLLOADER
-//#define TEST_ENVIRON
-//#define TEST_EXECUTE
-//#define TEST_FILE
-//#define TEST_FILECONF
-//#define TEST_FILENAME
-//#define TEST_FTP
-//#define TEST_HASH
-//#define TEST_INFO_FUNCTIONS
-//#define TEST_LIST
-//#define TEST_LOCALE
-//#define TEST_LOG
-//#define TEST_LONGLONG
-//#define TEST_MIME
-//#define TEST_PATHLIST
-//#define TEST_REGCONF
-//#define TEST_REGISTRY
+#define TEST_ARRAYS
+#define TEST_CHARSET
+#define TEST_CMDLINE
+#define TEST_DATETIME
+#define TEST_DIR
+#define TEST_DLLLOADER
+#define TEST_ENVIRON
+#define TEST_EXECUTE
+#define TEST_FILE
+#define TEST_FILECONF
+#define TEST_FILENAME
+#define TEST_FTP
+#define TEST_HASH
+#define TEST_INFO_FUNCTIONS
+#define TEST_LIST
+#define TEST_LOCALE
+#define TEST_LOG
+#define TEST_LONGLONG
+#define TEST_MIME
+#define TEST_PATHLIST
+#define TEST_REGCONF
+#define TEST_REGISTRY
#define TEST_SNGLINST
-//#define TEST_SOCKETS
-//#define TEST_STREAMS
-//#define TEST_STRINGS
-//#define TEST_THREADS
-//#define TEST_TIMER
+#define TEST_SOCKETS
+#define TEST_STREAMS
+#define TEST_STRINGS
+#define TEST_THREADS
+#define TEST_TIMER
//#define TEST_VCARD -- don't enable this (VZ)
-//#define TEST_WCHAR
-//#define TEST_ZIP
-//#define TEST_ZLIB
+#define TEST_WCHAR
+#define TEST_ZIP
+#define TEST_ZLIB
#ifdef TEST_SNGLINST
#include <wx/snglinst.h>
printf("There are %u files under '%s'\n", n, TESTDIR);
if ( n > 1 )
{
- printf("First one is '%s'\n", files[0u]);
- printf(" last one is '%s'\n", files[n - 1]);
+ printf("First one is '%s'\n", files[0u].c_str());
+ printf(" last one is '%s'\n", files[n - 1].c_str());
}
// enum again with custom traverser
printf("After 2nd wxSetEnv: getenv(%s) = %s\n", var, MyGetEnv(var).c_str());
wxUnsetEnv(var);
printf("After wxUnsetEnv: getenv(%s) = %s\n", var, MyGetEnv(var).c_str());
- printf("PATH = %s\n", MyGetEnv(_T("PATH")));
+ printf("PATH = %s\n", MyGetEnv(_T("PATH")).c_str());
}
#endif // TEST_ENVIRON
static void TestLongLongComparison()
{
+#if wxUSE_LONGLONG_WX
puts("*** Testing wxLongLong comparison ***\n");
static const long testLongs[] =
res == (ls[m] == testLongs[n]) ? "ok" : "ERROR");
}
}
+#endif // wxUSE_LONGLONG_WX
}
#undef MAKE_LL
}
#ifdef TEST_SNGLINST
- wxSingleInstanceChecker checker(_T(".wxconsole.lock"));
- if ( checker.IsAnotherRunning() )
+ wxSingleInstanceChecker checker;
+ if ( checker.Create(_T(".wxconsole.lock")) )
{
- wxPrintf(_T("Another instance of the program is running, exiting.\n"));
+ if ( checker.IsAnotherRunning() )
+ {
+ wxPrintf(_T("Another instance of the program is running, exiting.\n"));
- return 1;
- }
+ return 1;
+ }
- // wait some time to give time to launch another instance
- wxPrintf(_T("Press \"Enter\" to continue..."));
- wxFgetc(stdin);
+ // wait some time to give time to launch another instance
+ wxPrintf(_T("Press \"Enter\" to continue..."));
+ wxFgetc(stdin);
+ }
+ else // failed to create
+ {
+ wxPrintf(_T("Failed to init wxSingleInstanceChecker.\n"));
+ }
#endif // TEST_SNGLINST
#ifdef TEST_CHARSET