Package jnr.ffi

Examples of jnr.ffi.Runtime


    }

   
    @Test public void inOnlyReferenceSet() {
        TestLibInOnly lib = TstUtil.loadTestLib(TestLibInOnly.class);
        Runtime runtime = Runtime.getRuntime(lib);

        final Pointer MAGIC = Memory.allocateDirect(runtime, 123);
       
        PointerByReference ref = new PointerByReference(MAGIC);
        assertEquals("Wrong value passed", MAGIC, lib.ptr_ret_pointer(ref, 0));
View Full Code Here


        assertEquals("Wrong value passed", MAGIC, lib.ptr_ret_pointer(ref, 0));
    }

    @Test public void inOnlyIntReferenceNotWritten() {
        TestLibInOnly lib = TstUtil.loadTestLib(TestLibInOnly.class);
        Runtime runtime = Runtime.getRuntime(lib);

        final Pointer MAGIC = Memory.allocateDirect(runtime, 123);

        PointerByReference ref = new PointerByReference(MAGIC);
View Full Code Here

        assertEquals("Int reference written when it should not be", MAGIC, ref.getValue());
    }

    @Test public void outOnlyIntReferenceNotRead() {
        TestLibOutOnly lib = TstUtil.loadTestLib(TestLibOutOnly.class);
        Runtime runtime = Runtime.getRuntime(lib);

        final Pointer MAGIC = Memory.allocateDirect(runtime, 123);

        PointerByReference ref = new PointerByReference(MAGIC);
        assertNotSame("Reference value passed to native code when it should not be", MAGIC, lib.ptr_ret_pointer(ref, 0));
View Full Code Here

        assertNotSame("Reference value passed to native code when it should not be", MAGIC, lib.ptr_ret_pointer(ref, 0));
    }

    @Test public void outOnlyIntReferenceGet() {
        TestLibOutOnly lib = TstUtil.loadTestLib(TestLibOutOnly.class);
        Runtime runtime = Runtime.getRuntime(lib);

        final Pointer MAGIC = Memory.allocateDirect(runtime, 123);


        PointerByReference ref = new PointerByReference(Memory.allocateDirect(runtime, 1));
View Full Code Here

TOP

Related Classes of jnr.ffi.Runtime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.