From a585dd45aba0b9b6aa678ef840b546fe5a79ecba Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 17 Apr 2016 02:52:41 -0400 Subject: [PATCH] cout-style debugging... caaaan't wait.... --- tests.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests.cpp b/tests.cpp index 79f95883..c9d92da3 100644 --- a/tests.cpp +++ b/tests.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "test_stack_guard.hpp" struct self_test { @@ -1013,19 +1014,26 @@ TEST_CASE("utilities/this_state", "Ensure this_state argument can be gotten anyw }; sol::state lua; + std::cout << "created lua state" << std::endl; lua.open_libraries(sol::lib::base); lua.new_usertype("bark", "with_state", &bark::with_state ); + std::cout << "setting b and with_state_2" << std::endl; bark b; lua.set("b", &b); lua.set("with_state_2", bark::with_state_2); + std::cout << "finished setting" << std::endl; sol::function fx = lua["with_state_2"]; int a = fx(25, 25); + std::cout << "calling a script" << std::endl; lua.script("a = with_state_2(25, 25)"); + std::cout << "calling c script" << std::endl; lua.script("c = b:with_state(25, 25)"); + std::cout << "getting a" << std::endl; int la = lua["a"]; + std::cout << "getting b" << std::endl; int lc = lua["c"]; REQUIRE(lc == 50);