use of org.mozilla.jss.asn1.INTEGER in project packages-jpl by SWI-Prolog.
the class TestJUnit method testWouter1.
public void testWouter1() {
// Wouter says this fails under OS X Mavericks
// 10.9 x86-64
// too big for an int
long n = 7381783232223l;
Compound term = new Compound("is", new Term[] { new Variable("X"), new org.jpl7.Integer(n) });
Map<String, Term>[] solutions = new Query(term).allSolutions();
assertEquals(1, solutions.length);
Map<String, Term> solution = solutions[0];
assertTrue(solution.containsKey("X"));
Object result = solution.get("X");
assertTrue(result instanceof org.jpl7.Integer);
assertEquals(n, ((org.jpl7.Integer) result).longValue());
}
use of org.mozilla.jss.asn1.INTEGER in project packages-jpl by SWI-Prolog.
the class TestJUnit method testLength1.
public void testLength1() {
Query q5 = new Query(new Compound("length", new Term[] { new Variable("Zs"), new org.jpl7.Integer(2) }));
Term zs = q5.oneSolution().get("Zs");
assertTrue("length(Zs,2) binds Zs to a list of two distinct variables " + zs.toString(), zs.isListPair() && zs.arg(1).isVariable() && zs.arg(2).isListPair() && zs.arg(2).arg(1).isVariable() && zs.arg(2).arg(2).isListNil() && !zs.arg(1).name().equals(zs.arg(2).arg(1).name()));
}
use of org.mozilla.jss.asn1.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);
}
use of org.mozilla.jss.asn1.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());
}
use of org.mozilla.jss.asn1.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);
}
Aggregations