Mercurial > malikania
diff tests/libclient/js-line/main.cpp @ 42:a47a4477f347
Misc: new style, closes #578
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 29 Nov 2016 21:21:36 +0100 |
parents | 9af360f34c7d |
children | fabbe1759cec |
line wrap: on
line diff
--- a/tests/libclient/js-line/main.cpp Sun Nov 27 20:50:38 2016 +0100 +++ b/tests/libclient/js-line/main.cpp Tue Nov 29 21:21:36 2016 +0100 @@ -18,7 +18,7 @@ #include <gtest/gtest.h> -#include <malikania/js-line.hpp> +#include <malikania/js_line.hpp> using namespace malikania; @@ -51,8 +51,9 @@ "y2 = r.y2;" ); - if (ret != 0) + if (ret != 0) { throw dukx_exception(m_ctx, -1); + } duk_get_global_string(m_ctx, "x1"); ASSERT_EQ(0, duk_to_int(m_ctx, -1)); @@ -82,8 +83,9 @@ "y2 = r.y2;" ); - if (ret != 0) + if (ret != 0) { throw dukx_exception(m_ctx, -1); + } duk_get_global_string(m_ctx, "x1"); ASSERT_EQ(10, duk_to_int(m_ctx, -1)); @@ -113,8 +115,9 @@ "y2 = r.y2;" ); - if (ret != 0) + if (ret != 0) { throw dukx_exception(m_ctx, -1); + } duk_get_global_string(m_ctx, "x1"); ASSERT_EQ(10, duk_to_int(m_ctx, -1)); @@ -144,8 +147,9 @@ "y2 = r.y2;" ); - if (ret != 0) + if (ret != 0) { throw dukx_exception(m_ctx, -1); + } duk_get_global_string(m_ctx, "x1"); ASSERT_EQ(10, duk_to_int(m_ctx, -1)); @@ -181,8 +185,9 @@ "}" ); - if (ret != 0) + if (ret != 0) { throw dukx_exception(m_ctx, -1); + } duk_get_global_string(m_ctx, "name"); ASSERT_STREQ("TypeError", duk_to_string(m_ctx, -1)); @@ -204,7 +209,7 @@ { try { duk_push_c_function(m_ctx, [] (auto ctx) { - Line line = dukx_require_line(ctx, 0); + auto line = dukx_require_line(ctx, 0); duk_push_int(ctx, line.x1()); duk_put_global_string(ctx, "x1"); @@ -221,8 +226,9 @@ auto ret = duk_peval_string(m_ctx, "build({ x1: 50, y1: 80, x2: 100, y2: 200 });"); - if (ret != 0) + if (ret != 0) { throw dukx_exception(m_ctx, -1); + } duk_get_global_string(m_ctx, "x1"); ASSERT_EQ(50, duk_to_int(m_ctx, -1)); @@ -260,8 +266,9 @@ "}" ); - if (ret != 0) + if (ret != 0) { throw dukx_exception(m_ctx, -1); + } duk_get_global_string(m_ctx, "name"); ASSERT_STREQ("Error", duk_to_string(m_ctx, -1)); @@ -283,7 +290,7 @@ { try { duk_push_c_function(m_ctx, [] (auto ctx) { - Line line = dukx_get_line(ctx, 0); + auto line = dukx_get_line(ctx, 0); duk_push_int(ctx, line.x1()); duk_put_global_string(ctx, "x1"); @@ -300,8 +307,9 @@ auto ret = duk_peval_string(m_ctx, "build({});"); - if (ret != 0) + if (ret != 0) { throw dukx_exception(m_ctx, -1); + } duk_get_global_string(m_ctx, "x1"); ASSERT_EQ(0, duk_to_int(m_ctx, -1));