adding missing test
This commit is contained in:
parent
892df5c0b7
commit
a0c8d84372
1 changed files with 16 additions and 0 deletions
16
tests/task_cancel.cpp
Normal file
16
tests/task_cancel.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include <fc/thread/thread.hpp>
|
||||||
|
#include <fc/log/logger.hpp>
|
||||||
|
#include <fc/exception/exception.hpp>
|
||||||
|
|
||||||
|
int main( int argc, char** argv )
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
auto result = fc::schedule( [=]() { ilog( "hello world" ); }, fc::time_point::now() + fc::seconds(3) );
|
||||||
|
result.cancel();
|
||||||
|
result.wait();
|
||||||
|
}
|
||||||
|
catch ( const fc::exception& e )
|
||||||
|
{
|
||||||
|
wlog( "${e}", ("e",e.to_detail_string() ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue