Fix test so that it does fail in "nightly-build" or "release" versions. 70/13270/4
Vincent COUVERT [Thu, 28 Nov 2013 16:17:21 +0000 (17:17 +0100)]
Change-Id: I497762967f266e03ce340a8fde4848299714c1b8
Test: test_run hdf5 h5readattr

scilab/modules/hdf5/tests/unit_tests/h5readattr.dia.ref
scilab/modules/hdf5/tests/unit_tests/h5readattr.tst

index f47e164..cd7b14b 100644 (file)
@@ -20,10 +20,15 @@ msgerr = msprintf(gettext("%s: %s\n"), "h5readattr", msprintf(gettext("Invalid h
 assert_checkerror("h5readattr(""42"",""42"",""42"")",msgerr,999);
 x = int8(matrix(1:80, 10, 8));
 save(TMPDIR + "/x.sod", "x");
-version = string(getversion('scilab'));
-version = getversion()+" "+strcat([version(1),version(2),version(3)],'.');
 a = h5open(TMPDIR + "/x.sod");
 scilab_version = h5readattr(a, "/", "SCILAB_scilab_version");
+version = getversion();
+if ~isempty(strindex(version, "branch")) then // compiled by user
+    version = string(getversion("scilab"));
+    version = getversion()+" "+strcat([version(1),version(2),version(3)],".");
+else // compiled by compilation chain
+    version = getversion();
+end
 assert_checkequal(scilab_version,version);
 scilab_class = h5readattr(a.root.x, "SCILAB_Class");
 assert_checkequal(scilab_class,"integer");
index 329eed6..ee6f28c 100644 (file)
@@ -22,12 +22,17 @@ assert_checkerror("h5readattr(""42"",""42"",""42"")",msgerr,999);
 
 x = int8(matrix(1:80, 10, 8));
 save(TMPDIR + "/x.sod", "x");
-version = string(getversion('scilab'));
-version = getversion()+" "+strcat([version(1),version(2),version(3)],'.');
 
 a = h5open(TMPDIR + "/x.sod");
-
 scilab_version = h5readattr(a, "/", "SCILAB_scilab_version");
+
+version = getversion();
+if ~isempty(strindex(version, "branch")) then // compiled by user
+    version = string(getversion("scilab"));
+    version = getversion()+" "+strcat([version(1),version(2),version(3)],".");
+else // compiled by compilation chain
+    version = getversion();
+end
 assert_checkequal(scilab_version,version);
 
 scilab_class = h5readattr(a.root.x, "SCILAB_Class");