apache / apache/pulsar-client-cpp
[Bug] Testws fail to compile: error: expected expression (ASSERT_GE(PULSAR_VERSION, 2000000);)
- 主要言語
- C++
- スター
- 71
- フォーク
- 90
- 平均マージ
- 2時間 33分
- マージ済み PR(30日)
- 3
説明
### 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!
コントリビューションガイド
調査の方向性
まずテストのコンパイルを実行し、tests/VersionTest.cc を調べます。特に 24-25 行目のアサーションを確認してください。生成されたインクルードパスを通じて PULSAR_VERSION がどのように提供されるかを追跡し、その後、テストターゲットが正常にコンパイルされ、バージョンに関するアサーションが成功することを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- build-system, testing-qa
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100