diff tests/libclient/js-color/main.cpp @ 27:0a1adf7dcca0

Common: update libjs and adapt code
author David Demelier <markand@malikania.fr>
date Tue, 12 Apr 2016 13:53:11 +0200
parents 0c62e0af6af7
children a1e80d991968
line wrap: on
line diff
--- a/tests/libclient/js-color/main.cpp	Fri Apr 08 14:16:47 2016 +0200
+++ b/tests/libclient/js-color/main.cpp	Tue Apr 12 13:53:11 2016 +0200
@@ -52,7 +52,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(0, duk::getGlobal<int>(m_ctx, "r"));
@@ -76,7 +76,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(255, duk::getGlobal<int>(m_ctx, "r"));
@@ -100,7 +100,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(0, duk::getGlobal<int>(m_ctx, "r"));
@@ -124,7 +124,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(10, duk::getGlobal<int>(m_ctx, "r"));
@@ -148,7 +148,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(10, duk::getGlobal<int>(m_ctx, "r"));
@@ -172,7 +172,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(10, duk::getGlobal<int>(m_ctx, "r"));
@@ -196,7 +196,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(10, duk::getGlobal<int>(m_ctx, "r"));
@@ -223,7 +223,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(10, duk::getGlobal<int>(m_ctx, "r"));
@@ -253,7 +253,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("TypeError", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -276,7 +276,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("TypeError", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -299,7 +299,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("RangeError", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -322,7 +322,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("RangeError", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -345,7 +345,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("RangeError", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -368,7 +368,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("RangeError", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -391,7 +391,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("RangeError", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -414,7 +414,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("Error", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -437,7 +437,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("Error", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -472,7 +472,7 @@
 		auto ret = duk::pevalString(m_ctx, "draw('#ff0000');");
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(255, duk::getGlobal<int>(m_ctx, "r"));
@@ -503,7 +503,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("Error", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -532,7 +532,7 @@
 		);
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ("RangeError", duk::getGlobal<std::string>(m_ctx, "name"));
@@ -566,7 +566,7 @@
 		auto ret = duk::pevalString(m_ctx, "draw('#ff0000');");
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(255, duk::getGlobal<int>(m_ctx, "r"));
@@ -595,7 +595,7 @@
 		auto ret = duk::pevalString(m_ctx, "draw('#ghijkl');");
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(0, duk::getGlobal<int>(m_ctx, "r"));
@@ -624,7 +624,7 @@
 		auto ret = duk::pevalString(m_ctx, "draw({ red: -1, green: 256, blue: 100, alpha: 800 });");
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(0, duk::getGlobal<int>(m_ctx, "r"));
@@ -653,7 +653,7 @@
 		auto ret = duk::pevalString(m_ctx, "draw(null);");
 
 		if (ret != 0) {
-			throw duk::error(m_ctx, -1);
+			throw duk::exception(m_ctx, -1);
 		}
 
 		ASSERT_EQ(0, duk::getGlobal<int>(m_ctx, "r"));