Add tests for interface reference marshaling

#2746
This commit is contained in:
2026-09-14 07:00:55 +02:00
parent e5a6b73caa
commit c43cfef0a9
3 changed files with 59 additions and 3 deletions
+12 -3
View File
@@ -37,9 +37,7 @@ TEST_CASE("Scripting")
MMethod* method = klass->GetMethod("TestLibraryImports");
CHECK(method);
MObject* result = method->Invoke(nullptr, nullptr, nullptr);
CHECK(result);
int32 resultValue = MUtils::Unbox<int32>(result);
CHECK(resultValue == 0);
CHECK(MUtils::Unbox<int32>(result) == 0);
}
SECTION("Test Class")
@@ -167,4 +165,15 @@ TEST_CASE("Scripting")
CHECK(interfaceObject);
CHECK(interfaceObject == object);
}
SECTION("Test Interface Reference")
{
// Test native interface implementation
MClass* klass = Scripting::FindClass("FlaxEngine.Tests.TestScripting");
CHECK(klass);
MMethod* method = klass->GetMethod("TestInterfaceReference");
CHECK(method);
MObject* result = method->Invoke(nullptr, nullptr, nullptr);
CHECK(MUtils::Unbox<int32>(result) == 0);
}
}