Mercurial > irccd
comparison tests/src/libirccd-js/js-api-chrono/main.cpp @ 868:7619105cc818
tests: add more delay for Irccd.Chrono
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 26 Jul 2019 21:01:00 +0000 |
parents | dcef68d82fd3 |
children | 5e25439fe98d |
comparison
equal
deleted
inserted
replaced
867:52f9ed8d530d | 868:7619105cc818 |
---|---|
43 | 43 |
44 if (duk_peval_string(plugin_->get_context(), "result = timer.elapsed();") != 0) | 44 if (duk_peval_string(plugin_->get_context(), "result = timer.elapsed();") != 0) |
45 throw duk::get_stack(plugin_->get_context(), -1); | 45 throw duk::get_stack(plugin_->get_context(), -1); |
46 | 46 |
47 BOOST_REQUIRE(duk_get_global_string(plugin_->get_context(), "result")); | 47 BOOST_REQUIRE(duk_get_global_string(plugin_->get_context(), "result")); |
48 BOOST_REQUIRE_GE(duk_get_int(plugin_->get_context(), -1), 250); | 48 BOOST_REQUIRE_GE(duk_get_int(plugin_->get_context(), -1), 200); |
49 BOOST_REQUIRE_LE(duk_get_int(plugin_->get_context(), -1), 350); | 49 BOOST_REQUIRE_LE(duk_get_int(plugin_->get_context(), -1), 400); |
50 } | 50 } |
51 | 51 |
52 BOOST_AUTO_TEST_CASE(pause) | 52 BOOST_AUTO_TEST_CASE(pause) |
53 { | 53 { |
54 /* | 54 /* |
86 | 86 |
87 if (duk_peval_string(plugin_->get_context(), "result = timer.elapsed();") != 0) | 87 if (duk_peval_string(plugin_->get_context(), "result = timer.elapsed();") != 0) |
88 throw duk::get_stack(plugin_->get_context(), -1); | 88 throw duk::get_stack(plugin_->get_context(), -1); |
89 | 89 |
90 BOOST_REQUIRE(duk_get_global_string(plugin_->get_context(), "result")); | 90 BOOST_REQUIRE(duk_get_global_string(plugin_->get_context(), "result")); |
91 BOOST_REQUIRE_GE(duk_get_int(plugin_->get_context(), -1), 950); | 91 BOOST_REQUIRE_GE(duk_get_int(plugin_->get_context(), -1), 900); |
92 BOOST_REQUIRE_LE(duk_get_int(plugin_->get_context(), -1), 1050); | 92 BOOST_REQUIRE_LE(duk_get_int(plugin_->get_context(), -1), 1100); |
93 } | 93 } |
94 | 94 |
95 BOOST_AUTO_TEST_CASE(start) | 95 BOOST_AUTO_TEST_CASE(start) |
96 { | 96 { |
97 /* | 97 /* |
111 | 111 |
112 if (duk_peval_string(plugin_->get_context(), "result = timer.elapsed();") != 0) | 112 if (duk_peval_string(plugin_->get_context(), "result = timer.elapsed();") != 0) |
113 throw duk::get_stack(plugin_->get_context(), -1); | 113 throw duk::get_stack(plugin_->get_context(), -1); |
114 | 114 |
115 BOOST_REQUIRE(duk_get_global_string(plugin_->get_context(), "result")); | 115 BOOST_REQUIRE(duk_get_global_string(plugin_->get_context(), "result")); |
116 BOOST_REQUIRE_GE(duk_get_int(plugin_->get_context(), -1), 950); | 116 BOOST_REQUIRE_GE(duk_get_int(plugin_->get_context(), -1), 900); |
117 BOOST_REQUIRE_LE(duk_get_int(plugin_->get_context(), -1), 1050); | 117 BOOST_REQUIRE_LE(duk_get_int(plugin_->get_context(), -1), 1100); |
118 } | 118 } |
119 | 119 |
120 BOOST_AUTO_TEST_SUITE_END() | 120 BOOST_AUTO_TEST_SUITE_END() |
121 | 121 |
122 } // !namespace | 122 } // !namespace |