Mercurial > irccd
diff tests/js-elapsedtimer/main.cpp @ 179:ef527409e638
Irccd: update JavaScript code
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 31 May 2016 21:03:01 +0200 |
parents | 9f36f71a08c5 |
children | cb61cc16e2b6 |
line wrap: on
line diff
--- a/tests/js-elapsedtimer/main.cpp Thu May 26 21:20:46 2016 +0200 +++ b/tests/js-elapsedtimer/main.cpp Tue May 31 21:03:01 2016 +0200 @@ -46,12 +46,12 @@ { try { if (duk::pevalString(m_plugin->context(), "timer = new Irccd.ElapsedTimer();") != 0) - throw duk::error(m_plugin->context(), -1); + throw duk::exception(m_plugin->context(), -1); std::this_thread::sleep_for(300ms); if (duk::pevalString(m_plugin->context(), "result = timer.elapsed();") != 0) - throw duk::error(m_plugin->context(), -1); + throw duk::exception(m_plugin->context(), -1); ASSERT_GE(duk::getGlobal<int>(m_plugin->context(), "result"), 250); ASSERT_LE(duk::getGlobal<int>(m_plugin->context(), "result"), 350); @@ -64,12 +64,12 @@ { try { if (duk::pevalString(m_plugin->context(), "timer = new Irccd.ElapsedTimer();") != 0) - throw duk::error(m_plugin->context(), -1); + throw duk::exception(m_plugin->context(), -1); std::this_thread::sleep_for(300ms); if (duk::pevalString(m_plugin->context(), "timer.reset(); result = timer.elapsed();") != 0) - throw duk::error(m_plugin->context(), -1); + throw duk::exception(m_plugin->context(), -1); ASSERT_LE(duk::getGlobal<int>(m_plugin->context(), "result"), 100); } catch (const std::exception &ex) {