org.junit.Assert.doubleIsDifferent()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(12.3k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.junit.Assert.doubleIsDifferent()方法的一些代码示例,展示了Assert.doubleIsDifferent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.doubleIsDifferent()方法的具体详情如下:
包路径:org.junit.Assert
类名称:Assert
方法名:doubleIsDifferent

Assert.doubleIsDifferent介绍

暂无

代码示例

代码示例来源:origin: junit-team/junit4

/**
 * Asserts that two doubles are <b>not</b> equal to within a positive delta.
 * If they are, an {@link AssertionError} is thrown with the given
 * message. If the unexpected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param unexpected unexpected value
 * @param actual the value to check against <code>unexpected</code>
 * @param delta the maximum delta between <code>unexpected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
public static void assertNotEquals(String message, double unexpected,
    double actual, double delta) {
  if (!doubleIsDifferent(unexpected, actual, delta)) {
    failEquals(message, Double.valueOf(actual));
  }
}

代码示例来源:origin: junit-team/junit4

/**
 * Asserts that two doubles are equal to within a positive delta.
 * If they are not, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertEquals(Double.NaN, Double.NaN, *)</code> passes
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param expected expected value
 * @param actual the value to check against <code>expected</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
public static void assertEquals(String message, double expected,
    double actual, double delta) {
  if (doubleIsDifferent(expected, actual, delta)) {
    failNotEquals(message, Double.valueOf(expected), Double.valueOf(actual));
  }
}

代码示例来源:origin: google/j2objc

/**
 * Asserts that two doubles or floats are <b>not</b> equal to within a positive delta.
 * If they are, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param first first value to check
 * @param second the value to check against <code>first</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertNotEquals(String message, double first,
    double second, double delta) {
  if (!doubleIsDifferent(first, second, delta)) {
    failEquals(message, new Double(first));
  }
}

代码示例来源:origin: google/j2objc

/**
 * Asserts that two doubles are equal to within a positive delta.
 * If they are not, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertEquals(Double.NaN, Double.NaN, *)</code> passes
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param expected expected value
 * @param actual the value to check against <code>expected</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertEquals(String message, double expected,
    double actual, double delta) {
  if (doubleIsDifferent(expected, actual, delta)) {
    failNotEquals(message, new Double(expected), new Double(actual));
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Asserts that two doubles or floats are <b>not</b> equal to within a positive delta.
 * If they are, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param first first value to check
 * @param second the value to check against <code>first</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertNotEquals(String message, double first,
    double second, double delta) {
  if (!doubleIsDifferent(first, second, delta)) {
    failEquals(message, new Double(first));
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Asserts that two doubles are equal to within a positive delta.
 * If they are not, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertEquals(Double.NaN, Double.NaN, *)</code> passes
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param expected expected value
 * @param actual the value to check against <code>expected</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertEquals(String message, double expected,
    double actual, double delta) {
  if (doubleIsDifferent(expected, actual, delta)) {
    failNotEquals(message, new Double(expected), new Double(actual));
  }
}

代码示例来源:origin: org.junit/com.springsource.org.junit

/**
 * Asserts that two doubles or floats are <b>not</b> equal to within a positive delta.
 * If they are, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param first first value to check
 * @param second the value to check against <code>first</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertNotEquals(String message, double first,
    double second, double delta) {
  if (!doubleIsDifferent(first, second, delta)) {
    failEquals(message, new Double(first));
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit

/**
 * Asserts that two doubles are equal to within a positive delta.
 * If they are not, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertEquals(Double.NaN, Double.NaN, *)</code> passes
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param expected expected value
 * @param actual the value to check against <code>expected</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertEquals(String message, double expected,
    double actual, double delta) {
  if (doubleIsDifferent(expected, actual, delta)) {
    failNotEquals(message, Double.valueOf(expected), Double.valueOf(actual));
  }
}

代码示例来源:origin: com.oracle/truffle-tck

/**
 * Asserts that two doubles are equal to within a positive delta.
 * If they are not, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertEquals(Double.NaN, Double.NaN, *)</code> passes
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param expected expected value
 * @param actual the value to check against <code>expected</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertEquals(String message, double expected,
    double actual, double delta) {
  if (doubleIsDifferent(expected, actual, delta)) {
    failNotEquals(message, new Double(expected), new Double(actual));
  }
}

代码示例来源:origin: org.junit/com.springsource.org.junit

/**
 * Asserts that two doubles are equal to within a positive delta.
 * If they are not, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertEquals(Double.NaN, Double.NaN, *)</code> passes
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param expected expected value
 * @param actual the value to check against <code>expected</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertEquals(String message, double expected,
    double actual, double delta) {
  if (doubleIsDifferent(expected, actual, delta)) {
    failNotEquals(message, new Double(expected), new Double(actual));
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Asserts that two doubles are equal to within a positive delta.
 * If they are not, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertEquals(Double.NaN, Double.NaN, *)</code> passes
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param expected expected value
 * @param actual the value to check against <code>expected</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertEquals(String message, double expected,
    double actual, double delta) {
  if (doubleIsDifferent(expected, actual, delta)) {
    failNotEquals(message, Double.valueOf(expected), Double.valueOf(actual));
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit

/**
 * Asserts that two doubles are <b>not</b> equal to within a positive delta.
 * If they are, an {@link AssertionError} is thrown with the given
 * message. If the unexpected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param unexpected unexpected value
 * @param actual the value to check against <code>unexpected</code>
 * @param delta the maximum delta between <code>unexpected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertNotEquals(String message, double unexpected,
    double actual, double delta) {
  if (!doubleIsDifferent(unexpected, actual, delta)) {
    failEquals(message, Double.valueOf(actual));
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Asserts that two doubles are <b>not</b> equal to within a positive delta.
 * If they are, an {@link AssertionError} is thrown with the given
 * message. If the unexpected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param unexpected unexpected value
 * @param actual the value to check against <code>unexpected</code>
 * @param delta the maximum delta between <code>unexpected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertNotEquals(String message, double unexpected,
    double actual, double delta) {
  if (!doubleIsDifferent(unexpected, actual, delta)) {
    failEquals(message, Double.valueOf(actual));
  }
}

代码示例来源:origin: com.oracle/truffle-tck

/**
 * Asserts that two doubles or floats are <b>not</b> equal to within a positive delta.
 * If they are, an {@link AssertionError} is thrown with the given
 * message. If the expected value is infinity then the delta value is
 * ignored. NaNs are considered equal:
 * <code>assertNotEquals(Double.NaN, Double.NaN, *)</code> fails
 *
 * @param message the identifying message for the {@link AssertionError} (<code>null</code>
 * okay)
 * @param first first value to check
 * @param second the value to check against <code>first</code>
 * @param delta the maximum delta between <code>expected</code> and
 * <code>actual</code> for which both numbers are still
 * considered equal.
 */
static public void assertNotEquals(String message, double first,
    double second, double delta) {
  if (!doubleIsDifferent(first, second, delta)) {
    failEquals(message, new Double(first));
  }
}

相关文章