Mercurial > malikania
diff tests/libclient/js-animation/main.cpp @ 30:a1e80d991968
Misc: convert to spaces, #519
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 16 Jun 2016 13:35:31 +0200 |
parents | 0a1adf7dcca0 |
children | d4f5f7231b84 |
line wrap: on
line diff
--- a/tests/libclient/js-animation/main.cpp Thu May 26 07:32:05 2016 +0200 +++ b/tests/libclient/js-animation/main.cpp Thu Jun 16 13:35:31 2016 +0200 @@ -34,65 +34,65 @@ class TestAnimation : public testing::Test { protected: - ResourcesLocatorDirectory m_locator; - ClientResourcesLoader m_loader; + ResourcesLocatorDirectory m_locator; + ClientResourcesLoader m_loader; - duk::Context m_ctx; + duk::Context m_ctx; public: - TestAnimation() - : m_locator(SOURCE_DIRECTORY "/resources") - , m_loader(m_locator) - { - duk::putGlobal(m_ctx, "Malikania", duk::Object()); + TestAnimation() + : m_locator(SOURCE_DIRECTORY "/resources") + , m_loader(m_locator) + { + duk::putGlobal(m_ctx, "Malikania", duk::Object()); - loadMalikaniaAnimation(m_ctx); - loadMalikaniaAnimator(m_ctx); - loadMalikaniaWindow(m_ctx); + loadMalikaniaAnimation(m_ctx); + loadMalikaniaAnimator(m_ctx); + loadMalikaniaWindow(m_ctx); - /* Store the loader */ - duk::putGlobal(m_ctx, "\xff""\xff""loader", &m_loader); - } + /* Store the loader */ + duk::putGlobal(m_ctx, "\xff""\xff""loader", &m_loader); + } }; TEST_F(TestAnimation, basic) { - try { - auto ret = duk::pevalString(m_ctx, - "w = new Malikania.Window();" - "a = new Malikania.Animation('animations/margins.json');" - "d = new Malikania.Animator(a);" - ); + try { + auto ret = duk::pevalString(m_ctx, + "w = new Malikania.Window();" + "a = new Malikania.Animation('animations/margins.json');" + "d = new Malikania.Animator(a);" + ); - if (ret != 0) { - throw duk::exception(m_ctx, -1); - } + if (ret != 0) { + throw duk::exception(m_ctx, -1); + } - ElapsedTimer timer; + ElapsedTimer timer; - while (timer.elapsed() < 8000) { - auto ret = duk::pevalString(m_ctx, - "w.setDrawingColor('lightskyblue');" - "w.clear();" - "d.draw(w, { x: 320 - 16, y: 240 - 16 });" - "d.update();" - "w.present();" - ); + while (timer.elapsed() < 8000) { + auto ret = duk::pevalString(m_ctx, + "w.setDrawingColor('lightskyblue');" + "w.clear();" + "d.draw(w, { x: 320 - 16, y: 240 - 16 });" + "d.update();" + "w.present();" + ); - if (ret != 0) { - throw duk::exception(m_ctx, -1); - } - } + if (ret != 0) { + throw duk::exception(m_ctx, -1); + } + } - std::this_thread::sleep_for(3s); - } catch (const std::exception &ex) { - FAIL() << ex.what(); - } + std::this_thread::sleep_for(3s); + } catch (const std::exception &ex) { + FAIL() << ex.what(); + } } int main(int argc, char **argv) { - testing::InitGoogleTest(&argc, argv); + testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); + return RUN_ALL_TESTS(); }