summaryrefslogtreecommitdiff
path: root/tests/testtreemodel.c
diff options
context:
space:
mode:
authorMorten Welinder <terra@gnome.org>2004-08-16 19:05:58 +0000
committerMorten Welinder <mortenw@src.gnome.org>2004-08-16 19:05:58 +0000
commit36dfdad411fa8bbb8d13670210a3d247b185ae52 (patch)
tree7f221e2e5a848616a57a0a9a14807239f6eccf12 /tests/testtreemodel.c
parent517c3c9db2ce5d9dbf41cca97c48a33543242431 (diff)
downloadgdk-pixbuf-36dfdad411fa8bbb8d13670210a3d247b185ae52.tar.gz
Comment out mallinfo stuff. Fix g_print %-strings.
2004-08-16 Morten Welinder <terra@gnome.org> * tests/testtreemodel.c (test_run): Comment out mallinfo stuff. Fix g_print %-strings.
Diffstat (limited to 'tests/testtreemodel.c')
-rw-r--r--tests/testtreemodel.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/testtreemodel.c b/tests/testtreemodel.c
index 85e04a17b..0ef4617d3 100644
--- a/tests/testtreemodel.c
+++ b/tests/testtreemodel.c
@@ -191,7 +191,7 @@ test_run (gchar *title,
gchar *text;
GTimer *timer;
gdouble elapsed;
- int uordblks_before;
+ int uordblks_before, memused;
g_print ("%s (average over %d runs, time in milliseconds)\n"
"items \ttime \ttime/item \tused memory\n", title, repeats);
@@ -205,7 +205,10 @@ test_run (gchar *title,
for (d = 0; d < repeats; d++)
{
(*clear)(store);
+#ifdef HAVE_MALLINFO
+ /* Peculiar location of this, btw. -- MW. */
uordblks_before = mallinfo().uordblks;
+#endif
g_timer_reset (timer);
g_timer_start (timer);
for (i = 0; i < items; i++)
@@ -215,8 +218,13 @@ test_run (gchar *title,
}
elapsed = elapsed * 1000 / repeats;
- g_print ("%d \t%lf \t%lf \t%ldk\n",
- items, elapsed, elapsed/items, (mallinfo().uordblks - uordblks_before) / 1024);
+#ifdef HAVE_MALLINFO
+ memused = (mallinfo().uordblks - uordblks_before) / 1024;
+#else
+ memused = 0;
+#endif
+ g_print ("%d \t%f \t%f \t%dk\n",
+ items, elapsed, elapsed/items, memused);
}
}