diff tests.c @ 781:4cc514343376

Rename th_cfg_find() to th_cfg_item_find().
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 04 Jul 2023 01:24:38 +0300
parents 484853471eaf
children 1db55c733f7d
line wrap: on
line diff
--- a/tests.c	Tue Jul 04 01:22:50 2023 +0300
+++ b/tests.c	Tue Jul 04 01:24:38 2023 +0300
@@ -377,22 +377,22 @@
     test_ctx ctx;
 
     test_start(&ctx, "Test configuration value search #%d", ++nsubtest);
-    test_result(&ctx, (item = th_cfg_find(cfg, "inside_sect", "intval", -1)) != NULL && *item->v.val_int == 112);
+    test_result(&ctx, (item = th_cfg_item_find(cfg, "inside_sect", "intval", -1)) != NULL && *item->v.val_int == 112);
     test_end(&ctx);
     test_start(&ctx, "Test configuration value search #%d", ++nsubtest);
-    test_result(&ctx, (item = th_cfg_find(cfg, "another_sect", "boolval", -1)) != NULL && *item->v.val_bool);
+    test_result(&ctx, (item = th_cfg_item_find(cfg, "another_sect", "boolval", -1)) != NULL && *item->v.val_bool);
     test_end(&ctx);
     test_start(&ctx, "Test configuration value search #%d", ++nsubtest);
-    test_result(&ctx, th_cfg_find(cfg, "no_match", NULL, -1) == NULL);
+    test_result(&ctx, th_cfg_item_find(cfg, "no_match", NULL, -1) == NULL);
     test_end(&ctx);
     test_start(&ctx, "Test configuration value search #%d", ++nsubtest);
-    test_result(&ctx, th_cfg_find(cfg, NULL, "no_match", -1) == NULL);
+    test_result(&ctx, th_cfg_item_find(cfg, NULL, "no_match", -1) == NULL);
     test_end(&ctx);
     test_start(&ctx, "Test configuration value search #%d", ++nsubtest);
-    test_result(&ctx, (item = th_cfg_find(cfg, NULL, "hexval", -1)) != NULL && *item->v.val_uint == 0x11223344);
+    test_result(&ctx, (item = th_cfg_item_find(cfg, NULL, "hexval", -1)) != NULL && *item->v.val_uint == 0x11223344);
     test_end(&ctx);
     test_start(&ctx, "Test configuration value search #%d", ++nsubtest);
-    test_result(&ctx, (item = th_cfg_find(cfg, NULL, "a_string_setting", -1)) != NULL && strcmp(*item->v.val_str, "v_str1") == 0);
+    test_result(&ctx, (item = th_cfg_item_find(cfg, NULL, "a_string_setting", -1)) != NULL && strcmp(*item->v.val_str, "v_str1") == 0);
     test_end(&ctx);
 }
 
@@ -465,7 +465,7 @@
     test_config_values(cfg);
 
     // Additional tests
-    item = th_cfg_find(cfg, NULL, "string_list", -1);
+    item = th_cfg_item_find(cfg, NULL, "string_list", -1);
     test_result(&ctx, item != NULL);
     if (item != NULL)
     {
@@ -544,7 +544,7 @@
     // Test ptr
     test_start(&ctx, "Test configuration string list ptr");
     test_result(&ctx,
-        (item = th_cfg_find(cfg, NULL, "string_list", -1)) != NULL &&
+        (item = th_cfg_item_find(cfg, NULL, "string_list", -1)) != NULL &&
         item->v.list == &v_str_list);
     test_end(&ctx);