Some extra-strength "nothrow" requirements.

This commit is contained in:
ThePhD 2013-12-13 23:33:06 -05:00
parent 49ad128493
commit 6c06bddd6e

View File

@ -114,16 +114,16 @@ TEST_CASE("simple/callLambda", "A C++ lambda is exposed to lua and called") {
TEST_CASE("advanced/callLambdaReturns", "Checks for lambdas returning values") { TEST_CASE("advanced/callLambdaReturns", "Checks for lambdas returning values") {
sol::state lua; sol::state lua;
lua.set_function("a", [ ] { return 42; }); REQUIRE_NOTHROW(lua.set_function("a", [ ] { return 42; }));
lua.set_function("b", [ ] { return 42u; }); REQUIRE_NOTHROW(lua.set_function("b", [ ] { return 42u; }));
lua.set_function("c", [ ] { return 3.14; }); REQUIRE_NOTHROW(lua.set_function("c", [ ] { return 3.14; }));
lua.set_function("d", [ ] { return 6.28f; }); REQUIRE_NOTHROW(lua.set_function("d", [ ] { return 6.28f; }));
lua.set_function("e", [ ] { return "lol"; }); REQUIRE_NOTHROW(lua.set_function("e", [ ] { return "lol"; }));
lua.set_function("f", [ ] { return true; }); REQUIRE_NOTHROW(lua.set_function("f", [ ] { return true; }));
lua.set_function("g", [ ] { return std::string("str"); }); REQUIRE_NOTHROW(lua.set_function("g", [ ] { return std::string("str"); }));
lua.set_function("h", [ ] { }); REQUIRE_NOTHROW(lua.set_function("h", [ ] { }));
lua.set_function("i", [ ] { return sol::nil; }); REQUIRE_NOTHROW(lua.set_function("i", [ ] { return sol::nil; }));
//lua.set_function("i", [ ] { return std::make_tuple(1, 6.28f, 3.14, std::string("heh")); }); REQUIRE_NOTHROW(lua.set_function("j", [ ] { return std::make_tuple(1, 6.28f, 3.14, std::string( "heh" )); } ));
} }
TEST_CASE("advanced/callLambda2", "A C++ lambda is exposed to lua and called") { TEST_CASE("advanced/callLambda2", "A C++ lambda is exposed to lua and called") {