Back to index

wims  3.65+svn20090927
Static Package Functions | Static Package Attributes
org.javia.arity.TestFormat Class Reference
Collaboration diagram for org.javia.arity.TestFormat:
Collaboration graph
[legend]

List of all members.

Static Package Functions

static boolean testFormat ()
static boolean testFormat ()

Static Package Attributes

static FormatCase cases []

Detailed Description

Definition at line 135 of file UnitTest.java.


Member Function Documentation

static boolean org.javia.arity.TestFormat.testFormat ( ) [inline, static, package]

Definition at line 185 of file UnitTest.java.

                                {
        boolean ret = true;
        for (int i = 0; i < cases.length; ++i) {
            FormatCase c = cases[i];
            double v = Double.parseDouble(c.res);
            if (c.rounding == 0 && v != c.val) {
                System.out.println("wrong test? " + c.res + " " + v + " " + c.val);
            }
            String res = Util.doubleToString(c.val, c.rounding);
            if (!res.equals(c.res)) {
                System.out.println("Expected '" + c.res + "', got '" + res + "'. " + Double.toString(c.val));
                ret = false;
            }
            int nKeep = c.rounding == 0 ? 17 : 15 - c.rounding;
            //System.out.println("" + Double.toString(c.val) + " " + Util.round(c.val, nKeep) + " " + c.res + ", got " + res);
        }
        return ret;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean org.javia.arity.TestFormat.testFormat ( ) [inline, static, package]

Definition at line 185 of file UnitTest.java.

                                {
        boolean ret = true;
        for (int i = 0; i < cases.length; ++i) {
            FormatCase c = cases[i];
            double v = Double.parseDouble(c.res);
            if (c.rounding == 0 && v != c.val) {
                System.out.println("wrong test? " + c.res + " " + v + " " + c.val);
            }
            String res = Util.doubleToString(c.val, c.rounding);
            if (!res.equals(c.res)) {
                System.out.println("Expected '" + c.res + "', got '" + res + "'. " + Double.toString(c.val));
                ret = false;
            }
            int nKeep = c.rounding == 0 ? 17 : 15 - c.rounding;
            //System.out.println("" + Double.toString(c.val) + " " + Util.round(c.val, nKeep) + " " + c.res + ", got " + res);
        }
        return ret;
    }

Here is the call graph for this function:


Member Data Documentation

static FormatCase org.javia.arity.TestFormat.cases [static, package]

Definition at line 136 of file UnitTest.java.


The documentation for this class was generated from the following files: