Search in sources :

Example 36 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer in project packages-jpl by SWI-Prolog.

the class TestJUnit method testIntegerFromChar1.

public void testIntegerFromChar1() {
    // 0..65535
    char c = (char) 64;
    // System.out.println("c = " + c);
    Integer i = new Integer(c);
    assertTrue(i.intValue() == c);
}
Also used : Integer(org.jpl7.Integer) BigInteger(java.math.BigInteger)

Example 37 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer in project packages-jpl by SWI-Prolog.

the class TestOLD method main.

public static void main(String[] argv) {
    Prolog.set_default_init_args(new String[] { "libpl.dll", "-f", "none", "-g", "set_prolog_flag(debug_on_error,false)", "-q" });
    System.err.println("tag = " + Prolog.object_to_tag(new Query("hello")));
    test10k();
    test10();
    // test10h();
    // test10i();
    test10j();
    test10k();
    test10l();
    test10m();
    // test10n();
    test10o();
    // test10p();
    test10q();
    // test10r();
    // test10s();
    // test10t();
    // test10u();
    // test10v();
    String s = new String("" + '\0' + '\377');
    System.err.println("s.length = " + s.length());
    for (int i = 0; i < s.length(); i++) {
        System.err.print((new Integer(s.charAt(i))).toString() + " ");
    }
    System.err.println();
    System.err.println(new Query("atom_codes(A,[127,128,255,0])").oneSolution().toString());
}
Also used : Integer(org.jpl7.Integer) Query(org.jpl7.Query)

Example 38 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer in project packages-jpl by SWI-Prolog.

the class Test_Integer method testIntegerFromChar1.

@Test
public void testIntegerFromChar1() {
    // 0..65535
    char c = (char) 64;
    // System.out.println("c = " + c);
    Integer i = new Integer(c);
    assertEquals(i.intValue(), c);
}
Also used : Integer(org.jpl7.Integer) BigInteger(java.math.BigInteger) Test(org.junit.Test)

Example 39 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer in project packages-jpl by SWI-Prolog.

the class Test_List method testIsPairList2.

@Test
public void testIsPairList2() {
    Term t = new Compound(JPL.LIST_PAIR, new Term[] { new Integer(1), new Integer(2) });
    String msg = String.format("term %s should be a pair list", t.toString());
    assertTrue(msg, t.isListPair());
    assertEquals("[1, 2]", t.toString());
}
Also used : Integer(org.jpl7.Integer) Test(org.junit.Test)

Example 40 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer in project packages-jpl by SWI-Prolog.

the class Test_Dict method test_dict1.

// /////////////////////////////////////////////////////////////////////////////
// SUPPORTING CODE
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
// TESTS
// /////////////////////////////////////////////////////////////////////////////
@Test
public void test_dict1() {
    Map<Atom, Term> map = new HashMap<Atom, Term>();
    map.put(new Atom("x"), new org.jpl7.Integer(12));
    map.put(new Atom("y"), new org.jpl7.Integer(23));
    map.put(new Atom("z"), new Integer(312));
    Dict dict = new Dict(new Atom("location"), map);
    assertEquals("location{x:12, z:312, y:23}", dict.toString());
    assertEquals(Prolog.DICT, dict.type());
}
Also used : org.jpl7(org.jpl7) Integer(org.jpl7.Integer) HashMap(java.util.HashMap) Integer(org.jpl7.Integer) Test(org.junit.Test)

Aggregations

Integer (org.jpl7.Integer)19 INTEGER (org.mozilla.jss.asn1.INTEGER)15 BigInteger (java.math.BigInteger)11 Test (org.junit.Test)10 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer)9 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column)8 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Bigint (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Bigint)7 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean)7 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Char (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Char)7 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Decimal (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Decimal)7 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Double (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Double)7 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Float (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Float)7 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Smallint (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Smallint)7 Map (java.util.Map)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Binary (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Binary)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Blob (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Blob)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Clob (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Clob)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Date (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Date)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Datetime (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Datetime)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Time (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Time)6