diff UnitTestsSources/UnitTestsMain.cpp @ 2646:740983056f9e jobs

StringToJobState
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 31 May 2018 17:30:22 +0200
parents 9f325c631973
children 0d8b753317b2
line wrap: on
line diff
--- a/UnitTestsSources/UnitTestsMain.cpp	Wed May 30 10:50:57 2018 +0200
+++ b/UnitTestsSources/UnitTestsMain.cpp	Thu May 31 17:30:22 2018 +0200
@@ -677,6 +677,14 @@
   }
 
   ASSERT_THROW(StringToValueRepresentation("nope", true), OrthancException);
+
+  ASSERT_EQ(JobState_Pending, StringToJobState(EnumerationToString(JobState_Pending)));
+  ASSERT_EQ(JobState_Running, StringToJobState(EnumerationToString(JobState_Running)));
+  ASSERT_EQ(JobState_Success, StringToJobState(EnumerationToString(JobState_Success)));
+  ASSERT_EQ(JobState_Failure, StringToJobState(EnumerationToString(JobState_Failure)));
+  ASSERT_EQ(JobState_Paused, StringToJobState(EnumerationToString(JobState_Paused)));
+  ASSERT_EQ(JobState_Retry, StringToJobState(EnumerationToString(JobState_Retry)));
+  ASSERT_THROW(StringToJobState("nope"), OrthancException);
 }