X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/10d878a9ea0b6bf66c469afe265735721c81a1f7..0f11c2334567bd440bb2676f43d3376badc921f2:/samples/console/console.cpp diff --git a/samples/console/console.cpp b/samples/console/console.cpp index 73c652357b..945201f3b1 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -25,6 +25,8 @@ #include "wx/file.h" #include "wx/app.h" #include "wx/log.h" +#include "wx/apptrait.h" +#include "wx/platinfo.h" // without this pragma, the stupid compiler precompiles #defines below so that // changing them doesn't "take place" later! @@ -86,7 +88,7 @@ #define TEST_WCHAR #define TEST_ZIP #else // #if TEST_ALL - #define TEST_MODULE + #define TEST_INFO_FUNCTIONS #endif // some tests are interactive, define this to run them @@ -1464,6 +1466,7 @@ wxTestModuleB::wxTestModuleB() #include "wx/utils.h" +#if TEST_INTERACTIVE static void TestDiskInfo() { wxPuts(_T("*** Testing wxGetDiskSpace() ***")); @@ -1492,6 +1495,7 @@ static void TestDiskInfo() } } } +#endif // TEST_INTERACTIVE static void TestOsInfo() { @@ -1510,6 +1514,23 @@ static void TestOsInfo() wxPuts(wxEmptyString); } +static void TestPlatformInfo() +{ + wxPuts(_T("*** Testing wxPlatformInfo functions ***\n")); + + // get this platform + wxPlatformInfo plat; + + wxPrintf(_T("Operating system family name is: %s\n"), plat.GetOperatingSystemFamilyName().c_str()); + wxPrintf(_T("Operating system name is: %s\n"), plat.GetOperatingSystemIdName().c_str()); + wxPrintf(_T("Port ID name is: %s\n"), plat.GetPortIdName().c_str()); + wxPrintf(_T("Port ID short name is: %s\n"), plat.GetPortIdShortName().c_str()); + wxPrintf(_T("Architecture is: %s\n"), plat.GetArchName().c_str()); + wxPrintf(_T("Endianness is: %s\n"), plat.GetEndiannessName().c_str()); + + wxPuts(wxEmptyString); +} + static void TestUserInfo() { wxPuts(_T("*** Testing user info functions ***\n")); @@ -4332,13 +4353,12 @@ int main(int argc, char **argv) #endif // TEST_MIME #ifdef TEST_INFO_FUNCTIONS - #if TEST_ALL - TestOsInfo(); - TestUserInfo(); + TestOsInfo(); + TestPlatformInfo(); + TestUserInfo(); - #if TEST_INTERACTIVE - TestDiskInfo(); - #endif + #if TEST_INTERACTIVE + TestDiskInfo(); #endif #endif // TEST_INFO_FUNCTIONS