From 99c200d4529b0a1fc4f51aae34ce8749fed26a56 Mon Sep 17 00:00:00 2001 From: mahaifeng Date: Mon, 15 Jul 2024 17:08:09 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"[array-buffer]=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E7=BC=96=E8=AF=91"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5d19c8378226fdc728456634a7084f43186c2b19. --- uni_modules/uts-tests/utssdk/ArrayBuffer.uts | 6 ++---- uni_modules/uts-tests/utssdk/TDataView.uts | 14 ++++++-------- uni_modules/uts-tests/utssdk/TFloat32Array.uts | 4 ++-- uni_modules/uts-tests/utssdk/TFloat64Array.uts | 4 ++-- uni_modules/uts-tests/utssdk/TInt16Array.uts | 4 ++-- uni_modules/uts-tests/utssdk/TInt32Array.uts | 4 ++-- uni_modules/uts-tests/utssdk/TInt8Array.uts | 8 ++++---- uni_modules/uts-tests/utssdk/TUInt8Array.uts | 4 ++-- .../uts-tests/utssdk/TUInt8ClampedArray.uts | 4 ++-- uni_modules/uts-tests/utssdk/TUint16Array.uts | 4 ++-- uni_modules/uts-tests/utssdk/TUint32Array.uts | 4 ++-- 11 files changed, 28 insertions(+), 32 deletions(-) diff --git a/uni_modules/uts-tests/utssdk/ArrayBuffer.uts b/uni_modules/uts-tests/utssdk/ArrayBuffer.uts index fef4993..2df1303 100644 --- a/uni_modules/uts-tests/utssdk/ArrayBuffer.uts +++ b/uni_modules/uts-tests/utssdk/ArrayBuffer.uts @@ -23,8 +23,7 @@ const int16 = new TInt16Array() export function testArrayBuffer() : Result { return describe("ArrayBuffer", () => { - // #ifndef APP-IOS - + // #ifdef APP-ANDROID //dataview start test('dataview_constructor', () => { tDataView.setConstructor() @@ -754,8 +753,7 @@ export function testArrayBuffer() : Result { test('uint32_testSome', () => { uint32.testSome() }) - - //uint32 end // #endif + //uint32 end }) } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TDataView.uts b/uni_modules/uts-tests/utssdk/TDataView.uts index a109f40..4b4ab78 100644 --- a/uni_modules/uts-tests/utssdk/TDataView.uts +++ b/uni_modules/uts-tests/utssdk/TDataView.uts @@ -18,7 +18,6 @@ export class TDataView { // this.setUint8(); // this.testMix(); } - // #ifndef APP-IOS setConstructor() { let buffer = new ArrayBuffer(16); let dataview = new DataView(buffer); @@ -41,7 +40,7 @@ export class TDataView { view.setInt8(1, 127); // Max signed 8-bit integer expect(view.getInt8(1)).toEqual(127); // #END - } + } setFloat32() { // #TEST DataView.setFloat32,DataView.getFloat32 @@ -51,7 +50,7 @@ export class TDataView { view.setFloat32(1, 3); expect(this.numberEquals(3, view.getFloat32(1))).toEqual(true); // #END - } + } setFloat64() { // #TEST DataView.setFloat64,DataView.getFloat64 @@ -61,7 +60,7 @@ export class TDataView { view.setFloat64(1, Math.PI); expect(this.numberEquals(3.141592653589793, view.getFloat64(1))).toEqual(true); // #END - } + } setInt16() { // #TEST DataView.setInt16,DataView.getInt16 @@ -71,7 +70,7 @@ export class TDataView { view.setInt16(1, 32767); // Max signed 16-bit integer expect(view.getInt16(1)).toEqual(32767); // #END - } + } setInt32() { // #TEST DataView.setInt32,DataView.getInt32 @@ -81,7 +80,7 @@ export class TDataView { view.setInt32(1, 2147483647); // Max signed 32-bit integer expect(this.numberEquals(2147483647, view.getInt32(1))).toEqual(true); // #END - } + } setUint16() { // #TEST DataView.setUint16,DataView.getUint16 @@ -101,7 +100,7 @@ export class TDataView { view.setUint32(1, 4294967295); // Max unsigned 32-bit integer expect(this.numberEquals(4294967295, view.getUint32(1))).toEqual(true); // #END - } + } setUint8() { // #TEST DataView.setUint8,DataView.getUint8 @@ -343,5 +342,4 @@ class LittleEndian { this.uint8View_[byteOffset + 3] * (1 << 24) ); } - // #endif } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TFloat32Array.uts b/uni_modules/uts-tests/utssdk/TFloat32Array.uts index 1795e12..89549b7 100644 --- a/uni_modules/uts-tests/utssdk/TFloat32Array.uts +++ b/uni_modules/uts-tests/utssdk/TFloat32Array.uts @@ -7,7 +7,7 @@ import { export class TFloat32Array { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testfloat32(); this.testConstructor(); this.testSet(); @@ -34,7 +34,7 @@ export class TFloat32Array { this.arrayBufferSlice(); // #endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID from() { var float32Array = Float32Array.from([1, 2, 3], (v : number, _ : number) : number => v + v); expect(float32Array.toString()).toEqual('2,4,6'); diff --git a/uni_modules/uts-tests/utssdk/TFloat64Array.uts b/uni_modules/uts-tests/utssdk/TFloat64Array.uts index 5e54ac2..bc347d6 100644 --- a/uni_modules/uts-tests/utssdk/TFloat64Array.uts +++ b/uni_modules/uts-tests/utssdk/TFloat64Array.uts @@ -7,7 +7,7 @@ import { export class TFloat64Array { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testfloat64(); this.testConstructor(); this.testSet(); @@ -34,7 +34,7 @@ export class TFloat64Array { this.arrayBufferSlice(); // #endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID testfloat64() { let float64 = new Float64Array(2); float64[0] = 42; diff --git a/uni_modules/uts-tests/utssdk/TInt16Array.uts b/uni_modules/uts-tests/utssdk/TInt16Array.uts index 830d217..469abf1 100644 --- a/uni_modules/uts-tests/utssdk/TInt16Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt16Array.uts @@ -7,7 +7,7 @@ import { export class TInt16Array { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testConstructor(); this.testSet(); this.testCopyWith(); @@ -34,7 +34,7 @@ export class TInt16Array { // #endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID testConstructor() { let buffer = new ArrayBuffer(16); let int16 = new Int16Array(buffer); diff --git a/uni_modules/uts-tests/utssdk/TInt32Array.uts b/uni_modules/uts-tests/utssdk/TInt32Array.uts index 23f71ad..0b73a37 100644 --- a/uni_modules/uts-tests/utssdk/TInt32Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt32Array.uts @@ -7,7 +7,7 @@ import { export class TInt32Array { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testInt32Array(); this.testConstructor(); this.testSet(); @@ -35,7 +35,7 @@ export class TInt32Array { // #endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID testInt32Array() { let int32 = new Int32Array(2); int32[0] = 42; diff --git a/uni_modules/uts-tests/utssdk/TInt8Array.uts b/uni_modules/uts-tests/utssdk/TInt8Array.uts index 0efd20c..ba4fde4 100644 --- a/uni_modules/uts-tests/utssdk/TInt8Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt8Array.uts @@ -8,7 +8,7 @@ import { export class TInt8Array { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testConstructor(); this.testSet(); this.testCopyWith(); @@ -35,7 +35,7 @@ export class TInt8Array { //#endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID testConstructor() { let buffer = new ArrayBuffer(16); let int8View = new Int8Array(buffer); @@ -294,7 +294,7 @@ export class TInt8Array { } arrayBufferSlice() { - + // #TEST ArrayBuffer.slice let buffer = new ArrayBuffer(16); let int8 = new Int8Array(buffer); @@ -305,7 +305,7 @@ export class TInt8Array { let sliced = new Int8Array(res); expect(sliced[0]).toEqual(42); // #END - + } testSome() { diff --git a/uni_modules/uts-tests/utssdk/TUInt8Array.uts b/uni_modules/uts-tests/utssdk/TUInt8Array.uts index f93f855..cbacbc4 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8Array.uts +++ b/uni_modules/uts-tests/utssdk/TUInt8Array.uts @@ -7,7 +7,7 @@ import { export class TUint8Array { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testMAX(); this.testConstructor(); this.testSet(); @@ -34,7 +34,7 @@ export class TUint8Array { this.arrayBufferSlice(); // #endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID from() { var s = new Set([1, 2, 3]); var unit8 = Uint8Array.from(s); diff --git a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts index 4dfdaee..583c1e8 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts +++ b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts @@ -7,7 +7,7 @@ import { export class TUint8ClampedArray { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testMAX(); this.testConstructor(); this.testSet(); @@ -35,7 +35,7 @@ export class TUint8ClampedArray { // #endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID testMAX() { let uint8Clamped = new Uint8ClampedArray(16); uint8Clamped[0] = 255; diff --git a/uni_modules/uts-tests/utssdk/TUint16Array.uts b/uni_modules/uts-tests/utssdk/TUint16Array.uts index 73f87a5..a322a0b 100644 --- a/uni_modules/uts-tests/utssdk/TUint16Array.uts +++ b/uni_modules/uts-tests/utssdk/TUint16Array.uts @@ -7,7 +7,7 @@ import { export class TUint16Array { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testuint16(); this.testConstructor(); this.testSet(); @@ -35,7 +35,7 @@ export class TUint16Array { // #endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID testuint16() { let uint16 = new Uint16Array(2); uint16[0] = 42; diff --git a/uni_modules/uts-tests/utssdk/TUint32Array.uts b/uni_modules/uts-tests/utssdk/TUint32Array.uts index 096e95a..b6c822e 100644 --- a/uni_modules/uts-tests/utssdk/TUint32Array.uts +++ b/uni_modules/uts-tests/utssdk/TUint32Array.uts @@ -7,7 +7,7 @@ import { export class TUint32Array { test() { - // #ifndef APP-IOS + // #ifdef APP-ANDROID this.testuint32(); this.testConstructor(); this.testSet(); @@ -35,7 +35,7 @@ export class TUint32Array { // #endif } - // #ifndef APP-IOS + // #ifdef APP-ANDROID testuint32() { let uint32 = new Uint32Array(2); uint32[0] = 42; -- GitLab