From ef26fa102d95abc1e4f5acc84cc12ebb8e0c5654 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sun, 9 Apr 2017 22:46:52 +0200 Subject: [PATCH] Tests for add of double and float --- .../jwebassembly/math/MathOperations.java | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/test/de/inetsoftware/jwebassembly/math/MathOperations.java b/test/de/inetsoftware/jwebassembly/math/MathOperations.java index fb74631..50a0235 100644 --- a/test/de/inetsoftware/jwebassembly/math/MathOperations.java +++ b/test/de/inetsoftware/jwebassembly/math/MathOperations.java @@ -64,8 +64,18 @@ public class MathOperations { } @Test - public void plus() { - rule.test( script, "plus", 1, 3 ); + public void addInt() { + rule.test( script, "addInt", 1, 3 ); + } + + @Test + public void addFloat() { + rule.test( script, "addFloat", 1F, 3.5F ); + } + + @Test + public void addDouble() { + rule.test( script, "addDouble", 1.0, 3.5 ); } static class TestClass { @@ -86,7 +96,17 @@ public class MathOperations { } @Export - static int plus( int a, int b ) { + static int addInt( int a, int b ) { + return a + b; + } + + @Export + static float addFloat( float a, float b ) { + return a + b; + } + + @Export + static double addDouble( double a, double b ) { return a + b; } }