LCOV - code coverage report
Current view: top level - tests/abi - testabi_rel.c (source / functions) Hit Total Coverage
Test: coverage-filtered.info Lines: 271 271 100.0 %
Date: 2022-05-21 16:19:22 Functions: 7 7 100.0 %

          Line data    Source code
       1             : /**
       2             :  * @file
       3             :  *
       4             :  * @brief Relation between keys.
       5             :  *
       6             :  * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
       7             :  */
       8             : 
       9             : #include <tests.h>
      10             : 
      11             : 
      12           3 : static void test_keyCmp (void)
      13             : {
      14           3 :         printf ("check keyCmp\n");
      15             : 
      16           3 :         Key * k1 = keyNew ("user:/valid", KEY_END);
      17           3 :         Key * k2 = keyNew ("user:/valid", KEY_END);
      18             : 
      19           3 :         succeed_if (keyCmp (0, 0) == 0, "all null pointers are same");
      20             : 
      21             :         //! [cmp null]
      22           3 :         succeed_if (keyCmp (0, 0) == 0, "all null pointers same");
      23           3 :         succeed_if (keyCmp (k1, 0) == 1, "null pointer is smaller");
      24           3 :         succeed_if (keyCmp (0, k2) == -1, "null pointer is smaller");
      25             :         //! [cmp null]
      26             : 
      27           3 :         succeed_if (keyCmp (k1, k2) == 0, "should be same");
      28             : 
      29           3 :         keySetName (k1, "");
      30           3 :         keySetName (k2, "");
      31           3 :         succeed_if (keyCmp (k1, k2) == 0, "should be same");
      32             : 
      33           3 :         succeed_if (keySetName (k1, "user:/") == 7, "should be a valid name");
      34           3 :         succeed_if (keySetName (k2, "user:/") == 7, "should be a valid name");
      35           3 :         succeed_if (keyCmp (k1, k2) == 0, "should be same");
      36             : 
      37           3 :         succeed_if (keySetName (k1, "system:/") == 9, "should be a valid name");
      38           3 :         succeed_if (keySetName (k2, "system:/") == 9, "should be a valid name");
      39           3 :         succeed_if (keyCmp (k1, k2) == 0, "should be same");
      40             : 
      41           3 :         succeed_if (keySetName (k1, "user:/") == 7, "should be a valid name");
      42           3 :         succeed_if (keySetName (k2, "system:/") == 9, "should be a valid name");
      43           3 :         succeed_if (keyCmp (k1, k2) < 0, "system is smaller");
      44           3 :         succeed_if (keyCmp (k2, k1) > 0, "system is smaller");
      45             : 
      46           3 :         succeed_if (keySetName (k1, "user:/a") == 8, "should be a valid name");
      47           3 :         succeed_if (keySetName (k2, "user:/a") == 8, "should be a valid name");
      48           3 :         succeed_if (keyCmp (k1, k2) == 0, "should be same");
      49           3 :         succeed_if (keyCmp (k2, k1) == 0, "should be same");
      50             : 
      51           3 :         succeed_if (keySetName (k1, "user:/a") == 8, "should be a valid name");
      52           3 :         succeed_if (keySetName (k2, "user:/b") == 8, "should be a valid name");
      53           3 :         succeed_if (keyCmp (k1, k2) < 0, "a is smaller");
      54           3 :         succeed_if (keyCmp (k2, k1) > 0, "a is smaller");
      55             : 
      56           3 :         succeed_if (keySetName (k1, "user:/a/a") == 10, "should be a valid name");
      57           3 :         succeed_if (keySetName (k2, "user:/a-a") == 10, "should be a valid name");
      58           3 :         succeed_if (keyCmp (k1, k2) < 0, "/ is smaller");
      59           3 :         succeed_if (keyCmp (k2, k1) > 0, "/ is smaller");
      60             : 
      61           3 :         char cmp[] = "user:/a-a";
      62         768 :         for (int i = 1; i < 256; ++i)
      63             :         {
      64         765 :                 if (i == '/') continue;
      65         762 :                 cmp[7] = i;
      66             :                 // printf ("%i %s\n", i, cmp);
      67         762 :                 succeed_if (keySetName (k1, "user:/a/a") == 10, "should be a valid name");
      68         762 :                 keySetName (k2, cmp);
      69         762 :                 succeed_if (keyCmp (k1, k2) < 0, "/ is smaller");
      70         765 :                 succeed_if (keyCmp (k2, k1) > 0, "/ is smaller");
      71             :         }
      72             : 
      73           3 :         succeed_if (keySetName (k1, "user:/a") == 8, "should be a valid name");
      74           3 :         succeed_if (keySetName (k2, "user:/a/a") == 10, "should be a valid name");
      75           3 :         succeed_if (keyCmp (k1, k2) < 0, "/ is smaller");
      76           3 :         succeed_if (keyCmp (k2, k1) > 0, "/ is smaller");
      77             : 
      78           3 :         succeed_if (keySetName (k1, "user:/a") == 8, "should be a valid name");
      79           3 :         succeed_if (keySetName (k2, "user:/a-a") == 10, "should be a valid name");
      80           3 :         succeed_if (keyCmp (k1, k2) < 0, "/ is smaller");
      81           3 :         succeed_if (keyCmp (k2, k1) > 0, "/ is smaller");
      82             : 
      83           3 :         succeed_if (keySetName (k1, "user:/a") == 8, "should be a valid name");
      84           3 :         succeed_if (keySetName (k2, "user:/aa") == 9, "should be a valid name");
      85           3 :         succeed_if (keyCmp (k1, k2) < 0, "/ is smaller");
      86           3 :         succeed_if (keyCmp (k2, k1) > 0, "/ is smaller");
      87             : 
      88           3 :         succeed_if (keySetName (k1, "user:/a") == 8, "should be a valid name");
      89           3 :         succeed_if (keySetName (k2, "user:/a-") == 9, "should be a valid name");
      90           3 :         succeed_if (keyCmp (k1, k2) < 0, "/ is smaller");
      91           3 :         succeed_if (keyCmp (k2, k1) > 0, "/ is smaller");
      92             : 
      93           3 :         succeed_if (keySetName (k1, "user:/find_me") == 14, "should be a valid name");
      94           3 :         succeed_if (keySetName (k2, "user:/find_me/a") == 16, "should be a valid name");
      95           3 :         succeed_if (keyCmp (k1, k2) < 0, "find_me is smaller");
      96           3 :         succeed_if (keyCmp (k2, k1) > 0, "find_me is smaller");
      97             : 
      98           3 :         keyDel (k1);
      99           3 :         keyDel (k2);
     100           3 : }
     101             : 
     102           3 : static void test_directbelow (void)
     103             : {
     104           3 :         printf ("check if direct below\n");
     105           3 :         Key * k1 = keyNew ("/", KEY_END);
     106           3 :         Key * k2 = keyNew ("/", KEY_END);
     107             : 
     108           3 :         succeed_if (keySetName (k1, "user:/") == 7, "should be a valid name");
     109           3 :         succeed_if (keySetName (k2, "user:/a") == 8, "should be a valid name");
     110           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     111             : 
     112           3 :         succeed_if (keySetName (k1, "system:/") == 9, "should be a valid name");
     113           3 :         succeed_if (keySetName (k2, "system:/a") == 10, "should be a valid name");
     114           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     115             : 
     116           3 :         succeed_if (keySetName (k1, "user:/") == 7, "should be a valid name");
     117           3 :         succeed_if (keySetName (k2, "user:/longer_name") == 18, "should be a valid name");
     118           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     119             : 
     120           3 :         succeed_if (keySetName (k1, "system:/") == 9, "should be a valid name");
     121           3 :         succeed_if (keySetName (k2, "system:/longer_name") == 20, "should be a valid name");
     122           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     123             : 
     124           3 :         succeed_if (keySetName (k1, "user:/a") == 8, "should be a valid name");
     125           3 :         succeed_if (keySetName (k2, "user:/a/a") == 10, "should be a valid name");
     126           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     127             : 
     128           3 :         succeed_if (keySetName (k1, "system:/a") == 10, "should be a valid name");
     129           3 :         succeed_if (keySetName (k2, "system:/a/a") == 12, "should be a valid name");
     130           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     131             : 
     132           3 :         succeed_if (keySetName (k1, "system:/a\\/a") == 13, "should be a valid name");
     133           3 :         succeed_if (keySetName (k2, "system:/a\\/a/a") == 15, "should be a valid name");
     134           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     135             : 
     136           3 :         succeed_if (keySetName (k1, "system:/a\\/a\\/a") == 16, "should be a valid name");
     137           3 :         succeed_if (keySetName (k2, "system:/a\\/a\\/a/b") == 18, "should be a valid name");
     138           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     139             : 
     140           3 :         succeed_if (keySetName (k1, "system:/a\\/a\\/a") == 16, "should be a valid name");
     141           3 :         succeed_if (keySetName (k2, "system:/a\\/a\\/a/b") == 18, "should be a valid name");
     142           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be direct below");
     143             : 
     144             : 
     145           3 :         keyDel (k1);
     146           3 :         keyDel (k2);
     147           3 : }
     148             : 
     149           3 : static void test_below (void)
     150             : {
     151           3 :         printf ("check if below\n");
     152           3 :         Key * k1 = keyNew ("/", KEY_END);
     153           3 :         Key * k2 = keyNew ("/", KEY_END);
     154             : 
     155           3 :         succeed_if (keySetName (k1, "user:/tests/simple") == 19, "should be a valid name");
     156           3 :         succeed_if (keySetName (k2, "user:/tests/simple/below") == 25, "should be a valid name");
     157           3 :         succeed_if (keyCmp (k1, k2) == 0 || keyIsBelow (k1, k2) == 1, "should be below");
     158           3 :         succeed_if (keyIsDirectlyBelow (k1, k2) == 1, "should be below");
     159             : 
     160           3 :         succeed_if (keySetName (k1, "user:/") == 7, "should be a valid name");
     161           3 :         succeed_if (keySetName (k2, "user:/a/a") == 10, "should be a valid name");
     162           3 :         succeed_if (keyIsBelow (k1, k2) == 1, "should be below");
     163             : 
     164           3 :         succeed_if (keySetName (k1, "system:/") == 9, "should be a valid name");
     165           3 :         succeed_if (keySetName (k2, "system:/a/a") == 12, "should be a valid name");
     166           3 :         succeed_if (keyIsBelow (k1, k2) == 1, "should be below");
     167             : 
     168           3 :         succeed_if (keySetName (k1, "user:/") == 7, "should be a valid name");
     169           3 :         succeed_if (keySetName (k2, "user:/longer_name/also_longer_name") == 35, "should be a valid name");
     170           3 :         succeed_if (keyIsBelow (k1, k2) == 1, "should be below");
     171             : 
     172           3 :         succeed_if (keySetName (k1, "system:/") == 9, "should be a valid name");
     173           3 :         succeed_if (keySetName (k2, "system:/longer_name/also_longer_name") == 37, "should be a valid name");
     174           3 :         succeed_if (keyIsBelow (k1, k2) == 1, "should be below");
     175             : 
     176           3 :         succeed_if (keySetName (k1, "user:/a") == 8, "should be a valid name");
     177           3 :         succeed_if (keySetName (k2, "user:/a/a/a/a/a/a") == 18, "should be a valid name");
     178           3 :         succeed_if (keyIsBelow (k1, k2) == 1, "should be below");
     179             : 
     180           3 :         succeed_if (keySetName (k1, "system:/a") == 10, "should be a valid name");
     181           3 :         succeed_if (keySetName (k2, "system:/a/a/a/a/a/a") == 20, "should be a valid name");
     182           3 :         succeed_if (keyIsBelow (k1, k2) == 1, "should be below");
     183             : 
     184           3 :         succeed_if (keySetName (k1, "/") == 2, "should be a valid name");
     185           3 :         succeed_if (keySetName (k2, "user:/something") == 16, "should be a valid name");
     186           3 :         succeed_if (keyIsBelow (k1, k2) == 1, "should be below");
     187             : 
     188           3 :         keyDel (k1);
     189           3 :         keyDel (k2);
     190           3 : }
     191             : 
     192           3 : static void test_examples (void)
     193             : {
     194           3 :         printf ("check examples\n");
     195           3 :         Key * key = keyNew ("/", KEY_END);
     196           3 :         Key * check = keyNew ("/", KEY_END);
     197             : 
     198           3 :         succeed_if (keySetName (key, "user:/key/folder") == 17, "should be a valid name");
     199           3 :         succeed_if (keySetName (check, "user:/key/folder") == 17, "should be a valid name");
     200           3 :         succeed_if (keyCmp (key, check) == 0, "should be same");
     201             : 
     202           3 :         succeed_if (keySetName (key, "user:/key/folder") == 17, "should be a valid name");
     203           3 :         succeed_if (keySetName (check, "user:/key/folder/child") == 23, "should be a valid name");
     204           3 :         succeed_if (keyIsDirectlyBelow (key, check) == 1, "should be direct below");
     205             : 
     206           3 :         succeed_if (keySetName (key, "user:/key/folder") == 17, "should be a valid name");
     207           3 :         succeed_if (keySetName (check, "user:/key/folder/any/depth/deeper/grand-child") == 46, "should be a valid name");
     208           3 :         succeed_if (keyIsDirectlyBelow (key, check) == 0 && keyIsBelow (key, check) == 1, "should be below (but not direct)");
     209           3 :         succeed_if (keyIsBelow (key, check) == 1, "should be below");
     210           3 :         succeed_if (keyCmp (key, check) == 0 || keyIsBelow (key, check) == 1, "should be the same or below");
     211             : 
     212           3 :         succeed_if (keySetName (key, "user:/key/folder") == 17, "should be a valid name");
     213           3 :         succeed_if (keySetName (check, "user:/notsame/folder") == 21, "should be a valid name");
     214           3 :         succeed_if (keyCmp (key, check) != 0 && keyIsDirectlyBelow (key, check) == 0 && keyIsBelow (key, check) == 0, "key is not below");
     215             : 
     216           3 :         succeed_if (keySetName (key, "user:/key/folder") == 17, "should be a valid name");
     217           3 :         succeed_if (keySetName (check, "system:/notsame/folder") == 23, "should be a valid name");
     218           3 :         int has_no_rel = keyCmp (key, check) != 0 && keyIsDirectlyBelow (key, check) == 0 && keyIsBelow (key, check) == 0;
     219           3 :         succeed_if (has_no_rel == 1, "not in the same namespace");
     220             : 
     221           3 :         keyDel (key);
     222           3 :         keyDel (check);
     223           3 : }
     224             : 
     225           3 : static void test_hierarchy (void)
     226             : {
     227           3 :         printf ("check hierarchy\n");
     228           3 :         Key * key = keyNew ("/", KEY_END);
     229           3 :         Key * check = keyNew ("/", KEY_END);
     230             : 
     231           3 :         succeed_if (keySetName (key, "user:/key/folder/key") == 21, "should be a valid name");
     232           3 :         succeed_if (keySetName (check, "user:/other/folder/key") == 23, "should be a valid name");
     233           3 :         succeed_if (keyCmp (key, check) != 0 && keyIsDirectlyBelow (key, check) == 0 && keyIsBelow (key, check) == 0, "should be same");
     234             : 
     235           3 :         succeed_if (keySetName (key, "system:/key/folder/key") == 23, "should be a valid name");
     236           3 :         succeed_if (keySetName (check, "system:/other/folder/key") == 25, "should be a valid name");
     237           3 :         succeed_if (keyCmp (key, check) != 0 && keyIsDirectlyBelow (key, check) == 0 && keyIsBelow (key, check) == 0, "should be same");
     238             : 
     239           3 :         succeed_if (keySetName (key, "user:/key/folder/key") == 21, "should be a valid name");
     240           3 :         succeed_if (keySetName (check, "system:/other/folder/key") == 25, "should be a valid name");
     241             : 
     242           3 :         int has_no_rel = keyCmp (key, check) != 0 && keyIsDirectlyBelow (key, check) == 0 && keyIsBelow (key, check) == 0;
     243           3 :         succeed_if (has_no_rel == 1, "should be different (1)");
     244             : 
     245           3 :         succeed_if (keySetName (key, "system:/key/folder/key") == 23, "should be a valid name");
     246           3 :         succeed_if (keySetName (check, "user:/other/folder/key") == 23, "should be a valid name");
     247             : 
     248           3 :         has_no_rel = keyCmp (key, check) != 0 && keyIsDirectlyBelow (key, check) == 0 && keyIsBelow (key, check) == 0;
     249           3 :         succeed_if (has_no_rel == 1, "should be different (2)");
     250           3 :         keyDel (key);
     251           3 :         keyDel (check);
     252           3 : }
     253             : 
     254           3 : void test_keyCmpNsOrder (void)
     255             : {
     256           3 :         Key * cascadingKey = keyNew ("/key", KEY_END);
     257           3 :         Key * metaKey = keyNew ("meta:/key", KEY_END);
     258           3 :         Key * specKey = keyNew ("spec:/key", KEY_END);
     259           3 :         Key * procKey = keyNew ("proc:/key", KEY_END);
     260           3 :         Key * dirKey = keyNew ("dir:/key", KEY_END);
     261           3 :         Key * userKey = keyNew ("user:/key", KEY_END);
     262           3 :         Key * systemKey = keyNew ("system:/key", KEY_END);
     263           3 :         Key * defaultKey = keyNew ("default:/key", KEY_END);
     264             : 
     265           3 :         succeed_if (keyCmp (cascadingKey, cascadingKey) == 0, "cascading not equal to cascading");
     266           3 :         succeed_if (keyCmp (cascadingKey, metaKey) < 0, "cascading not smaller than meta");
     267           3 :         succeed_if (keyCmp (cascadingKey, specKey) < 0, "cascading not smaller than spec");
     268           3 :         succeed_if (keyCmp (cascadingKey, procKey) < 0, "cascading not smaller than proc");
     269           3 :         succeed_if (keyCmp (cascadingKey, dirKey) < 0, "cascading not smaller than dir");
     270           3 :         succeed_if (keyCmp (cascadingKey, userKey) < 0, "cascading not smaller than user");
     271           3 :         succeed_if (keyCmp (cascadingKey, systemKey) < 0, "cascading not smaller than system");
     272           3 :         succeed_if (keyCmp (cascadingKey, defaultKey) < 0, "cascading not smaller than default");
     273             : 
     274           3 :         succeed_if (keyCmp (metaKey, cascadingKey) > 0, "meta not greater than cascading");
     275           3 :         succeed_if (keyCmp (metaKey, metaKey) == 0, "meta not equal to meta");
     276           3 :         succeed_if (keyCmp (metaKey, specKey) < 0, "meta not smaller than spec");
     277           3 :         succeed_if (keyCmp (metaKey, procKey) < 0, "meta not smaller than proc");
     278           3 :         succeed_if (keyCmp (metaKey, dirKey) < 0, "meta not smaller than dir");
     279           3 :         succeed_if (keyCmp (metaKey, userKey) < 0, "meta not smaller than user");
     280           3 :         succeed_if (keyCmp (metaKey, systemKey) < 0, "meta not smaller than system");
     281           3 :         succeed_if (keyCmp (metaKey, defaultKey) < 0, "meta not smaller than default");
     282             : 
     283           3 :         succeed_if (keyCmp (specKey, cascadingKey) > 0, "spec not greater than cascading");
     284           3 :         succeed_if (keyCmp (specKey, metaKey) > 0, "spec not greater than meta");
     285           3 :         succeed_if (keyCmp (specKey, specKey) == 0, "spec not equal to spec");
     286           3 :         succeed_if (keyCmp (specKey, procKey) < 0, "spec not smaller than proc");
     287           3 :         succeed_if (keyCmp (specKey, dirKey) < 0, "spec not smaller than dir");
     288           3 :         succeed_if (keyCmp (specKey, userKey) < 0, "spec not smaller than user");
     289           3 :         succeed_if (keyCmp (specKey, systemKey) < 0, "spec not smaller than system");
     290           3 :         succeed_if (keyCmp (specKey, defaultKey) < 0, "spec not smaller than default");
     291             : 
     292           3 :         succeed_if (keyCmp (procKey, cascadingKey) > 0, "proc not greater than cascading");
     293           3 :         succeed_if (keyCmp (procKey, metaKey) > 0, "proc not greater than meta");
     294           3 :         succeed_if (keyCmp (procKey, specKey) > 0, "proc not greater than spec");
     295           3 :         succeed_if (keyCmp (procKey, procKey) == 0, "proc not equal to proc");
     296           3 :         succeed_if (keyCmp (procKey, dirKey) < 0, "proc not smaller than dir");
     297           3 :         succeed_if (keyCmp (procKey, userKey) < 0, "proc not smaller than user");
     298           3 :         succeed_if (keyCmp (procKey, systemKey) < 0, "proc not smaller than system");
     299           3 :         succeed_if (keyCmp (procKey, defaultKey) < 0, "proc not smaller than default");
     300             : 
     301           3 :         succeed_if (keyCmp (dirKey, cascadingKey) > 0, "dir not greater than cascading");
     302           3 :         succeed_if (keyCmp (dirKey, metaKey) > 0, "dir not greater than meta");
     303           3 :         succeed_if (keyCmp (dirKey, specKey) > 0, "dir not greater than spec");
     304           3 :         succeed_if (keyCmp (dirKey, procKey) > 0, "dir not grater than proc");
     305           3 :         succeed_if (keyCmp (dirKey, dirKey) == 0, "dir not equal to dir");
     306           3 :         succeed_if (keyCmp (dirKey, userKey) < 0, "dir not smaller than user");
     307           3 :         succeed_if (keyCmp (dirKey, systemKey) < 0, "dir not smaller than system");
     308           3 :         succeed_if (keyCmp (dirKey, defaultKey) < 0, "dir not smaller than default");
     309             : 
     310           3 :         succeed_if (keyCmp (userKey, cascadingKey) > 0, "user not greater than cascading");
     311           3 :         succeed_if (keyCmp (userKey, metaKey) > 0, "user not greater than meta");
     312           3 :         succeed_if (keyCmp (userKey, specKey) > 0, "user not greater than spec");
     313           3 :         succeed_if (keyCmp (userKey, procKey) > 0, "user not greater than proc");
     314           3 :         succeed_if (keyCmp (userKey, dirKey) > 0, "user not greater than dir");
     315           3 :         succeed_if (keyCmp (userKey, userKey) == 0, "user not eqaul user");
     316           3 :         succeed_if (keyCmp (userKey, systemKey) < 0, "user not smaller than system");
     317           3 :         succeed_if (keyCmp (userKey, defaultKey) < 0, "user not smaller than default");
     318             : 
     319           3 :         succeed_if (keyCmp (systemKey, cascadingKey) > 0, "system not greater than cascading");
     320           3 :         succeed_if (keyCmp (systemKey, metaKey) > 0, "system not greater than meta");
     321           3 :         succeed_if (keyCmp (systemKey, specKey) > 0, "system not greater than spec");
     322           3 :         succeed_if (keyCmp (systemKey, procKey) > 0, "system not greater than proc");
     323           3 :         succeed_if (keyCmp (systemKey, dirKey) > 0, "system not greater than dir");
     324           3 :         succeed_if (keyCmp (systemKey, userKey) > 0, "system not greater than user");
     325           3 :         succeed_if (keyCmp (systemKey, systemKey) == 0, "system not equal to system");
     326           3 :         succeed_if (keyCmp (systemKey, defaultKey) < 0, "system not smaller than default");
     327             : 
     328           3 :         succeed_if (keyCmp (defaultKey, cascadingKey) > 0, "default not greater than cascading");
     329           3 :         succeed_if (keyCmp (defaultKey, metaKey) > 0, "default not greater than meta");
     330           3 :         succeed_if (keyCmp (defaultKey, specKey) > 0, "default not greater than spec");
     331           3 :         succeed_if (keyCmp (defaultKey, procKey) > 0, "default not greater than proc");
     332           3 :         succeed_if (keyCmp (defaultKey, dirKey) > 0, "default not greater than dir");
     333           3 :         succeed_if (keyCmp (defaultKey, userKey) > 0, "default not greater than user");
     334           3 :         succeed_if (keyCmp (defaultKey, systemKey) > 0, "default not greater than system");
     335           3 :         succeed_if (keyCmp (defaultKey, defaultKey) == 0, "default not equal to default");
     336             : 
     337           3 :         keyDel (cascadingKey);
     338           3 :         keyDel (metaKey);
     339           3 :         keyDel (specKey);
     340           3 :         keyDel (procKey);
     341           3 :         keyDel (dirKey);
     342           3 :         keyDel (userKey);
     343           3 :         keyDel (systemKey);
     344           3 :         keyDel (defaultKey);
     345           3 : }
     346             : 
     347           3 : int main (int argc, char ** argv)
     348             : {
     349           3 :         printf ("KEY RELATION TESTS\n");
     350           3 :         printf ("==================\n\n");
     351             : 
     352           3 :         init (argc, argv);
     353             : 
     354           3 :         test_keyCmp ();
     355           3 :         test_directbelow ();
     356           3 :         test_below ();
     357           3 :         test_examples ();
     358           3 :         test_hierarchy ();
     359           3 :         test_keyCmpNsOrder ();
     360             : 
     361           3 :         printf ("\ntest_key RESULTS: %d test(s) done. %d error(s).\n", nbTest, nbError);
     362             : 
     363           3 :         return nbError;
     364             : }

Generated by: LCOV version 1.13