Salome HOME
Added constants to represent job status uniformly. Fixed some errors under Windows...
[tools/libbatch.git] / src / Local / Test / Test_Local_SH.cxx
index e8e20b8f66c27411e28c6599f06c94a8dacaac9c..b5ecc1a99f84f751c4a5ec07830c775a59e2e11c 100644 (file)
@@ -102,14 +102,14 @@ int main(int argc, char** argv)
 
     // Wait for the end of the job
     string state = "Unknown";
-    for (int i=0 ; i<timeout*10 && state != "Done" ; i++) {
+    for (int i=0 ; i<timeout*10 && state != FINISHED && state != FAILED ; i++) {
       usleep(100000);
       Versatile paramState = jobid.queryJob().getParametre()["STATE"];
       state = (paramState.size() > 0) ? paramState.str() : "Unknown";
       cout << "Job state is: " << state << endl;
     }
 
-    if (state != "Done") {
+    if (state != FINISHED && state != FAILED) {
       cerr << "Error: Job not finished after timeout" << endl;
       return 1;
     }