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

No unit tests for lmdb

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0
    • Component/s: Test suite
    • Labels:
      None
    • Platform:
      Any

      Description

      db_test.c has the following code for testing tokyocabinet and qdbm, but there are no unit tests for lmdb. This causes the db_test to fail (actually it indefinitely hangs) when run.

      https://github.com/cfengine/core/blob/master/tests/unit/db_test.c#L84
      <pre>
      #if defined(HAVE_LIBTOKYOCABINET) || defined(HAVE_LIBQDBM)
      static void CreateGarbage(const char *filename)
      {
      FILE *fh = fopen(filename, "w");
      for(int i = 0; i < 2; ++i)

      { fwrite("some garbage!", 14, 1, fh); }

      fclose(fh);
      }
      #endif /* HAVE_LIBTOKYOCABINET || HAVE_LIBQDBM */

      void test_recreate(void)
      {
      /* Test that recreating database works properly */
      #ifdef HAVE_LIBTOKYOCABINET
      char tcdb_db[CF_BUFSIZE];
      snprintf(tcdb_db, CF_BUFSIZE, "%s/cf_classes.tcdb", CFWORKDIR);
      CreateGarbage(tcdb_db);
      #endif
      #ifdef HAVE_LIBQDBM
      char qdbm_db[CF_BUFSIZE];
      snprintf(qdbm_db, CF_BUFSIZE, "%s/cf_classes.qdbm", CFWORKDIR);
      CreateGarbage(qdbm_db);
      #endif
      </pre>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10039 Hichame Jeffali (Inactive)
                Reporter:
                bahamat Brian Bennett
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel