Mercurial > malikania
diff tests/libclient/js-font/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-font/main.cpp Thu May 26 07:32:05 2016 +0200 +++ b/tests/libclient/js-font/main.cpp Thu Jun 16 13:35:31 2016 +0200 @@ -32,54 +32,54 @@ class TestFont : 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: - TestFont() - : m_locator(SOURCE_DIRECTORY "/resources") - , m_loader(m_locator) - { - duk::putGlobal(m_ctx, "Malikania", duk::Object()); + TestFont() + : m_locator(SOURCE_DIRECTORY "/resources") + , m_loader(m_locator) + { + duk::putGlobal(m_ctx, "Malikania", duk::Object()); - loadMalikaniaFont(m_ctx); - loadMalikaniaWindow(m_ctx); + loadMalikaniaFont(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(TestFont, basic) { - try { - auto ret = duk::pevalString(m_ctx, - "w = new Malikania.Window();" - "f = new Malikania.Font('DejaVuSans.ttf', 10);" - "w.setDrawingColor('lightskyblue');" - "w.clear();" - "s = 'The world is Malikania.';" - "c = f.clip(s);" - "w.setDrawingColor('white');" - "w.drawText(s, f, { x: 320 - (c.width / 2), y: 240 - (c.height / 2) });" - "w.present();" - ); + try { + auto ret = duk::pevalString(m_ctx, + "w = new Malikania.Window();" + "f = new Malikania.Font('DejaVuSans.ttf', 10);" + "w.setDrawingColor('lightskyblue');" + "w.clear();" + "s = 'The world is Malikania.';" + "c = f.clip(s);" + "w.setDrawingColor('white');" + "w.drawText(s, f, { x: 320 - (c.width / 2), y: 240 - (c.height / 2) });" + "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(); }