Here you can find the source of assertEquals(float a1, float a2)
Parameter | Description |
---|---|
a1 | The first value to compare |
a2 | The second value to compare |
public static void assertEquals(float a1, float a2)
//package com.java2s; //License from project: MIT License public class Main { /**//from w ww . jav a 2 s . c o m * Ensure that the two values given are equal, if not fail the test * * @param a1 * The first value to compare * @param a2 * The second value to compare */ public static void assertEquals(float a1, float a2) { if (a1 != a2) { throw new RuntimeException("TEST FAILS: " + a1 + " should be " + a2); } } /** * Ensure that the two values given are equal, if not fail the test * * @param a1 * The first value to compare * @param a2 * The second value to compare */ public static void assertEquals(int a1, int a2) { if (a1 != a2) { throw new RuntimeException("TEST FAILS: " + a1 + " should be " + a2); } } /** * Ensure that the two values given are equal, if not fail the test * * @param a1 * The first value to compare * @param a2 * The second value to compare */ public static void assertEquals(Object a1, Object a2) { if (!a1.equals(a2)) { throw new RuntimeException("TEST FAILS: " + a1 + " should be " + a2); } } }