added wxSingleInstanceChecker test
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,13 +50,14 @@
|
|||||||
//#define TEST_HASH
|
//#define TEST_HASH
|
||||||
//#define TEST_INFO_FUNCTIONS
|
//#define TEST_INFO_FUNCTIONS
|
||||||
//#define TEST_LIST
|
//#define TEST_LIST
|
||||||
#define TEST_LOCALE
|
//#define TEST_LOCALE
|
||||||
//#define TEST_LOG
|
//#define TEST_LOG
|
||||||
//#define TEST_LONGLONG
|
//#define TEST_LONGLONG
|
||||||
//#define TEST_MIME
|
//#define TEST_MIME
|
||||||
//#define TEST_PATHLIST
|
//#define TEST_PATHLIST
|
||||||
//#define TEST_REGCONF
|
//#define TEST_REGCONF
|
||||||
//#define TEST_REGISTRY
|
//#define TEST_REGISTRY
|
||||||
|
#define TEST_SNGLINST
|
||||||
//#define TEST_SOCKETS
|
//#define TEST_SOCKETS
|
||||||
//#define TEST_STREAMS
|
//#define TEST_STREAMS
|
||||||
//#define TEST_STRINGS
|
//#define TEST_STRINGS
|
||||||
@@ -67,6 +68,10 @@
|
|||||||
//#define TEST_ZIP
|
//#define TEST_ZIP
|
||||||
//#define TEST_ZLIB
|
//#define TEST_ZLIB
|
||||||
|
|
||||||
|
#ifdef TEST_SNGLINST
|
||||||
|
#include <wx/snglinst.h>
|
||||||
|
#endif // TEST_SNGLINST
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// test class for container objects
|
// test class for container objects
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -4548,11 +4553,28 @@ static void TestStringReplace()
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
if ( !wxInitialize() )
|
wxInitializer initializer;
|
||||||
|
if ( !initializer )
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize the wxWindows library, aborting.");
|
fprintf(stderr, "Failed to initialize the wxWindows library, aborting.");
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TEST_SNGLINST
|
||||||
|
wxSingleInstanceChecker checker(_T("wxConsoleSample"));
|
||||||
|
if ( checker.IsAnotherRunning() )
|
||||||
|
{
|
||||||
|
wxPrintf(_T("Another instance of the program is running, exiting.\n"));
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// wait some time to give time to launch another instance
|
||||||
|
wxPrintf(_T("Press \"Enter\" to continue..."));
|
||||||
|
wxFgetc(stdin);
|
||||||
|
#endif // TEST_SNGLINST
|
||||||
|
|
||||||
#ifdef TEST_CHARSET
|
#ifdef TEST_CHARSET
|
||||||
TestCharset();
|
TestCharset();
|
||||||
#endif // TEST_CHARSET
|
#endif // TEST_CHARSET
|
||||||
@@ -4897,8 +4919,6 @@ int main(int argc, char **argv)
|
|||||||
TestZlibStreamRead();
|
TestZlibStreamRead();
|
||||||
#endif // TEST_ZLIB
|
#endif // TEST_ZLIB
|
||||||
|
|
||||||
wxUninitialize();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user