Sfoglia il codice sorgente

fix tests for release builds

Julius Pfrommer 10 anni fa
parent
commit
f5808b5053
3 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 4 0
      src/ua_types_encoding_binary.c
  2. 1 1
      tests/check_builtin.c
  3. 1 1
      tests/check_memory.c

+ 4 - 0
src/ua_types_encoding_binary.c

@@ -855,6 +855,10 @@ UA_StatusCode UA_Variant_decodeBinary(UA_ByteString const *src, UA_UInt32 *offse
         if(UA_TYPES_IDS[typeIndex] == typeid.identifier.numeric)
             break;
     }
+
+    if(typeIndex >= UA_TYPES_COUNT)
+        return UA_STATUSCODE_BADDECODINGERROR;
+
     const UA_DataType *dataType = &UA_TYPES[typeIndex];
 
     if(!isArray) {

+ 1 - 1
tests/check_builtin.c

@@ -1776,4 +1776,4 @@ int main(void) {
 	srunner_free(sr);
 
 	return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+}

+ 1 - 1
tests/check_memory.c

@@ -193,7 +193,7 @@ int main(void) {
 	suite_add_tcase(s, tc);
 
 	sr = srunner_create(s);
-	srunner_set_fork_status(sr, CK_NOFORK);
+	//srunner_set_fork_status(sr, CK_NOFORK);
 	srunner_run_all (sr, CK_NORMAL);
 	number_failed += srunner_ntests_failed(sr);
 	srunner_free(sr);