diff --git a/contracts/test_api/test_math.cpp b/contracts/test_api/test_math.cpp index e2e7a4766a06dc69d580388753125752333d3671..74b1093d48934f08101099a418de33b97fac87f4 100644 --- a/contracts/test_api/test_math.cpp +++ b/contracts/test_api/test_math.cpp @@ -40,7 +40,7 @@ unsigned int test_math::test_double_api() { res = double_eq( double_div( i64_to_double(5), i64_to_double(9) ), - double_div( i64_to_double(10), i64_to_double(18) ) + double_div( i64_to_double(5), i64_to_double(9) ) ); WASM_ASSERT(res == 1, "double_eq"); diff --git a/libraries/chain/wasm_interface.cpp b/libraries/chain/wasm_interface.cpp index 9f33ae4c7259474f103e0d792df5819e79480cef..7886d70b3c5ea5b46359ffff8bb3612cae1090ec 100644 --- a/libraries/chain/wasm_interface.cpp +++ b/libraries/chain/wasm_interface.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include "Platform/Platform.h" @@ -17,7 +17,7 @@ namespace eos { namespace chain { using namespace IR; using namespace Runtime; - typedef boost::multiprecision::cpp_dec_float_50 DOUBLE; + typedef boost::multiprecision::cpp_bin_float_50 DOUBLE; wasm_interface::wasm_interface() { } diff --git a/tests/api_tests/api_tests.cpp b/tests/api_tests/api_tests.cpp index 984e6b160e96aa6ee9be39983045727bb925133f..9b1cac9d6894a7728f58964428c08f657c5c6fa4 100644 --- a/tests/api_tests/api_tests.cpp +++ b/tests/api_tests/api_tests.cpp @@ -328,6 +328,11 @@ BOOST_FIXTURE_TEST_CASE(test_all, testing_fixture) BOOST_CHECK_EXCEPTION( CALL_TEST_FUNCTION( TEST_METHOD("test_math", "test_diveq_i128_by_0"), {}, {} ), fc::assert_exception, is_assert_exception ); + BOOST_CHECK_MESSAGE( CALL_TEST_FUNCTION( TEST_METHOD("test_math", "test_double_api"), {}, {} ) == WASM_TEST_PASS, "test_math::test_double_api()" ); + + BOOST_CHECK_EXCEPTION( CALL_TEST_FUNCTION( TEST_METHOD("test_math", "test_double_api_div_0"), {}, {} ), + fc::assert_exception, is_assert_exception ); + //Test db (i64) const auto& idx = chain_db.get_index();