Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1167

ctest doesn't compile on mac (mohave)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.3
    • library
    • None
    • 1

    Description

      On my macbook I'm building libcouchbase and running the tests (per https://github.com/couchbase/libcouchbase).  

      I have this version of gcc:

      stevewatanabe @ ~/libcouchbase/tests/iotests (master) $ gcc --version
      Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
      Apple clang version 11.0.0 (clang-1100.0.33.8)
      Target: x86_64-apple-darwin18.7.0
      Thread model: posix
      InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
      

      The ctest BUILD_TESTS fails unless I make the following changes:

      stevewatanabe @ ~/libcouchbase/tests/iotests (master) $ git diff
      diff --git a/tests/iotests/t_netfail.cc b/tests/iotests/t_netfail.cc
      index c45c61cd..88a18aa7 100644
      --- a/tests/iotests/t_netfail.cc
      +++ b/tests/iotests/t_netfail.cc
      @@ -815,7 +815,9 @@ TEST_F(MockUnitTest, testNegativeIndex)
           lcb_cmdstore_key(scmd, key.c_str(), key.size());
           std::string value("{}");
           lcb_cmdstore_value(scmd, value.c_str(), value.size());
      -    ni = {LCB_SUCCESS, 0};
      +    // ni = {LCB_SUCCESS, 0};
      +    ni.err = LCB_SUCCESS;
      +    ni.callCount = 0;
           err = lcb_store(instance, &ni, scmd);
           ASSERT_EQ(LCB_SUCCESS, err);
           lcb_wait(instance, LCB_WAIT_DEFAULT);
      @@ -826,7 +828,9 @@ TEST_F(MockUnitTest, testNegativeIndex)
           lcb_CMDGET *gcmd;
           lcb_cmdget_create(&gcmd);
           lcb_cmdget_key(gcmd, key.c_str(), key.size());
      -    ni = {LCB_SUCCESS, 0};
      +    // ni = {LCB_SUCCESS, 0};
      +    ni.err = LCB_SUCCESS;
      +    ni.callCount = 0;
           // Set the index to -1
           vbc->vbuckets[vb].servers[0] = -1;
           err = lcb_get(instance, &ni, gcmd);
      diff --git a/tests/iotests/t_obseqno.cc b/tests/iotests/t_obseqno.cc
      index d4fb60a5..e7a8e590 100644
      --- a/tests/iotests/t_obseqno.cc
      +++ b/tests/iotests/t_obseqno.cc
      @@ -129,7 +129,8 @@ TEST_F(ObseqnoTest, testObserve)
       
           for (size_t ii = 0; ii < lcbvb_get_nreplicas(vbc) + 1; ii++) {
               int ix = lcbvb_vbserver(vbc, st_fetched.vbid_, ii);
      -        lcb_RESPOBSEQNO resp{};
      +        // lcb_RESPOBSEQNO resp{};
      +        lcb_RESPOBSEQNO resp;
      

      It looks like the compiler doesn't like structure initialization.
       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Build couchbase-server-7.0.0-3115 contains libcouchbase commit cd12f05 with commit message:
          CCBC-1167: fix tests build on MacOS

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-3115 contains libcouchbase commit cd12f05 with commit message: CCBC-1167 : fix tests build on MacOS

          People

            avsej Sergey Avseyev
            steve.watanabe Steve Watanabe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty