浏览代码

Add additional test for NAN

Stefan Profanter 7 年之前
父节点
当前提交
01bb4b162c
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      tests/check_types_builtin.c

+ 5 - 1
tests/check_types_builtin.c

@@ -804,12 +804,16 @@ START_TEST(UA_Float_encodeShallWorkOnExample) {
         {0x00, 0x00, 0xD0, 0xC0}, // -6.5
         {0x00, 0x00, 0x00, 0x00}, // 0.0
         {0x00, 0x00, 0x00, 0x80}, // -0.0
-        {0x00, 0x00, 0xC0, 0xFF}, // NAN
+        {0x00, 0x00, 0xC0, 0xFF}, // -NAN
         {0xFF, 0xFF, 0x7F, 0x7F}, // FLT_MAX
         {0x00, 0x00, 0x80, 0x00}, // FLT_MIN
         {0x00, 0x00, 0x80, 0x7F}, // INF
         {0x00, 0x00, 0x80, 0xFF} // -INF
     };
+#ifdef _WIN32
+    // on WIN32 -NAN is encoded differently
+    result[4][3] = 127;
+#endif
 
     UA_Byte data[] = {0x55, 0x55, 0x55,  0x55};
     UA_ByteString dst = {4, data};