This commit is contained in:
Myk Melez 2015-06-25 14:33:06 -07:00
Родитель 63dac16403
Коммит 38571c133d
2 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -40,7 +40,7 @@ function setNative(javaObj, nativeObj) {
}
function deleteNative(javaObj) {
NativeMap.delete(javaObj);
NativeMap.delete(javaObj._address);
}
Native["java/lang/System.arraycopy.(Ljava/lang/Object;ILjava/lang/Object;II)V"] = function(src, srcOffset, dst, dstOffset, length) {

Просмотреть файл

@ -0,0 +1,18 @@
package java.lang.ref;
import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
public class TestWeakReference implements Testlet {
public int getExpectedPass() { return 2; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
Object obj = new Object();
WeakReference weakRef = new WeakReference(obj);
th.check(weakRef.get(), obj, "weakly held referent is object");
weakRef.clear();
th.check(weakRef.get(), null, "cleared weakly held referent is null");
}
}