From 89e60357485b3da6e7ed7995fbcf8722d3df7ef4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 17 Mar 2000 23:02:38 +0000 Subject: [PATCH] more tests: OS/user info functions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6813 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/console/console.cpp | 43 ++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/samples/console/console.cpp b/samples/console/console.cpp index 7f639229de..b922cec0ae 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -45,7 +45,8 @@ //#define TEST_LOG //#define TEST_LONGLONG //#define TEST_MIME -#define TEST_SOCKETS +#define TEST_INFO_FUNCTIONS +//#define TEST_SOCKETS //#define TEST_STRINGS //#define TEST_THREADS //#define TEST_TIMER @@ -456,6 +457,41 @@ static void TestMimeEnum() #endif // TEST_MIME +// ---------------------------------------------------------------------------- +// misc information functions +// ---------------------------------------------------------------------------- + +#ifdef TEST_INFO_FUNCTIONS + +#include + +static void TestOsInfo() +{ + puts("*** Testing OS info functions ***\n"); + + int major, minor; + wxGetOsVersion(&major, &minor); + printf("Running under: %s, version %d.%d\n", + wxGetOsDescription().c_str(), major, minor); + + printf("%d free bytes of memory left.\n", wxGetFreeMemory()); + + printf("Host name is %s (%s).\n", + wxGetHostName().c_str(), wxGetFullHostName().c_str()); +} + +static void TestUserInfo() +{ + puts("*** Testing user info functions ***\n"); + + printf("User id is:\t%s\n", wxGetUserId().c_str()); + printf("User name is:\t%s\n", wxGetUserName().c_str()); + printf("Home dir is:\t%s\n", wxGetHomeDir().c_str()); + printf("Email address:\t%s\n", wxGetEmailAddress().c_str()); +} + +#endif // TEST_INFO_FUNCTIONS + // ---------------------------------------------------------------------------- // long long // ---------------------------------------------------------------------------- @@ -2622,6 +2658,11 @@ int main(int argc, char **argv) TestMimeEnum(); #endif // TEST_MIME +#ifdef TEST_INFO_FUNCTIONS + TestOsInfo(); + TestUserInfo(); +#endif // TEST_INFO_FUNCTIONS + #ifdef TEST_SOCKETS if ( 1 ) TestSocketServer();