Explorar el Código

Improve the coverage of UA_parseEndpointUrl()

Frank Meerkoetter hace 5 años
padre
commit
1f312fe111
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      tests/check_utils.c

+ 4 - 0
tests/check_utils.c

@@ -66,6 +66,10 @@ START_TEST(EndpointUrl_split) {
     ck_assert_uint_eq(port, 1234);
     ck_assert(UA_String_equal(&path, &expectedPath));
 
+    // invalid IPv6: missing ]
+    endPointUrl = UA_STRING("opc.tcp://[2001:0db8:85a3::8a2e:0370:7334");
+    ck_assert_uint_eq(UA_parseEndpointUrl(&endPointUrl, &hostname, &port, &path), UA_STATUSCODE_BADTCPENDPOINTURLINVALID);
+
     // empty hostname
     endPointUrl = UA_STRING("opc.tcp://:");
     port = 0;