facebook / mvfst

An implementation of the QUIC transport protocol.
MIT License
1.5k stars 242 forks source link

QuicBatchWriterTest error: ‘testing::Values’ is not a type #239

Closed Zongshen closed 2 years ago

Zongshen commented 2 years ago

Hi. Thank you for providing this platform. I cloned and ran ./build-helper.sh on Ubuntu 20.04LTS and it shows the following errors during compiling.

[ 55%] Built target SlidingWindowRateLimiterTest /home/zongshen/Project/mvfst/mvfst/quic/api/test/QuicBatchWriterTest.cpp:633:5: error: ‘testing::Values’ is not a type 633 | ::testing::Values(false, true));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/QuicBatchWriterTest.cpp:633:23: error: expected ‘)’ before 'false’ 633 | ::testing::Values(false, true));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/QuicBatchWriterTest.cpp:633:23: error: expected ‘)’ before ‘false’ 633 | ::testing::Values(false, true));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/QuicBatchWriterTest.cpp:630:25: note: to match this ‘(’ 630 | INSTANTIATE_TEST_SUITE_P(

/home/zongshen/Project/mvfst/mvfst/quic/api/test/QuicBatchWriterTest.cpp:633:23: error: expected constructor, destructor, or type ``conversion before ‘false’ 633 | ::testing::Values(false, true));

cc1plus: warning: unrecognized command line option ‘-Wno-inconsistent-missing-override’ make[2]: *** [quic/api/test/CMakeFiles/QuicBatchWriterTest.dir/build.make:76: ``quic/api/test/CMakeFiles/QuicBatchWriterTest.dir/QuicBatchWriterTest.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:2067: quic/api/test/CMakeFiles/QuicBatchWriterTest.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

May I know what should I do for this? Thank you.

Zongshen commented 2 years ago

Hi, I rerun the ./build_helper.sh and the errors show as *** is not a type in other tests.

In file included from /home/zongshen/Project/mvfst/mvfst/quic/server/test/QuicSocketTest.cpp:9: /home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:26:21: error: ‘good’ is not a type 26 | MOCK_METHOD(bool, good, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:26:27: error: expected identifier before ‘(’ token 26 | MOCK_METHOD(bool, good, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:26:31: error: expected identifier before ‘(’ token 26 | MOCK_METHOD(bool, good, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:26:32: error: ISO C++ forbids declaration of 'parameter’ with no type [-fpermissive] 26 | MOCK_METHOD(bool, good, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:26:38: error: ISO C++ forbids declaration of ‘MOCK_METHOD’ with no type [-fpermissive] 26 | MOCK_METHOD(bool, good, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:27:21: error: ‘replaySafe’ is not a type 27 | MOCK_METHOD(bool, replaySafe, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:27:33: error: expected identifier before ‘(’ token 27 | MOCK_METHOD(bool, replaySafe, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:27:37: error: expected identifier before ‘(’ token 27 | MOCK_METHOD(bool, replaySafe, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:27:38: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive] 27 | MOCK_METHOD(bool, replaySafe, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:27:44: error: ISO C++ forbids declaration of ‘MOCK_METHOD’ with no type [-fpermissive] 27 | MOCK_METHOD(bool, replaySafe, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:27:3: error: ‘int quic::MockQuicSocket::MOCK_METHOD(bool, int, int (*)(), int (*)(int))’ cannot be overloaded with ‘int quic::MockQuicSocket::MOCK_METHOD(bool, int, int (*)(), int (*)(int))’ 27 | MOCK_METHOD(bool, replaySafe, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:26:3: note: previous declaration ‘int quic::MockQuicSocket::MOCK_METHOD(bool, int, int (*)(), int (*)(int))’ 26 | MOCK_METHOD(bool, good, (), (const));

/home/zongshen/Project/mvfst/mvfst/quic/api/test/MockQuicSocket.h:28:21: error: ‘error’ is not a type 28 | MOCK_METHOD(bool, error, (), (const));

May I know where should I adjust?

lnicco commented 2 years ago

https://github.com/facebookincubator/mvfst/commit/7127a107fb6b7ecde853a39bec7bb63cd6f06eef has fixed some build errors, can you please check if it fixed this issue as well?

Zongshen commented 2 years ago

Hi, I pulled to the version and the ./build_helper.sh works now. Thank you for your help and suggestion.