Mercurial > irccd
diff tests/js-elapsedtimer/main.cpp @ 111:1ed760f6e0c6
Irccd: new brace styles, #487
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 27 Apr 2016 21:37:09 +0200 |
parents | af84dd3d585b |
children | dc7d6ba08122 |
line wrap: on
line diff
--- a/tests/js-elapsedtimer/main.cpp Wed Apr 27 18:53:30 2016 +0200 +++ b/tests/js-elapsedtimer/main.cpp Wed Apr 27 21:37:09 2016 +0200 @@ -40,13 +40,15 @@ TEST_F(TestElapsedTimer, standard) { try { - if (duk::pevalString(m_context, "timer = new Irccd.ElapsedTimer();") != 0) + if (duk::pevalString(m_context, "timer = new Irccd.ElapsedTimer();") != 0) { throw duk::error(m_context, -1); + } std::this_thread::sleep_for(300ms); - if (duk::pevalString(m_context, "result = timer.elapsed();") != 0) + if (duk::pevalString(m_context, "result = timer.elapsed();") != 0) { throw duk::error(m_context, -1); + } ASSERT_GE(duk::getGlobal<int>(m_context, "result"), 250); ASSERT_LE(duk::getGlobal<int>(m_context, "result"), 350); @@ -58,13 +60,15 @@ TEST_F(TestElapsedTimer, reset) { try { - if (duk::pevalString(m_context, "timer = new Irccd.ElapsedTimer();") != 0) + if (duk::pevalString(m_context, "timer = new Irccd.ElapsedTimer();") != 0) { throw duk::error(m_context, -1); + } std::this_thread::sleep_for(300ms); - if (duk::pevalString(m_context, "timer.reset(); result = timer.elapsed();") != 0) + if (duk::pevalString(m_context, "timer.reset(); result = timer.elapsed();") != 0) { throw duk::error(m_context, -1); + } ASSERT_LE(duk::getGlobal<int>(m_context, "result"), 100); } catch (const std::exception &ex) {