From 0f284b477d6eec83a7d12dce586fe51f9c7c7115 Mon Sep 17 00:00:00 2001 From: Martin Ettl Date: Fri, 2 Apr 2010 22:18:50 +0200 Subject: [PATCH] coverage report fix: more testcases for mathlib::isInt() added in order to get a better coverage --- test/testmathlib.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index a682be854..866d242b6 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -186,6 +186,25 @@ private: ASSERT_EQUALS(false, MathLib::isInt("+1.0E-1")); ASSERT_EQUALS(false, MathLib::isInt("-1.E+1")); ASSERT_EQUALS(false, MathLib::isInt("+1.E-1")); + ASSERT_EQUALS(false, MathLib::isInt(" 1.0E+1")); + // with whitspaces in front + ASSERT_EQUALS(false, MathLib::isInt(" 1.0E-1")); + ASSERT_EQUALS(false, MathLib::isInt(" -1.0E+1")); + ASSERT_EQUALS(false, MathLib::isInt(" +1.0E-1")); + ASSERT_EQUALS(false, MathLib::isInt(" -1.E+1")); + ASSERT_EQUALS(false, MathLib::isInt(" +1.E-1")); + // with whitspaces in front and end + ASSERT_EQUALS(false, MathLib::isInt(" 1.0E-1 ")); + ASSERT_EQUALS(false, MathLib::isInt(" -1.0E+1 ")); + ASSERT_EQUALS(false, MathLib::isInt(" +1.0E-1 ")); + ASSERT_EQUALS(false, MathLib::isInt(" -1.E+1 ")); + ASSERT_EQUALS(false, MathLib::isInt(" +1.E-1 ")); + // with whitspaces in front and end + ASSERT_EQUALS(false, MathLib::isInt("1.0E-1 ")); + ASSERT_EQUALS(false, MathLib::isInt("-1.0E+1 ")); + ASSERT_EQUALS(false, MathLib::isInt("+1.0E-1 ")); + ASSERT_EQUALS(false, MathLib::isInt("-1.E+1 ")); + ASSERT_EQUALS(false, MathLib::isInt("+1.E-1 ")); } void isnegative()