apache / apache/pulsar-client-cpp
[Bug] Testws fail to compile: error: expected expression (ASSERT_GE(PULSAR_VERSION, 2000000);)
- Ngôn ngữ chính
- C++
- Star
- 71
- Fork
- 90
- Merge trung bình
- 2 giờ 33 phút
- Pull request đã merge (30 ngày)
- 3
Mô tả
### 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!
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách chạy quá trình biên dịch test và kiểm tra tests/VersionTest.cc, đặc biệt là các assertion ở dòng 24-25. Theo dõi cách PULSAR_VERSION được cung cấp thông qua các đường dẫn include được tạo ra, sau đó xác nhận rằng target test biên dịch thành công và các assertion về phiên bản của nó đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp
- Lĩnh vực
- build-system, testing-qa
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100