JML

org.jmlspecs.samples.dbc
Class ComplexTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.jmlspecs.samples.dbc.ComplexTest
All Implemented Interfaces:
junit.framework.Test

public strictfp class ComplexTest
extends junit.framework.TestCase

Test for the complex number types.


Class Specifications

Specifications inherited from class Object
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this);

Model Field Summary
 
Model fields inherited from class java.lang.Object
_getClass, objectState, theString
 
Ghost Field Summary
 
Ghost fields inherited from class java.lang.Object
objectTimesFinalized, owner
 
Field Summary
private  Complex[] receivers
           
private static double tolerance
           
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
ComplexTest(String name)
          Constructor for ComplexTest.
 
Model Method Summary
 
Model methods inherited from class java.lang.Object
hashValue
 
Method Summary
protected  void approximatelyEquals(double d1, double d2)
          Check that either the numbers are equal, or StrictMath.abs(d1-d2) <= StrictMath.max(StrictMath.abs(d1), StrictMath.abs(d2))*tolerance.
protected  void approximatelyEquals(String msg, double d1, double d2)
          Check that either the numbers are equal, or StrictMath.abs(d1-d2) <= StrictMath.max(StrictMath.abs(d1), StrictMath.abs(d2))*tolerance.
static void main(String[] args)
           
protected  void setUp()
          Initalize the receivers array.
 void testAdd()
          Test the method add.
 void testAngle()
          Test the method angle.
 void testDiv()
          Test the method div.
 void testEquals()
          Test the method equals.
 void testHashCode()
          Test the method hashCode.
 void testImaginaryPart()
          Test the method imaginaryPart.
 void testMagnitude()
          Test the method magnitude.
 void testMul()
          Test the method mul.
 void testRealPart()
          Test the method realPart.
 void testStandardizeAngle()
          Test the method Polar.standardizeAngle.
 void testSub()
          Test the method sub.
 void testToString()
          Test the method toString.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tolerance

private static final double tolerance

receivers

private Complex[] receivers
Constructor Detail

ComplexTest

public ComplexTest(String name)
Constructor for ComplexTest.

Parameters:
name -
Method Detail

main

public static void main(String[] args)

approximatelyEquals

protected void approximatelyEquals(double d1,
                                   double d2)
Check that either the numbers are equal, or StrictMath.abs(d1-d2) <= StrictMath.max(StrictMath.abs(d1), StrictMath.abs(d2))*tolerance.


approximatelyEquals

protected void approximatelyEquals(String msg,
                                   double d1,
                                   double d2)
Check that either the numbers are equal, or StrictMath.abs(d1-d2) <= StrictMath.max(StrictMath.abs(d1), StrictMath.abs(d2))*tolerance.


setUp

protected void setUp()
              throws Exception
Initalize the receivers array.

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

testStandardizeAngle

public void testStandardizeAngle()
Test the method Polar.standardizeAngle.


testRealPart

public void testRealPart()
Test the method realPart.


testImaginaryPart

public void testImaginaryPart()
Test the method imaginaryPart.


testMagnitude

public void testMagnitude()
Test the method magnitude.


testAngle

public void testAngle()
Test the method angle.


testAdd

public void testAdd()
Test the method add.


testSub

public void testSub()
Test the method sub.


testMul

public void testMul()
Test the method mul.


testDiv

public void testDiv()
Test the method div.


testEquals

public void testEquals()
Test the method equals.


testHashCode

public void testHashCode()
Test the method hashCode.


testToString

public void testToString()
Test the method toString.


JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.