diff --git a/uni_modules/uts-tests/utssdk/TDataView.uts b/uni_modules/uts-tests/utssdk/TDataView.uts index 25cbcdd64ac3edec6accc01a559b7da1ae9da9bf..b493b3c21da8ea989dde770433abc77908048123 100644 --- a/uni_modules/uts-tests/utssdk/TDataView.uts +++ b/uni_modules/uts-tests/utssdk/TDataView.uts @@ -45,7 +45,7 @@ export class TDataView { // Create an ArrayBuffer with a size in bytes let buffer = new ArrayBuffer(16); let view = new DataView(buffer); - view.setFloat32(1, Math.PI.toFloat()); + view.setFloat32(1,3.1415927); expect(this.numberEquals(3.1415927, view.getFloat32(1).toFloat())).toEqual(true); } @@ -97,7 +97,7 @@ export class TDataView { expect(this.numberEquals(255, view.getUint8(1))).toEqual(true); } - numberEquals(a: Number, b: Number): Boolean { + numberEquals(a: number, b: number): Boolean { return a == b } @@ -138,10 +138,10 @@ export class TDataView { } } - makeBuffer(size: Int, littleEndian: boolean): ArrayBuffer { - var buffer = new ArrayBuffer(size * 14); + makeBuffer(size: number, littleEndian: boolean): ArrayBuffer { + var buffer = new ArrayBuffer(1000 * 14); var view = new DataView(buffer); - for (var i = 0; i < size; ++i) { + for (var i = 0; i < 1000; ++i) { view.setInt8(i * 14, i); view.setUint8(i * 14 + 1, i); view.setInt16(i * 14 + 2, i * i, littleEndian); @@ -180,21 +180,21 @@ export class TDataView { } expect(xor).toEqual(0); } else { - var reader = new BigEndian(buffer); + var reader1 = new BigEndian(buffer); for (var i = 0; i < buffer.byteLength; i += 14) { - xor ^= reader.getInt8(i); - xor ^= reader.getUint8(i + 1); - xor ^= reader.getInt16(i + 2); - xor ^= reader.getUint16(i + 4); - xor ^= reader.getInt32(i + 6); - xor ^= reader.getUint32(i + 10); + xor ^= reader1.getInt8(i); + xor ^= reader1.getUint8(i + 1); + xor ^= reader1.getInt16(i + 2); + xor ^= reader1.getUint16(i + 4); + xor ^= reader1.getInt32(i + 6); + xor ^= reader1.getUint32(i + 10); } } } doFloatIterations(dataView: boolean) { - var buffer = makeFloatBuffer(1000); + var buffer = this.makeFloatBuffer(); var iterations = 10; if (dataView) { for (var i = 0; i < iterations; i++) @@ -205,10 +205,10 @@ export class TDataView { } } - makeFloatBuffer(size: Int): ArrayBuffer { - var buffer = new ArrayBuffer(size * 16); + makeFloatBuffer(): ArrayBuffer { + var buffer = new ArrayBuffer(1000 * 16); var view = new DataView(buffer); - for (var i = 0; i < size; i++) { + for (var i = 0; i < 1000; i++) { view.setFloat64(i * 16, Math.log10(i + 1)); view.setFloat32(i * 16 + 8, Math.sqrt(i)); view.setFloat32(i * 16 + 12, Math.cos(i)); diff --git a/uni_modules/uts-tests/utssdk/TFloat32Array.uts b/uni_modules/uts-tests/utssdk/TFloat32Array.uts index 0cc5b4c08cb2c196aaae2c9dd3f8095b5955cabc..f81bb363c5b729d2ae2100f8c2b5538236167790 100644 --- a/uni_modules/uts-tests/utssdk/TFloat32Array.uts +++ b/uni_modules/uts-tests/utssdk/TFloat32Array.uts @@ -253,7 +253,7 @@ export class TFloat32Array { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b): Number => a - b); + numbers.sort((a, b): number => a - b); expect(numbers.toString()).toEqual("1,5,40"); } diff --git a/uni_modules/uts-tests/utssdk/TFloat64Array.uts b/uni_modules/uts-tests/utssdk/TFloat64Array.uts index d33b3bbd6b0c640ece611c8c5733a8202250046c..0728e9aecc151527621b5271c75685a4f0070ac4 100644 --- a/uni_modules/uts-tests/utssdk/TFloat64Array.uts +++ b/uni_modules/uts-tests/utssdk/TFloat64Array.uts @@ -244,7 +244,7 @@ export class TFloat64Array { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b): Number => a - b); + numbers.sort((a, b): number => a - b); expect(numbers.toString()).toEqual("1,5,40"); } diff --git a/uni_modules/uts-tests/utssdk/TInt16Array.uts b/uni_modules/uts-tests/utssdk/TInt16Array.uts index 533f01749163c691910a02e9983fa534e409754d..a21b35c5aefb99a807fe3de2931371b16a9a66ca 100644 --- a/uni_modules/uts-tests/utssdk/TInt16Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt16Array.uts @@ -220,7 +220,7 @@ export class TInt16Array { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b):Number => a - b); + numbers.sort((a, b):number => a - b); expect(numbers.toString()).toEqual("1,5,40"); } diff --git a/uni_modules/uts-tests/utssdk/TInt32Array.uts b/uni_modules/uts-tests/utssdk/TInt32Array.uts index beef28c34480e0e53cbf3cf0f23c3817d9c08b81..9548d4016602674577cc884d200c90d28f028ab8 100644 --- a/uni_modules/uts-tests/utssdk/TInt32Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt32Array.uts @@ -236,7 +236,7 @@ export class TInt32Array { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b):Number => a - b); + numbers.sort((a, b):number => a - b); expect(numbers.toString()).toEqual("1,5,40"); } diff --git a/uni_modules/uts-tests/utssdk/TInt8Array.uts b/uni_modules/uts-tests/utssdk/TInt8Array.uts index 093378bfccc82bc99cb795bbf4752dd849763d5d..a06b40df4d72b611e27f16254df1bc4df0d73104 100644 --- a/uni_modules/uts-tests/utssdk/TInt8Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt8Array.uts @@ -229,7 +229,7 @@ export class TInt8Array { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b): Number => a - b); + numbers.sort((a, b): number => a - b); expect(numbers.toString()).toEqual("1,5,40"); } diff --git a/uni_modules/uts-tests/utssdk/TUInt8Array.uts b/uni_modules/uts-tests/utssdk/TUInt8Array.uts index e66e827105c82197112fd0f553fc4d49aa3974ec..cdf3fdd750c6150132502341432d83b7692e0b18 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8Array.uts +++ b/uni_modules/uts-tests/utssdk/TUInt8Array.uts @@ -233,7 +233,7 @@ export class TUint8Array { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b): Number => a - b); + numbers.sort((a, b): number => a - b); expect(numbers.toString()).toEqual("1,5,40"); } diff --git a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts index 5053b8679b323ed9b86abe02b94d3678c1ae200a..c3f1789c7d755986c68032680046b94031692a89 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts +++ b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts @@ -228,7 +228,7 @@ export class TUint8ClampedArray { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b): Number => a - b); + numbers.sort((a, b): number => a - b); expect(numbers.toString()).toEqual("1,5,40"); } diff --git a/uni_modules/uts-tests/utssdk/TUint16Array.uts b/uni_modules/uts-tests/utssdk/TUint16Array.uts index 56942d87b11a57e6ff9f7f6aec7c03e6a90fc457..33339fa576657fc4db807a69f8aea54e560998d2 100644 --- a/uni_modules/uts-tests/utssdk/TUint16Array.uts +++ b/uni_modules/uts-tests/utssdk/TUint16Array.uts @@ -242,7 +242,7 @@ export class TUint16Array { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b): Number => a - b); + numbers.sort((a, b): number => a - b); expect(numbers.toString()).toEqual("1,5,40"); } diff --git a/uni_modules/uts-tests/utssdk/TUint32Array.uts b/uni_modules/uts-tests/utssdk/TUint32Array.uts index 265765f398d82510427b9ca72af1ee9c0e963f19..94de432e276557286c6518f8b3007c9a584eda75 100644 --- a/uni_modules/uts-tests/utssdk/TUint32Array.uts +++ b/uni_modules/uts-tests/utssdk/TUint32Array.uts @@ -242,7 +242,7 @@ export class TUint32Array { numbers.sort(); expect(numbers.toString()).toEqual("1,5,40"); - numbers.sort((a, b): Number => a - b); + numbers.sort((a, b): number => a - b); expect(numbers.toString()).toEqual("1,5,40"); }