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:
+3
-3
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user