diff UnitTestsSources/UnitTestsMain.cpp @ 1102:ce6386b37afd

avoid unnecessary exceptions on Orthanc startup
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 Aug 2014 10:51:35 +0200
parents e494ceb8d763
children 6e7e5ed91c2d
line wrap: on
line diff
--- a/UnitTestsSources/UnitTestsMain.cpp	Thu Aug 07 10:21:43 2014 +0200
+++ b/UnitTestsSources/UnitTestsMain.cpp	Thu Aug 07 10:51:35 2014 +0200
@@ -729,6 +729,19 @@
 #endif
 
 
+TEST(Toolbox, IsInteger)
+{
+  ASSERT_TRUE(Toolbox::IsInteger("00236"));
+  ASSERT_TRUE(Toolbox::IsInteger("-0042"));
+  ASSERT_TRUE(Toolbox::IsInteger("0"));
+  ASSERT_TRUE(Toolbox::IsInteger("-0"));
+
+  ASSERT_FALSE(Toolbox::IsInteger(""));
+  ASSERT_FALSE(Toolbox::IsInteger("42a"));
+  ASSERT_FALSE(Toolbox::IsInteger("42-"));
+}
+
+
 int main(int argc, char **argv)
 {
   // Initialize Google's logging library.