Better embedding API support (and tests!) for strings with null bytes.

- Test that a foreign method can return strings.
- Test that a foreign method can return a string with null bytes.
- Test wrenCall().
- Allow passing NULL for "v" to wrenCall().
- Allow "a" for passing an explicit length byte array to wrenCall().
This commit is contained in:
Bob Nystrom
2015-09-24 08:02:31 -07:00
parent a944ead5b4
commit f757c9efac
11 changed files with 159 additions and 14 deletions
+3 -3
View File
@@ -172,7 +172,7 @@ static void initVM()
static void freeVM()
{
schedulerReleaseMethods();
uv_loop_close(loop);
free(loop);
@@ -259,8 +259,8 @@ uv_loop_t* getLoop()
return loop;
}
void setForeignCallbacks(
WrenBindForeignMethodFn bindMethod, WrenBindForeignClassFn bindClass)
void setTestCallbacks(WrenBindForeignMethodFn bindMethod,
WrenBindForeignClassFn bindClass)
{
bindMethodFn = bindMethod;
bindClassFn = bindClass;
+2 -2
View File
@@ -22,7 +22,7 @@ uv_loop_t* getLoop();
//
// Used by the API test executable to let it wire up its own foreign functions.
// This must be called before calling [createVM()].
void setForeignCallbacks(WrenBindForeignMethodFn bindMethod,
WrenBindForeignClassFn bindClass);
void setTestCallbacks(WrenBindForeignMethodFn bindMethod,
WrenBindForeignClassFn bindClass);
#endif