From 5be54230af43941b98ef2c367c4414c02faf0b83 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 31 Mar 2009 03:26:51 +0200 Subject: [PATCH] Add performance test for magic uri --- tests/magic-uri.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/magic-uri.c b/tests/magic-uri.c index 1a67dce7..f03a0a8c 100644 --- a/tests/magic-uri.c +++ b/tests/magic-uri.c @@ -139,6 +139,24 @@ magic_uri_pseudo (void) test_input ("mailto:christian@twotoasts.de", "mailto:christian@twotoasts.de"); } +static void +magic_uri_performance (void) +{ + gsize i; + + g_test_timer_start (); + + for (i = 0; i < 1000; i++) + { + magic_uri_uri (); + magic_uri_idn (); + magic_uri_search (); + magic_uri_pseudo (); + } + + g_print ("\nTime needed for URI tests: %f ", g_test_timer_elapsed ()); +} + int main (int argc, char** argv) @@ -150,6 +168,7 @@ main (int argc, g_test_add_func ("/magic-uri/idn", magic_uri_idn); g_test_add_func ("/magic-uri/search", magic_uri_search); g_test_add_func ("/magic-uri/pseudo", magic_uri_pseudo); + g_test_add_func ("/magic-uri/performance", magic_uri_performance); return g_test_run (); } -- 2.39.5