Print more detailled output from the timer tests. Don't print home

2005-03-20  Tor Lillqvist  <tml@novell.com>

	* 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.
This commit is contained in:
Tor Lillqvist 2005-03-20 10:43:38 +00:00 committed by Tor Lillqvist
parent 6b55164587
commit 20378332ae
6 changed files with 55 additions and 9 deletions

View File

@ -1,3 +1,13 @@
2005-03-20 Tor Lillqvist <tml@novell.com>
* 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 <hans@breuer.org>
* glib/makefile.msc.in : handle galiasdef.c (although completely

View File

@ -1,3 +1,13 @@
2005-03-20 Tor Lillqvist <tml@novell.com>
* 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 <hans@breuer.org>
* glib/makefile.msc.in : handle galiasdef.c (although completely

View File

@ -1,3 +1,13 @@
2005-03-20 Tor Lillqvist <tml@novell.com>
* 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 <hans@breuer.org>
* glib/makefile.msc.in : handle galiasdef.c (although completely

View File

@ -1,3 +1,13 @@
2005-03-20 Tor Lillqvist <tml@novell.com>
* 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 <hans@breuer.org>
* glib/makefile.msc.in : handle galiasdef.c (although completely

View File

@ -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);

View File

@ -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");