ENH: set expected failure for tests
[cmake.git] / Tests / UseWX / WX.cxx
blobd4631274ca900abb9d013603252bdbb2e9fd0dfd
1 //For wx
2 #include <wx/app.h>
3 #include <wx/dir.h>
5 static void TestDirEnumHelper(wxDir& dir,
6 int flags = wxDIR_DEFAULT,
7 const wxString& filespec = wxEmptyString)
9 wxString filename;
11 if ( !dir.IsOpened() )
12 return;
14 bool cont = dir.GetFirst(&filename, filespec, flags);
15 while ( cont )
17 wxPrintf(_T("\t%s\n"), filename.c_str());
19 cont = dir.GetNext(&filename);
22 wxPuts(_T(""));
26 //----------------------------------------------------------------------------
27 // MyApp
28 //----------------------------------------------------------------------------
30 class MyApp: public wxApp
32 public:
33 MyApp();
35 bool OnInit();
36 int MainLoop();
40 IMPLEMENT_APP(MyApp)
42 MyApp::MyApp()
46 bool MyApp::OnInit()
48 //test a directory that exist:
49 wxDir dir(wxT(".")); //wxDir dir("/tmp");
50 TestDirEnumHelper(dir, wxDIR_DEFAULT | wxDIR_DOTDOT);
52 //Testing if link to wx debug library
53 #ifdef __WXDEBUG__
54 printf("If you read this you're in __WXDEBUG__ debug mode.\n");
55 #endif //__WXDEBUG__
57 #ifdef _DEBUG
58 printf("If you read this then _DEBUG is defined.\n");
59 #endif //_DEBUG
61 wxChar ch = wxT('*');
62 wxString s = wxT("Hello, world!");
63 int len = s.Len();
64 printf("Length of string is: %d\n", len);
66 //Force testing of Unicode mode
67 #ifdef __UNICODE__
68 wprintf(L"Unicode: %s \n", s.c_str());
69 wprintf(:"Char: %c\n", ch);
70 #else
71 printf("ANSI: %s \n", s.c_str());
72 printf("Char: %c\n", ch);
73 #endif //__UNICODE__
75 //return immediately
76 return TRUE;
79 int MyApp::MainLoop()
81 return 0;