apache / apache/pulsar-client-cpp

[Bug] Testws fail to compile: error: expected expression (ASSERT_GE(PULSAR_VERSION, 2000000);)

Aperta
#472 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
71
Fork
90
Merge medio
2h 33m
PR unite (30g)
3

Descrizione

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing similar.

### Version

3.7.0

### Minimal reproduce step

compile tests

### What did you expect to see?

n/a

### What did you see instead?

```
FAILED: tests/CMakeFiles/pulsar-tests.dir/VersionTest.cc.o
ccache /usr/local/libexec/ccache/c++ -DBOOST_ALLOW_DEPRECATED_HEADERS -DBOOST_ALL_NO_LIB -DBUILDING_PULSAR -DHAS_SNAPPY=1 -DHAS_ZSTD=1 -I/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0 -I/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0/include -I/usr/ports/net-p2p/pulsar-client-cpp/work/.build/include -I/usr/ports/net-p2p/pulsar-client-cpp/work/.build/generated -I/usr/local/include -I/usr/ports/net-p2p/pulsar-client-cpp/work/.build/generated/tests -I/usr/ports/net-p2p/pulsar-client-cpp/work/.build/generated/lib -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -mcrc32 -mpclmul -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -mcrc32 -mpclmul -DNDEBUG -std=gnu++17 -fPIE -Wall -Wformat-security -Wvla -Werror -Wno-sign-compare -Wno-deprecated-declarations -Wno-error=cpp -Qunused-arguments -fvisibility=hidden -DTOKEN_PATH=\"/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0/.test-token.txt\" -DTEST_CONF_DIR=\"/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0/test-conf\" -MD -MT tests/CMakeFiles/pulsar-tests.dir/VersionTest.cc.o -MF tests/CMakeFiles/pulsar-tests.dir/VersionTest.cc.o.d -o tests/CMakeFiles/pulsar-tests.dir/VersionTest.cc.o -c /usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0/tests/VersionTest.cc
/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0/tests/VersionTest.cc:24:5: error: expected expression
24 | ASSERT_GE(PULSAR_VERSION, 2000000);
| ^
/usr/local/include/gtest/gtest.h:1930:31: note: expanded from macro 'ASSERT_GE'
1930 | #define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
| ^
/usr/local/include/gtest/gtest.h:1906:3: note: expanded from macro 'GTEST_ASSERT_GE'
1906 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
| ^
/usr/local/include/gtest/gtest_pred_impl.h:148:3: note: expanded from macro 'ASSERT_PRED_FORMAT2'
148 | GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
| ^
/usr/local/include/gtest/gtest_pred_impl.h:134:41: note: expanded from macro 'GTEST_PRED_FORMAT2_'
134 | GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), on_failure)
| ^
/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0/tests/VersionTest.cc:25:5: error: expected expression
25 | ASSERT_LE(PULSAR_VERSION, 999999999);
| ^
/usr/local/include/gtest/gtest.h:1922:31: note: expanded from macro 'ASSERT_LE'
1922 | #define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
| ^
/usr/local/include/gtest/gtest.h:1902:3: note: expanded from macro 'GTEST_ASSERT_LE'
1902 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
| ^
/usr/local/include/gtest/gtest_pred_impl.h:148:3: note: expanded from macro 'ASSERT_PRED_FORMAT2'
148 | GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
| ^
/usr/local/include/gtest/gtest_pred_impl.h:134:41: note: expanded from macro 'GTEST_PRED_FORMAT2_'
134 | GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), on_failure)
| ^
2 errors generated.
```

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by running the test compilation and inspecting tests/VersionTest.cc, especially the assertions on lines 24-25. Trace how PULSAR_VERSION is provided through the generated include paths, then confirm that the test target compiles successfully and its version assertions pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
build-system, testing-qa
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.