Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3643

Add (more) unit tests for ArrayMap

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.18.0
    • Component/s: libutils
    • Labels:

      Description

      These seem to be the only uses of ArrayMap in libntech/tests/unit test:

      $ git grep ArrayMap
      map_test.c:    ArrayMap *m = ArrayMapNew(StringEqual_untyped, free, free);
      map_test.c:    assert_int_equal(ArrayMapInsert(m, key1, val1), 2);
      map_test.c:    assert_int_equal(ArrayMapInsert(m, key2, val2), 1);
      map_test.c:        MapKeyValue *keyval = ArrayMapGet(m, key2);
      map_test.c:        MapKeyValue *keyval2 = ArrayMapGet(m, "blah");
      map_test.c:    ArrayMapDestroy(m);
      

      That's a very small coverage for a data structure which we use in so many places (all Map instances with less than 15 items).

        Attachments

          Activity

            People

            Assignee:
            Alias Georgios Kotzampopoulos
            Reporter:
            vpodzime Vratislav Podzimek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: