Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java @ 22547:c3a7ad415a8a
Improving formating
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Thu, 14 Jan 2016 14:13:20 +0100 |
parents | e77bcc4e4af6 |
children | 6b76a24fffbd |
comparison
equal
deleted
inserted
replaced
22546:e77bcc4e4af6 | 22547:c3a7ad415a8a |
---|---|
356 */ | 356 */ |
357 protected String valuesObject() { | 357 protected String valuesObject() { |
358 throw new UnsupportedOperationException("valuesObject() method not implemented"); | 358 throw new UnsupportedOperationException("valuesObject() method not implemented"); |
359 } | 359 } |
360 | 360 |
361 /** Assert two double values are the same. Various languages may have different | 361 /** |
362 * semantics with respect to double numbers. Some of the language may not | 362 * Assert two double values are the same. Various languages may have different semantics with |
363 * support <b>double</b> or <b>float</b> values at all. Those languages | 363 * respect to double numbers. Some of the language may not support <b>double</b> or <b>float</b> |
364 * may override this method and compare the values with as much precision | 364 * values at all. Those languages may override this method and compare the values with as much |
365 * as they like. | 365 * precision as they like. |
366 * <p> | 366 * <p> |
367 * Default implementation of this method calls | 367 * Default implementation of this method calls |
368 * {@link Assert#assertEquals(java.lang.String, double, double, double)} | 368 * {@link Assert#assertEquals(java.lang.String, double, double, double)} with delta |
369 * with delta <code>0.1</code>. | 369 * <code>0.1</code>. |
370 * | 370 * |
371 * @param msg assertion message to display in case of error | 371 * @param msg assertion message to display in case of error |
372 * @param expectedValue the value expected by the test | 372 * @param expectedValue the value expected by the test |
373 * @param actualValue the real value produced by the language | 373 * @param actualValue the real value produced by the language |
374 * @throws AssertionError if the values are different according to the language semantics | 374 * @throws AssertionError if the values are different according to the language semantics |
554 private void doPlusWithFloat(float a, float b) throws Exception { | 554 private void doPlusWithFloat(float a, float b) throws Exception { |
555 PolyglotEngine.Value plus = findGlobalSymbol(plus(float.class, float.class)); | 555 PolyglotEngine.Value plus = findGlobalSymbol(plus(float.class, float.class)); |
556 | 556 |
557 Number n = plus.execute(a, b).as(Number.class); | 557 Number n = plus.execute(a, b).as(Number.class); |
558 assertDouble("Correct value computed: (" + a + " + " + b + ")", a + b, n.floatValue()); | 558 assertDouble("Correct value computed: (" + a + " + " + b + ")", a + b, n.floatValue()); |
559 } | 559 } |
560 | 560 |
561 @Test | 561 @Test |
562 public void testPlusWithDouble() throws Exception { | 562 public void testPlusWithDouble() throws Exception { |
563 double a = RANDOM.nextDouble() * 100.0; | 563 double a = RANDOM.nextDouble() * 100.0; |
564 double b = RANDOM.nextDouble() * 100.0; | 564 double b = RANDOM.nextDouble() * 100.0; |