Quellcode durchsuchen

Add additional test for NAN

Stefan Profanter vor 7 Jahren
Ursprung
Commit
01bb4b162c
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  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};