diff tests/libcommon/js-elapsed-timer/main.cpp @ 63:96ba0c5cf893

Misc: update duktape.hpp to new style
author David Demelier <markand@malikania.fr>
date Fri, 16 Dec 2016 16:11:24 +0100
parents f30c84b4b9ed
children 858621081b95
line wrap: on
line diff
--- a/tests/libcommon/js-elapsed-timer/main.cpp	Fri Dec 16 15:38:45 2016 +0100
+++ b/tests/libcommon/js-elapsed-timer/main.cpp	Fri Dec 16 16:11:24 2016 +0100
@@ -37,7 +37,7 @@
 
 class test_elapsed_timer {
 protected:
-    UniqueContext m_ctx;
+    dukx_context m_ctx;
 
     test_elapsed_timer()
     {
@@ -61,13 +61,13 @@
 {
     try {
         if (duk_peval_string(m_ctx, "timer = new Malikania.ElapsedTimer();") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         std::this_thread::sleep_for(300ms);
 
         if (duk_peval_string(m_ctx, "result = timer.elapsed();") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         duk_get_global_string(m_ctx, "result");
@@ -82,13 +82,13 @@
 {
     try {
         if (duk_peval_string(m_ctx, "timer = new Malikania.ElapsedTimer();") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         std::this_thread::sleep_for(300ms);
 
         if (duk_peval_string(m_ctx, "timer.reset(); result = timer.elapsed();") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         duk_get_global_string(m_ctx, "result");
@@ -103,7 +103,7 @@
 {
     try {
         if (duk_peval_string(m_ctx, "timer = new Malikania.ElapsedTimer();") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         /*
@@ -117,19 +117,19 @@
         std::this_thread::sleep_for(10ms);
 
         if (duk_peval_string(m_ctx, "timer.pause();") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         std::this_thread::sleep_for(5ms);
 
         if (duk_peval_string(m_ctx, "timer.restart();") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         std::this_thread::sleep_for(6ms);
 
         if (duk_peval_string(m_ctx, "result = timer.elapsed()") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         duk_get_global_string(m_ctx, "result");
@@ -144,19 +144,19 @@
 {
     try {
         if (duk_peval_string(m_ctx, "timer = new Malikania.ElapsedTimer();") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         std::this_thread::sleep_for(50ms);
 
         if (duk_peval_string(m_ctx, "result = timer.elapsed()") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         std::this_thread::sleep_for(50ms);
 
         if (duk_peval_string(m_ctx, "result = timer.elapsed()") != 0) {
-            throw dukx_exception(m_ctx, -1);
+            throw dukx_get_exception(m_ctx, -1);
         }
 
         duk_get_global_string(m_ctx, "result");