Add methods to get arguments passed to function from Nasal

This commit is contained in:
Thomas Geymayer
2012-11-29 01:23:15 +01:00
parent 3391c44107
commit 2f0dfc4d74
2 changed files with 28 additions and 2 deletions
+8
View File
@@ -153,6 +153,14 @@ int main(int argc, char* argv[])
obj.set("parents", parents);
VERIFY( Ghost<BasePtr>::fromNasal(c, obj.get_naRef()) == d3 );
naRef args[] = {
to_nasal(c, std::string("test-arg"))
};
CallContext cc(c, sizeof(args)/sizeof(args[0]), args);
VERIFY( cc.require<std::string>(0) == "test-arg" );
VERIFY( cc.get<std::string>(0) == "test-arg" );
VERIFY( cc.get<std::string>(1) == "" );
// TODO actually do something with the ghosts...
naFreeContext(c);