ctest doesn't compile on mac (mohave)

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.
 

 

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:

CB robot September 15, 2020 at 11:05 AM

Build couchbase-server-7.0.0-3115 contains libcouchbase commit cd12f05 with commit message:
https://couchbasecloud.atlassian.net/browse/CCBC-1167#icft=CCBC-1167: fix tests build on MacOS

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Fix versions

Story Points

Components

Reporter

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created January 23, 2020 at 11:30 PM
Updated December 9, 2020 at 10:36 PM
Resolved July 14, 2020 at 6:56 PM
Instabug