more tests: OS/user info functions

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6813 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2000-03-17 23:02:38 +00:00
parent 2e8a1588f8
commit 89e6035748

View File

@ -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 <wx/utils.h>
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();