From 78034660791148da362bce6114b7e897b13f603b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 2 May 2009 11:12:49 +0200 Subject: [PATCH] testing mathlib: Test that conversion to numbers work --- test/testmathlib.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index 4f9ed6325..d8a14ed5e 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -33,6 +33,7 @@ private: void run() { TEST_CASE(calculate); + TEST_CASE(convert); } void calculate() @@ -44,6 +45,13 @@ private: ASSERT_EQUALS(std::string("7"), MathLib::divide("21.", "3")); ASSERT_EQUALS(std::string("1"), MathLib::divide("3", "2")); } + + void convert() + { + ASSERT_EQUALS(10, MathLib::toLongNumber("0xa")); + ASSERT_EQUALS(8, MathLib::toLongNumber("010")); + ASSERT_EQUALS(10, MathLib::toLongNumber("10")); + } }; REGISTER_TEST(TestMathLib)