01: /*
02: * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18: package test.org.mandarax.lib.math;
19:
20: import org.mandarax.kernel.Fact;
21: import org.mandarax.lib.math.DoubleArithmetic;
22:
23: /**
24: * Test case for double arithmetic.<br>
25: * <em>tested predicate(s): </em>DoubleArithmetic.INCLUSIVE_BETWEEN<br>
26: * <em>tested function(s): </em>-<br>
27: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
28: * @version 3.4 <7 March 05>
29: * @since 1.6
30: */
31: public class DoubleArithmeticTest8 extends DoubleArithmeticTest {
32:
33: /**
34: * Constructor.
35: */
36: public DoubleArithmeticTest8() {
37: super ();
38: }
39:
40: /**
41: * Get the expected number of generated facts.
42: * @return the number of facts expected
43: */
44: protected int getExpected() {
45: return 20;
46: }
47:
48: /**
49: * Get the query fact.
50: * @return a query fact.
51: */
52: protected Fact getQueryFact() {
53: return buildFact(DoubleArithmetic.INCLUSIVE_BETWEEN, "x", "y",
54: "z");
55: }
56:
57: /**
58: * Get the set of numbers used for testing.
59: * @return an array of doublews
60: */
61: protected double[] getTestSet() {
62: double[] array = { 0, 0.1, 0.2, 0.3 };
63:
64: return array;
65: }
66: }
|