Blame SOURCES/tests-snans-be.patch

95a8a7
Description: Fix sort_snans.js test on big endian
95a8a7
Author: Adrian Bunk <bunk@debian.org>
95a8a7
Bug-Debian: https://bugs.debian.org/878285
95a8a7
95a8a7
--- mozjs52-52.3.1.orig/js/src/tests/ecma_6/TypedArray/sort_snans.js
95a8a7
+++ mozjs52-52.3.1/js/src/tests/ecma_6/TypedArray/sort_snans.js
95a8a7
@@ -34,8 +34,20 @@ function testFloat32NaNRanges(start, end
95a8a7
 // and startHi, startLow and endHi, endLow should be 32-bit integers which,
95a8a7
 // when combined (Hi + Low), form Float64 NaNs.
95a8a7
 function testFloat64NaNRanges(startHi, startLow, endHi, endLow) {
95a8a7
-    let skipN = 10e6;
95a8a7
 
95a8a7
+    // Swap on big endian platforms
95a8a7
+    if ((new Uint32Array((new Uint8Array([1,2,3,4])).buffer))[0] === 0x01020304) {
95a8a7
+	let tmp = startHi;
95a8a7
+	startHi = startLow;
95a8a7
+	startLow = tmp;
95a8a7
+
95a8a7
+	tmp = endHi;
95a8a7
+	endHi = endLow;
95a8a7
+	endLow = tmp;
95a8a7
+    }
95a8a7
+
95a8a7
+    let skipN = 10e6;
95a8a7
+
95a8a7
     let sampleSizeHi  = Math.floor((endHi - startHi)/skipN);
95a8a7
     let sampleSizeLow = Math.floor((endLow - startLow)/skipN);
95a8a7
 
95a8a7