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
For Gerrit Dashboard: CCBC-1167 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
132512,2 | CCBC-1167: fix tests build on MacOS | master | libcouchbase | Status: MERGED | +2 | +1 |