today is not a good day

This commit is contained in:
ThePhD 2016-04-17 02:59:09 -04:00
parent a585dd45ab
commit 4fb5edab59

View File

@ -1007,7 +1007,9 @@ TEST_CASE("utilities/this_state", "Ensure this_state argument can be gotten anyw
}
static int with_state_2(int a, sol::this_state l, int b) {
std::cout << "inside with_state_2" << std::endl;
lua_State* L = l;
std::cout << "L is" << (void*)L << std::endl;
int c = lua_gettop(L);
return a * b + (c - c);
}
@ -1025,8 +1027,11 @@ TEST_CASE("utilities/this_state", "Ensure this_state argument can be gotten anyw
lua.set("b", &b);
lua.set("with_state_2", bark::with_state_2);
std::cout << "finished setting" << std::endl;
std::cout << "getting fx" << std::endl;
sol::function fx = lua["with_state_2"];
std::cout << "calling fx" << std::endl;
int a = fx(25, 25);
std::cout << "finished setting fx" << std::endl;
std::cout << "calling a script" << std::endl;
lua.script("a = with_state_2(25, 25)");
std::cout << "calling c script" << std::endl;