From e6fc0b7b23620cd04801667b1921384f56a42fdb Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 17 Apr 2008 14:04:05 +0200 Subject: [PATCH] Added loop for record conversion to test performance. --- test/tst_record_conv.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/tst_record_conv.c b/test/tst_record_conv.c index ac81620..42518b7 100644 --- a/test/tst_record_conv.c +++ b/test/tst_record_conv.c @@ -197,6 +197,22 @@ static int conv_convert_test(yaz_record_conv_t p, return ret; } +static int conv_convert_test_iter(yaz_record_conv_t p, + const char *input_record, + const char *output_expect_record, + int num_iter) +{ + int i; + int ret; + for (i = 0; i < num_iter; i++) + { + ret = conv_convert_test(p, input_record, output_expect_record); + if (!ret) + break; + } + return ret; +} + static void tst_convert1(void) { yaz_record_conv_t p = 0; @@ -307,7 +323,7 @@ static void tst_convert2(void) "/>" "", 0, &p)); - YAZ_CHECK(conv_convert_test(p, marcxml_rec, iso2709_rec)); + YAZ_CHECK(conv_convert_test_iter(p, marcxml_rec, iso2709_rec, 100)); yaz_record_conv_destroy(p); } -- 1.7.10.4