apache / apache/pulsar-client-cpp
[Bug] Testws fail to compile: error: expected expression (ASSERT_GE(PULSAR_VERSION, 2000000);)
- 主要语言
- C++
- 星标
- 71
- 派生
- 90
- 平均合并
- 2 小时 33 分钟
- 30 天内合并 PR
- 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 如何通过生成的 include 路径提供,然后确认测试目标能够成功编译,并且其版本断言通过。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp
- 领域
- build-system, testing-qa
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100