aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cpp-unit-tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpp-unit-tests')
-rw-r--r--tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc b/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc
index 0827570..9de0bbd 100644
--- a/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc
+++ b/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc
@@ -53,13 +53,6 @@ SUITE(IcedTeaScriptablePluginObject) {
delete obj;
CHECK(leak_detector.memory_leaks() == 0);
}
-
- TEST(get_scriptable_java_object) {
- MemoryLeakDetector leak_detector;
- NPObject* obj = IcedTeaScriptablePluginObject::get_scriptable_java_package_object(&dummy_npp, "DummyPackage");
- browser_functions.releaseobject(obj);
- CHECK(leak_detector.memory_leaks() == 0);
- }
}
SUITE(IcedTeaScriptableJavaObject) {
@@ -69,24 +62,15 @@ SUITE(IcedTeaScriptableJavaObject) {
IcedTeaScriptableJavaObject::deAllocate(obj);
CHECK(leak_detector.memory_leaks() == 0);
}
-}
-
-SUITE(IcedTeaScriptableJavaPackageObject) {
- TEST(deallocate) {
- MemoryLeakDetector leak_detector;
- IcedTeaScriptableJavaPackageObject* obj = new IcedTeaScriptableJavaPackageObject(&dummy_npp);
- IcedTeaScriptableJavaPackageObject::deAllocate(obj);
- CHECK(leak_detector.memory_leaks() == 0);
- }
TEST(get_scriptable_java_object) {
MemoryLeakDetector leak_detector;
- NPObject* first_obj = IcedTeaScriptableJavaPackageObject::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 */
- NPObject* second_obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(&dummy_npp, "DummyClass", "DummyInstance", false);
+ NPObject* second_obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(&dummy_npp, "DummyClass", "DummyInstance", false);
/* Objects should be the same, because of caching */
CHECK(first_obj == second_obj);
@@ -96,3 +80,19 @@ SUITE(IcedTeaScriptableJavaPackageObject) {
CHECK(leak_detector.memory_leaks() == 0);
}
}
+
+SUITE(IcedTeaScriptableJavaPackageObject) {
+ TEST(deallocate) {
+ MemoryLeakDetector leak_detector;
+ IcedTeaScriptableJavaPackageObject* obj = new IcedTeaScriptableJavaPackageObject(&dummy_npp);
+ IcedTeaScriptableJavaPackageObject::deAllocate(obj);
+ CHECK(leak_detector.memory_leaks() == 0);
+ }
+
+ TEST(get_scriptable_java_object) {
+ MemoryLeakDetector leak_detector;
+ NPObject* obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_package_object(&dummy_npp, "DummyPackage");
+ browser_functions.releaseobject(obj);
+ CHECK(leak_detector.memory_leaks() == 0);
+ }
+}