Package: nodejs / 0.10.29~dfsg-2

1004_test_writeNaN.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Description: fix test that fails on mipsel to write NaN to buffer.
Forwarded: https://github.com/joyent/node/commit/61935bc1
Author: Jérémy Lal <kapouer@melix.org>
Last-Update: 2013-08-14
--- a/test/simple/test-writedouble.js
+++ b/test/simple/test-writedouble.js
@@ -171,20 +171,22 @@
   // Darwin ia32 does the other kind of NaN.
   // Compiler bug.  No one really cares.
   ASSERT(0x7F === buffer[0] || 0xFF === buffer[0]);
-  ASSERT.equal(0xF8, buffer[1]);
-  ASSERT.equal(0x00, buffer[2]);
-  ASSERT.equal(0x00, buffer[3]);
-  ASSERT.equal(0x00, buffer[4]);
-  ASSERT.equal(0x00, buffer[5]);
-  ASSERT.equal(0x00, buffer[6]);
-  ASSERT.equal(0x00, buffer[7]);
-  ASSERT.equal(0x00, buffer[8]);
-  ASSERT.equal(0x00, buffer[9]);
-  ASSERT.equal(0x00, buffer[10]);
-  ASSERT.equal(0x00, buffer[11]);
-  ASSERT.equal(0x00, buffer[12]);
-  ASSERT.equal(0x00, buffer[13]);
-  ASSERT.equal(0xF8, buffer[14]);
+  // Linux mipsel does the other kind of NaN.
+  ASSERT(0xF8 === buffer[1] || 0xF7 === buffer[1]);
+  ASSERT(0x00 === buffer[2] || 0xFF === buffer[2]);
+  ASSERT(0x00 === buffer[3] || 0xFF === buffer[3]);
+  ASSERT(0x00 === buffer[4] || 0xFF === buffer[4]);
+  ASSERT(0x00 === buffer[5] || 0xFF === buffer[5]);
+  ASSERT(0x00 === buffer[6] || 0xFF === buffer[6]);
+  ASSERT(0x00 === buffer[7] || 0xFF === buffer[7]);
+  ASSERT(0x00 === buffer[8] || 0xFF === buffer[8]);
+  ASSERT(0x00 === buffer[9] || 0xFF === buffer[9]);
+  ASSERT(0x00 === buffer[10] || 0xFF === buffer[10]);
+  ASSERT(0x00 === buffer[11] || 0xFF === buffer[11]);
+  ASSERT(0x00 === buffer[12] || 0xFF === buffer[12]);
+  ASSERT(0x00 === buffer[13] || 0xFF === buffer[13]);
+  // Linux mipsel does the other kind of NaN.
+  ASSERT(0xF8 === buffer[14] || 0xF7 === buffer[14]);
   // Darwin ia32 does the other kind of NaN.
   // Compiler bug.  No one really cares.
   ASSERT(0x7F === buffer[15] || 0xFF === buffer[15]);
--- a/test/simple/test-writefloat.js
+++ b/test/simple/test-writefloat.js
@@ -117,12 +117,14 @@
   // Darwin ia32 does the other kind of NaN.
   // Compiler bug.  No one really cares.
   ASSERT(0x7F === buffer[0] || 0xFF === buffer[0]);
-  ASSERT.equal(0xc0, buffer[1]);
-  ASSERT.equal(0x00, buffer[2]);
-  ASSERT.equal(0x00, buffer[3]);
-  ASSERT.equal(0x00, buffer[4]);
-  ASSERT.equal(0x00, buffer[5]);
-  ASSERT.equal(0xc0, buffer[6]);
+  // Linux mipsel does the other kind of NaN.
+  ASSERT(0xC0 === buffer[1] || 0xBF === buffer[1]);
+  ASSERT(0x00 === buffer[2] || 0xFF === buffer[2]);
+  ASSERT(0x00 === buffer[3] || 0xFF === buffer[3]);
+  ASSERT(0x00 === buffer[4] || 0xFF === buffer[4]);
+  ASSERT(0x00 === buffer[5] || 0xFF === buffer[5]);
+  // Linux mipsel does the other kind of NaN.
+  ASSERT(0xC0 === buffer[6] || 0xBF === buffer[6]);
   // Darwin ia32 does the other kind of NaN.
   // Compiler bug.  No one really cares.
   ASSERT(0x7F === buffer[7] || 0xFF === buffer[7]);