瀏覽代碼

add unit tests for reading empty values with the client

Julius Pfrommer 7 年之前
父節點
當前提交
266a7a6909
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      tests/check_client_highlevel.c

+ 9 - 0
tests/check_client_highlevel.c

@@ -383,6 +383,15 @@ START_TEST(Node_ReadWrite)
         ck_assert_int_eq(value, 5679);
         UA_Variant_delete(val);
 
+        /* Read an empty Variable */
+        UA_Variant v;
+        UA_Variant_init(&v);
+        retval = UA_Client_writeValueAttribute(client, nodeIntId, &v);
+        ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
+
+        retval = UA_Client_readValueAttribute(client, nodeIntId, &v);
+        ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
+
         /* Write Array Dimensions */
         UA_UInt32 arrayDimsNew[] = {3};
         retval = UA_Client_writeArrayDimensionsAttribute(client, nodeArrayId, arrayDimsNew , 1);