From 20378332aea3a273a27bd0d40451811b21a7a1f6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 20 Mar 2005 10:43:38 +0000 Subject: [PATCH 1/1] Print more detailled output from the timer tests. Don't print home 2005-03-20 Tor Lillqvist * tests/testglib.c (main): Print more detailled output from the timer tests. Don't print home directory twice. Test g_win32_error_message(). * tests/spawn-test.c (run_tests): On Win32, run netstat instead of ipconfig. On Windows XP collecting output from ipconfig doesn't seem to work for some reason. --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-12 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ tests/spawn-test.c | 8 ++++---- tests/testglib.c | 16 +++++++++++----- 6 files changed, 55 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index de99651..1b2bb12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-03-20 Tor Lillqvist + + * tests/testglib.c (main): Print more detailled output from the + timer tests. Don't print home directory twice. Test + g_win32_error_message(). + + * tests/spawn-test.c (run_tests): On Win32, run netstat instead of + ipconfig. On Windows XP collecting output from ipconfig doesn't + seem to work for some reason. + 2005-03-18 Hans Breuer * glib/makefile.msc.in : handle galiasdef.c (although completely diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index de99651..1b2bb12 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2005-03-20 Tor Lillqvist + + * tests/testglib.c (main): Print more detailled output from the + timer tests. Don't print home directory twice. Test + g_win32_error_message(). + + * tests/spawn-test.c (run_tests): On Win32, run netstat instead of + ipconfig. On Windows XP collecting output from ipconfig doesn't + seem to work for some reason. + 2005-03-18 Hans Breuer * glib/makefile.msc.in : handle galiasdef.c (although completely diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index de99651..1b2bb12 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,13 @@ +2005-03-20 Tor Lillqvist + + * tests/testglib.c (main): Print more detailled output from the + timer tests. Don't print home directory twice. Test + g_win32_error_message(). + + * tests/spawn-test.c (run_tests): On Win32, run netstat instead of + ipconfig. On Windows XP collecting output from ipconfig doesn't + seem to work for some reason. + 2005-03-18 Hans Breuer * glib/makefile.msc.in : handle galiasdef.c (although completely diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index de99651..1b2bb12 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2005-03-20 Tor Lillqvist + + * tests/testglib.c (main): Print more detailled output from the + timer tests. Don't print home directory twice. Test + g_win32_error_message(). + + * tests/spawn-test.c (run_tests): On Win32, run netstat instead of + ipconfig. On Windows XP collecting output from ipconfig doesn't + seem to work for some reason. + 2005-03-18 Hans Breuer * glib/makefile.msc.in : handle galiasdef.c (although completely diff --git a/tests/spawn-test.c b/tests/spawn-test.c index efe9afe..f4a7eed 100644 --- a/tests/spawn-test.c +++ b/tests/spawn-test.c @@ -96,9 +96,9 @@ run_tests (void) } #else #ifdef G_OS_WIN32 - printf ("Running ipconfig synchronously, collecting its output\n"); + printf ("Running netstat synchronously, collecting its output\n"); - if (!g_spawn_command_line_sync ("ipconfig /all", + if (!g_spawn_command_line_sync ("netstat -n", &output, &erroutput, NULL, &err)) { @@ -111,9 +111,9 @@ run_tests (void) g_assert (output != NULL); g_assert (erroutput != NULL); - if (strstr (output, "IP Configuration") == 0) + if (strstr (output, "Active Connections") == 0) { - printf ("output was '%s', should have contained 'IP Configuration'\n", + printf ("output was '%s', should have contained 'Active Connections'\n", output); exit (1); diff --git a/tests/testglib.c b/tests/testglib.c index e8f9f8a..8867f56 100644 --- a/tests/testglib.c +++ b/tests/testglib.c @@ -330,6 +330,8 @@ main (int argc, GMemChunk *mem_chunk; GStringChunk *string_chunk; GTimer *timer, *timer2; + gdouble elapsed; + gulong elapsed_usecs; gint nums[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; gint morenums[10] = { 8, 9, 7, 0, 3, 2, 5, 1, 4, 6}; gchar *string; @@ -438,8 +440,6 @@ main (int argc, g_print ("real: %s\n", g_get_real_name ()); s = g_get_home_dir (); g_print ("home: %s\n", s ? s : "NULL!"); - s = g_get_home_dir (); - g_print ("home: %s\n", s ? s : "NULL!"); s = g_get_user_data_dir (); g_print ("user_data: %s\n", s ? s : "NULL!"); s = g_get_user_config_dir (); @@ -1013,16 +1013,20 @@ main (int argc, g_usleep((29*G_USEC_PER_SEC)/5); /* run timer for 5.8 seconds */ g_timer_stop(timer); - g_print ("\t=> total elapsed = %.2f seconds (should be: 9.00 seconds)\n\n", g_timer_elapsed(timer, NULL)); + elapsed = g_timer_elapsed (timer, &elapsed_usecs); + g_print ("\t=> total = %.6f = %d.%06ld (should be: 9.000000) (%.6f off)\n", elapsed, (int) elapsed, elapsed_usecs, ABS (elapsed - 9.)); - if (g_timer_elapsed(timer, NULL) > 8.8 && g_timer_elapsed(timer, NULL) < 9.2) + if (elapsed > 8.8 && elapsed < 9.2) g_print ("g_timer_continue ... ok\n\n"); else g_print ("g_timer_continue ... ***** FAILED *****\n\n"); g_timer_stop(timer2); - if (g_timer_elapsed(timer2, NULL) > (8.8+6.5) && g_timer_elapsed(timer2, NULL) < (9.2+6.5)) + elapsed = g_timer_elapsed(timer2, &elapsed_usecs); + g_print ("\t=> total elapsed = %.6f = %d.%06ld (should be: %.6f) (%.6f off)\n\n", elapsed, (int) elapsed, elapsed_usecs, 9.+6.5, ABS (elapsed - (9.+6.5))); + + if (elapsed > (8.8+6.5) && elapsed < (9.2+6.5)) g_print ("timer2 ... ok\n\n"); else g_print ("timer2 ... ***** FAILED *****\n\n"); @@ -1286,6 +1290,8 @@ main (int argc, g_print ("found more.com as %s\n", g_find_program_in_path ("more.com")); g_print ("found regedit as %s\n", g_find_program_in_path ("regedit")); + g_print ("a Win32 error message: %s\n", g_win32_error_message (2)); + #endif g_print ("checking file functions...\n"); -- 2.7.4