Getting looser throw specifier error when trying to mock a class which uses kj Promises #4511
Unanswered
legolas145
asked this question in
Community Help
Replies: 2 comments 1 reply
-
Hi |
Beta Was this translation helpful? Give feedback.
1 reply
-
The "looser throw specifier" error occurs because Solution:
This approach keeps |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am pretty new to Gtest and Gmock.I have a interface which has a function that returns a kj::Promise as response.I am using mock to mock that interface.
I notice that I am getting a looser throw specifier error
/usr/include/gmock/gmock-spec-builders.h: In instantiation of 'class testing::internal::ActionResultHolder<kj::Promise >':
/usr/include/gmock/gmock-spec-builders.h:1601:20: required from 'testing::internal::FunctionMocker<R(Args ...)>::Result testing::internal::FunctionMocker<R(Args ...)>::Invoke(Args ...) [with R = kj::Promise; Args = {std::__cxx11::basic_string<char, std::char_traits, std::allocator >}; testing::internal::FunctionMocker<R(Args ...)>::Result = kj::Promise]'
/usr/include/gmock/gmock-spec-builders.h:1378:7: error: looser throw specifier for 'virtual testing::internal::ActionResultHolder<kj::Promise >::~ActionResultHolder() noexcept (false)'
1378 | class ActionResultHolder : public UntypedActionResultHolderBase {
| ^~~~~~~~~~~~~~~~~~
/usr/include/gmock/gmock-spec-builders.h:1370:11: note: overridden function is 'virtual testing::internal::UntypedActionResultHolderBase::~UntypedActionResultHolderBase() noexcept'
May I know why I am getting this error and what should I do to fix this?
Beta Was this translation helpful? Give feedback.
All reactions