Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
8ec174d0
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1595
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8ec174d0
编写于
7月 15, 2024
作者:
M
mahaifeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[array-buffer]修改条件编译
上级
95cc26fa
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
32 addition
and
28 deletion
+32
-28
uni_modules/uts-tests/utssdk/ArrayBuffer.uts
uni_modules/uts-tests/utssdk/ArrayBuffer.uts
+4
-2
uni_modules/uts-tests/utssdk/TDataView.uts
uni_modules/uts-tests/utssdk/TDataView.uts
+8
-6
uni_modules/uts-tests/utssdk/TFloat32Array.uts
uni_modules/uts-tests/utssdk/TFloat32Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TFloat64Array.uts
uni_modules/uts-tests/utssdk/TFloat64Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TInt16Array.uts
uni_modules/uts-tests/utssdk/TInt16Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TInt32Array.uts
uni_modules/uts-tests/utssdk/TInt32Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TInt8Array.uts
uni_modules/uts-tests/utssdk/TInt8Array.uts
+4
-4
uni_modules/uts-tests/utssdk/TUInt8Array.uts
uni_modules/uts-tests/utssdk/TUInt8Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
+2
-2
uni_modules/uts-tests/utssdk/TUint16Array.uts
uni_modules/uts-tests/utssdk/TUint16Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TUint32Array.uts
uni_modules/uts-tests/utssdk/TUint32Array.uts
+2
-2
未找到文件。
uni_modules/uts-tests/utssdk/ArrayBuffer.uts
浏览文件 @
8ec174d0
...
...
@@ -23,7 +23,8 @@ const int16 = new TInt16Array()
export function testArrayBuffer() : Result {
return describe("ArrayBuffer", () => {
// #ifdef APP-ANDROID
// #ifndef APP-IOS
//dataview start
test('dataview_constructor', () => {
tDataView.setConstructor()
...
...
@@ -753,7 +754,8 @@ export function testArrayBuffer() : Result {
test('uint32_testSome', () => {
uint32.testSome()
})
// #endif
//uint32 end
// #endif
})
}
\ No newline at end of file
uni_modules/uts-tests/utssdk/TDataView.uts
浏览文件 @
8ec174d0
...
...
@@ -18,6 +18,7 @@ export class TDataView {
// this.setUint8();
// this.testMix();
}
// #ifndef APP-IOS
setConstructor() {
let buffer = new ArrayBuffer(16);
let dataview = new DataView(buffer);
...
...
@@ -40,7 +41,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
...
...
@@ -50,7 +51,7 @@ export class TDataView {
view.setFloat32(1, 3);
expect(this.numberEquals(3, view.getFloat32(1))).toEqual(true);
// #END
}
}
setFloat64() {
// #TEST DataView.setFloat64,DataView.getFloat64
...
...
@@ -60,7 +61,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
...
...
@@ -70,7 +71,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
...
...
@@ -80,7 +81,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
...
...
@@ -100,7 +101,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
...
...
@@ -342,4 +343,5 @@ class LittleEndian {
this.uint8View_[byteOffset + 3] * (1 << 24)
);
}
// #endif
}
\ No newline at end of file
uni_modules/uts-tests/utssdk/TFloat32Array.uts
浏览文件 @
8ec174d0
...
...
@@ -7,7 +7,7 @@ import {
export class TFloat32Array {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testfloat32();
this.testConstructor();
this.testSet();
...
...
@@ -34,7 +34,7 @@ export class TFloat32Array {
this.arrayBufferSlice();
// #endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
from() {
var float32Array = Float32Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
expect(float32Array.toString()).toEqual('2,4,6');
...
...
uni_modules/uts-tests/utssdk/TFloat64Array.uts
浏览文件 @
8ec174d0
...
...
@@ -7,7 +7,7 @@ import {
export class TFloat64Array {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testfloat64();
this.testConstructor();
this.testSet();
...
...
@@ -34,7 +34,7 @@ export class TFloat64Array {
this.arrayBufferSlice();
// #endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
testfloat64() {
let float64 = new Float64Array(2);
float64[0] = 42;
...
...
uni_modules/uts-tests/utssdk/TInt16Array.uts
浏览文件 @
8ec174d0
...
...
@@ -7,7 +7,7 @@ import {
export class TInt16Array {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testConstructor();
this.testSet();
this.testCopyWith();
...
...
@@ -34,7 +34,7 @@ export class TInt16Array {
// #endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
testConstructor() {
let buffer = new ArrayBuffer(16);
let int16 = new Int16Array(buffer);
...
...
uni_modules/uts-tests/utssdk/TInt32Array.uts
浏览文件 @
8ec174d0
...
...
@@ -7,7 +7,7 @@ import {
export class TInt32Array {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testInt32Array();
this.testConstructor();
this.testSet();
...
...
@@ -35,7 +35,7 @@ export class TInt32Array {
// #endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
testInt32Array() {
let int32 = new Int32Array(2);
int32[0] = 42;
...
...
uni_modules/uts-tests/utssdk/TInt8Array.uts
浏览文件 @
8ec174d0
...
...
@@ -8,7 +8,7 @@ import {
export class TInt8Array {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testConstructor();
this.testSet();
this.testCopyWith();
...
...
@@ -35,7 +35,7 @@ export class TInt8Array {
//#endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
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() {
...
...
uni_modules/uts-tests/utssdk/TUInt8Array.uts
浏览文件 @
8ec174d0
...
...
@@ -7,7 +7,7 @@ import {
export class TUint8Array {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testMAX();
this.testConstructor();
this.testSet();
...
...
@@ -34,7 +34,7 @@ export class TUint8Array {
this.arrayBufferSlice();
// #endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
from() {
var s = new Set([1, 2, 3]);
var unit8 = Uint8Array.from(s);
...
...
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
浏览文件 @
8ec174d0
...
...
@@ -7,7 +7,7 @@ import {
export class TUint8ClampedArray {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testMAX();
this.testConstructor();
this.testSet();
...
...
@@ -35,7 +35,7 @@ export class TUint8ClampedArray {
// #endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
testMAX() {
let uint8Clamped = new Uint8ClampedArray(16);
uint8Clamped[0] = 255;
...
...
uni_modules/uts-tests/utssdk/TUint16Array.uts
浏览文件 @
8ec174d0
...
...
@@ -7,7 +7,7 @@ import {
export class TUint16Array {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testuint16();
this.testConstructor();
this.testSet();
...
...
@@ -35,7 +35,7 @@ export class TUint16Array {
// #endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
testuint16() {
let uint16 = new Uint16Array(2);
uint16[0] = 42;
...
...
uni_modules/uts-tests/utssdk/TUint32Array.uts
浏览文件 @
8ec174d0
...
...
@@ -7,7 +7,7 @@ import {
export class TUint32Array {
test() {
// #if
def APP-ANDROID
// #if
ndef APP-IOS
this.testuint32();
this.testConstructor();
this.testSet();
...
...
@@ -35,7 +35,7 @@ export class TUint32Array {
// #endif
}
// #if
def APP-ANDROID
// #if
ndef APP-IOS
testuint32() {
let uint32 = new Uint32Array(2);
uint32[0] = 42;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录