Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-12364

init_key() in test_prepare_mod_sort.cpp should use REQUIRE() rather than WT_ASSERT

    • Storage Engines
    • 1
    • 2024-02-06 tapioooooooooooooca

      In Catch2-based unit tests, status should be checked using REQUIRE() which is part of the Catch2 framework, rather than using WT_ASSERT as one would within WiredTiger itself.

      init_key() in test_prepare_mod_sort.cpp currently uses WT_ASSERT. However, it should use REQUIRE() instead:

      void
      init_key(WT_SESSION_IMPL *session, WT_ITEM *key, std::string key_str)
      {
          WT_DECL_RET;
      
          ret = __wt_buf_init(session, key, key_str.size());
          WT_ASSERT(session, ret == 0);
          ret = __wt_buf_set(session, key, key_str.c_str(), key_str.size());
          WT_ASSERT(session, ret == 0);
      } 

      This ticket will change the WT_ASSERT() calls to REQUIRE().

            Assignee:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Reporter:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: