aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc')
-rw-r--r--tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc b/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc
index b5c893c..bb2b376 100644
--- a/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc
+++ b/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc
@@ -66,15 +66,16 @@ SUITE(IcedTeaScriptableJavaObject) {
TEST(get_scriptable_java_object) {
MemoryLeakDetector leak_detector;
- /* Ensure freeing*/ {
- NPObjectRef first_obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(&dummy_npp, "DummyClass", "DummyInstance", false);
+ NPObject* first_obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(&dummy_npp, "DummyClass", "DummyInstance", false);
+ browser_functions.releaseobject(first_obj);
- /* After the first call, the object should be cached in the object map */
- NPObjectRef second_obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(&dummy_npp, "DummyClass", "DummyInstance", false);
+ /* After the first call, the object should be cached in the object map */
+ NPObject* second_obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(&dummy_npp, "DummyClass", "DummyInstance", false);
- /* Objects should be the same, because of caching */
- CHECK(first_obj.get() == second_obj.get());
- }
+ /* Objects should be the same, because of caching */
+ CHECK(first_obj == second_obj);
+
+ browser_functions.releaseobject(second_obj);
CHECK(leak_detector.memory_leaks() == 0);
}