tests + fixed uvw::Loop::configure

This commit is contained in:
Michele Caini 2017-06-16 10:47:46 +02:00
parent 34adf15a24
commit 40ca3fd469
2 changed files with 9 additions and 1 deletions

View File

@ -208,7 +208,8 @@ public:
*/
template<typename... Args>
void configure(Configure flag, Args&&... args) {
auto err = uv_loop_configure(loop.get(), static_cast<std::underlying_type_t<Configure>>(flag), std::forward<Args>(args)...);
auto option = static_cast<std::underlying_type_t<Configure>>(flag);
auto err = uv_loop_configure(loop.get(), static_cast<uv_loop_option>(option), std::forward<Args>(args)...);
if(err) { publish(ErrorEvent{err}); }
}

View File

@ -53,3 +53,10 @@ TEST(Loop, Functionalities) {
ASSERT_FALSE(loop->alive());
}
TEST(Loop, Configure) {
auto loop = uvw::Loop::create();
ASSERT_NO_THROW(loop->configure(uvw::Loop::Configure::BLOCK_SIGNAL, 9));
ASSERT_NO_THROW(loop->run());
}