未验证 提交 918fee91 编写于 作者: O openharmony_ci 提交者: Gitee

!4474 回退 'Pull Request !4467 : Modify the problem of the same name in the XTS test case'

Merge pull request !4474 from openharmony_ci/revert-merge-4467-master
......@@ -320,11 +320,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testTid001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns the tid of the current thread.
* @tc.author: liwenqiang
*/
it('testTid001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let pres = process.tid
if (pres > 0) {
var flag = new Boolean(true)
......@@ -333,11 +333,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testTid002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns the tid of the current thread.
* @tc.author: liwenqiang
*/
it('testTid002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
for (let i=0; i < 5; i++) {
let pres = process.tid
if (pres > 0) {
......@@ -348,11 +348,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testTid003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns the tid of the current thread.
* @tc.author: liwenqiang
*/
it('testTid003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
for (let i=0; i < 3; i++) {
let pres = process.tid
if (pres > 0) {
......@@ -364,21 +364,21 @@ describe('ChildProcessTest', function () {
/**
* @tc.name: testisIsolatedProcess001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns a boolean whether the process is isolated.
* @tc.author: liwenqiang
*/
it('testisIsolatedProcess001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let pres = process.isIsolatedProcess()
expect(pres).assertEqual(true)
})
/**
* @tc.name: testisIsolatedProcess002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns a boolean whether the process is isolated.
* @tc.author: liwenqiang
*/
it('testisIsolatedProcess002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
for (let i=0; i < 3; i++) {
let pres = process.isIsolatedProcess()
expect(pres).assertEqual(true)
......@@ -386,11 +386,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testisIsolatedProcess003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns a boolean whether the process is isolated.
* @tc.author: liwenqiang
*/
it('testisIsolatedProcess003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
for (let i=0; i < 5; i++) {
let pres = process.isIsolatedProcess()
expect(pres).assertEqual(true)
......@@ -399,21 +399,21 @@ describe('ChildProcessTest', function () {
/**
* @tc.name: testIsappuid001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns a boolean whether the specified uid belongs to a particular application.
* @tc.author: liwenqiang
*/
it('testIsappuid001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let isorno = process.isAppUid(167)
expect(isorno).assertEqual(false)
})
/**
* @tc.name: testIsappuid002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns a boolean whether the specified uid belongs to a particular application.
* @tc.author: liwenqiang
*/
it('testIsappuid002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
let isorno = process.isAppUid(123)
expect(isorno).assertEqual(false)
})
......@@ -449,11 +449,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testIs64Bit001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns a boolean whether the process is running in a 64-bit environment.
* @tc.author: liwenqiang
*/
it('testIs64Bit001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let isorno = process.is64Bit()
if (isorno) {
expect(isorno).assertEqual(true)
......@@ -463,11 +463,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testIs64Bit002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns a boolean whether the process is running in a 64-bit environment.
* @tc.author: liwenqiang
*/
it('testIs64Bit002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
for (let i=0; i<3; i++) {
let isorno = process.is64Bit()
if (isorno) {
......@@ -479,11 +479,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testIs64Bit003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns a boolean whether the process is running in a 64-bit environment.
* @tc.author: liwenqiang
*/
it('testIs64Bit004', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
for (let i=0; i<5; i++) {
let isorno = process.is64Bit()
if (isorno) {
......@@ -496,11 +496,11 @@ describe('ChildProcessTest', function () {
/**
* @tc.name: testGetUidForName001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns the uid based on the specified user name.
* @tc.author: liwenqiang
*/
it('testGetUidForName001',0, function () {
it('SUB_Runtime_JSAPI_001',0, function () {
let pres = process.getUidForName("root")
if (pres != -1) {
let flag = new Boolean(true)
......@@ -509,11 +509,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetUidForName002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns the uid based on the specified user name.
* @tc.author: liwenqiang
*/
it('testGetUidForName002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
for (let i=0; i<3; i++) {
let pres = process.getUidForName("12356")
expect(pres).assertEqual(-1)
......@@ -521,11 +521,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetUidForName003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns the uid based on the specified user name.
* @tc.author: liwenqiang
*/
it('testGetUidForName003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
for (let i=0; i<5; i++) {
let pres = process.getUidForName("12356")
expect(pres).assertEqual(-1)
......@@ -534,11 +534,11 @@ describe('ChildProcessTest', function () {
/**
* @tc.name: testGetThreadPriority001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns the thread priority based on the specified tid.
* @tc.author: liwenqiang
*/
it('testGetThreadPriority001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let pres = process.tid
let pri = process.getThreadPriority(pres)
if (pri) {
......@@ -548,11 +548,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetThreadPriority002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns the thread priority based on the specified tid.
* @tc.author: liwenqiang
*/
it('testGetThreadPriority002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
let pres = process.tid
for (let i=0; i<3; i++) {
let pri = process.getThreadPriority(pres)
......@@ -564,11 +564,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetThreadPriority003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns the thread priority based on the specified tid.
* @tc.author: liwenqiang
*/
it('testGetThreadPriority003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
let pres = process.tid
for (let i=0; i<5; i++) {
let pri = process.getThreadPriority(pres)
......@@ -580,12 +580,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetStartRealtime001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of
* @the system to the start of the process.
* @tc.author: liwenqiang
*/
it('testGetStartRealtime001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
for (let i=0; i<3; i++) {
let pri = process.getStartRealtime()
if (pri !== null) {
......@@ -596,12 +596,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetStartRealtime002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of
* @the system to the start of the process.
* @tc.author: liwenqiang
*/
it('testGetStartRealtime002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
let pri = process.getStartRealtime()
if (pri !== null) {
var flag = new Boolean(true)
......@@ -610,12 +610,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetStartRealtime003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of
* @the system to the start of the process.
* @tc.author: liwenqiang
*/
it('testGetStartRealtime003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
for (let i=0; i<5; i++) {
let pri = process.getStartRealtime()
if (pri !== null) {
......@@ -626,12 +626,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetStartRealtime004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Returns the elapsed real time (in milliseconds)
* @taken from the start of the system to the start of the process.
* @tc.author: liwenqiang
*/
it('testGetStartRealtime004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
for (let i=0; i<8; i++) {
let pri = process.getStartRealtime()
if (pri !== null) {
......@@ -642,12 +642,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetStartRealtime005
* @tc.name: testGetstartrealtime005
* @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of
* @the system to the start of the process.
* @tc.author: liwenqiang
*/
it('testGetStartRealtime005', 0, function () {
it('testGetstartrealtime005', 0, function () {
for (let i=0; i<6; i++) {
let pri = process.getStartRealtime()
if (pri !== null) {
......@@ -673,11 +673,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetpastCpuTime002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
* @tc.author: liwenqiang
*/
it('testGetpastCpuTime002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
let pri = process.getPastCpuTime()
if (pri > 0) {
var flag = new Boolean(true)
......@@ -686,11 +686,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetpastCpuTime003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
* @tc.author: liwenqiang
*/
it('testGetpastCpuTime003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
for (let i=0; i<5; i++) {
let pri = process.getPastCpuTime()
if (pri > 0) {
......@@ -701,11 +701,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetpastCpuTime004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
* @tc.author: liwenqiang
*/
it('testGetpastCpuTime004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
for (let i=0; i<8; i++) {
let pri = process.getPastCpuTime()
if (pri > 0) {
......@@ -716,11 +716,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetSystemConfig001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns the system configuration at runtime.
* @tc.author: liwenqiang
*/
it('testGetSystemConfig001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let _SC_ARG_MAX = 0
let pri = process.getSystemConfig(_SC_ARG_MAX)
if (pri > 0) {
......@@ -730,11 +730,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetSystemConfig002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns the system configuration at runtime.
* @tc.author: liwenqiang
*/
it('testGetSystemConfig002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
let _SC_ARG_MAX = 0
for (let i=0; i<3; i++) {
let pri = process.getSystemConfig(_SC_ARG_MAX)
......@@ -746,11 +746,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetSystemConfig003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns the system configuration at runtime.
* @tc.author: liwenqiang
*/
it('testGetSystemConfig003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
let _SC_ARG_MAX = 0
for (let i=0; i<5; i++) {
let pri = process.getSystemConfig(_SC_ARG_MAX)
......@@ -762,11 +762,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetSystemConfig004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Returns the system configuration at runtime.
* @tc.author: liwenqiang
*/
it('testGetSystemConfig004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
let _SC_OPEN_MAX = 4
let pri = process.getSystemConfig(_SC_OPEN_MAX)
if (pri > 0) {
......@@ -776,11 +776,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetSystemConfig005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Returns the system configuration at runtime.
* @tc.author: liwenqiang
*/
it('testGetSystemConfig005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
let _SC_PAGESIZE = 8
let pri = process.getSystemConfig(_SC_PAGESIZE)
if (pri > 0) {
......@@ -790,11 +790,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetEnvironmentVar001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns the system value for environment variables.
* @tc.author: liwenqiang
*/
it('testGetEnvironmentVar001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let pri = process.getEnvironmentVar("USER")
if (pri != null) {
var flag = new Boolean(true)
......@@ -803,11 +803,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetEnvironmentVar002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns the system value for environment variables.
* @tc.author: liwenqiang
*/
it('testGetEnvironmentVar002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
for (let i=0; i<3; i++) {
let pri = process.getEnvironmentVar("PATH")
if (pri != null) {
......@@ -833,11 +833,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetEnvironmentVar004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Returns the system value for environment variables.
* @tc.author: liwenqiang
*/
it('testGetEnvironmentVar004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
for (let i=0; i<6; i++) {
let pri = process.getEnvironmentVar("USER")
if (pri != null) {
......@@ -848,11 +848,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetEnvironmentVar005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Returns the system value for environment variables.
* @tc.author: liwenqiang
*/
it('testGetEnvironmentVar005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
for (let i=0; i<8; i++) {
let pri = process.getEnvironmentVar("USER")
if (pri != null) {
......@@ -863,11 +863,11 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name: testGetEnvironmentVar006
* @tc.name: SUB_Runtime_JSAPI_006
* @tc.desc: Returns the system value for environment variables.
* @tc.author: liwenqiang
*/
it('testGetEnvironmentVar006', 0, function () {
it('SUB_Runtime_JSAPI_006', 0, function () {
for (let i=0; i<100; i++) {
let pri = process.getEnvironmentVar("i123")
if (pri == null) {
......@@ -876,4 +876,4 @@ describe('ChildProcessTest', function () {
}
}
})
})
\ No newline at end of file
})}
......@@ -17,11 +17,11 @@ import uri from '@ohos.uri'
describe('UriTest', function () {
/**
* @tc.name: testUriConstruction001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
try {
let that = new uri.URI('#http://username:password@host:8080/directory/file?foo=1&bar=2');
} catch (err) {
......@@ -30,11 +30,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
try {
let that = new uri.URI({name: 'gaogao'});
} catch (err) {
......@@ -43,11 +43,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
try {
let that = new uri.URI('ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2');
} catch (err) {
......@@ -56,11 +56,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
try {
let that = new uri.URI('http://username:password@[::]:8080/directory/file?Query#gaogao faofao');
} catch (err) {
......@@ -69,11 +69,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
try {
let that = new uri.URI('http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao');
} catch (err) {
......@@ -82,11 +82,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction006
* @tc.name: SUB_Runtime_JSAPI_006
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction006', 0, function () {
it('SUB_Runtime_JSAPI_006', 0, function () {
try {
let that = new uri.URI('1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
......@@ -95,11 +95,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction007
* @tc.name: SUB_Runtime_JSAPI_007
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction007', 0, function () {
it('SUB_Runtime_JSAPI_007', 0, function () {
try {
let that = new uri.URI('ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
......@@ -108,11 +108,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction008
* @tc.name: SUB_Runtime_JSAPI_008
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction008', 0, function () {
it('SUB_Runtime_JSAPI_008', 0, function () {
try {
let that = new uri.URI('http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
......@@ -121,11 +121,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction009
* @tc.name: SUB_Runtime_JSAPI_009
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction009', 0, function () {
it('SUB_Runtime_JSAPI_009', 0, function () {
try {
let that = new uri.URI('http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
......@@ -134,11 +134,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction010
* @tc.name: SUB_Runtime_JSAPI_010
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction010', 0, function () {
it('SUB_Runtime_JSAPI_010', 0, function () {
try {
let that = new uri.URI('http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
......@@ -147,11 +147,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction011
* @tc.name: SUB_Runtime_JSAPI_011
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction011', 0, function () {
it('SUB_Runtime_JSAPI_011', 0, function () {
try {
let that = new uri.URI('http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
......@@ -160,11 +160,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction012
* @tc.name: SUB_Runtime_JSAPI_012
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction012', 0, function () {
it('SUB_Runtime_JSAPI_012', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@www.baidu.com:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@www.baidu.com:99");
......@@ -178,11 +178,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction013
* @tc.name: testConstructor013
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction013', 0, function () {
it('testConstructor013', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[1080::8:800:200C:417A]:99");
......@@ -196,11 +196,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction014
* @tc.name: SUB_Runtime_JSAPI_014
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction014', 0, function () {
it('SUB_Runtime_JSAPI_014', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[::]:88/path/path66?foooo#gaogao');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[::]:88");
......@@ -214,11 +214,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction015
* @tc.name: testConstructor015
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction015', 0, function () {
it('testConstructor015', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[1:0:0:1:2:1:2:1]:99");
......@@ -232,11 +232,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction016
* @tc.name: SUB_Runtime_JSAPI_016
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction016', 0, function () {
it('SUB_Runtime_JSAPI_016', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[::FFFF:129.144.52.38]:99");
......@@ -250,11 +250,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction017
* @tc.name: testConstructor017
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction017', 0, function () {
it('testConstructor017', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[::192.9.5.5]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[::192.9.5.5]:99");
......@@ -268,11 +268,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction018
* @tc.name: testConstructor018
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction018', 0, function () {
it('testConstructor018', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[22::22:2:2%ss]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[22::22:2:2%ss]:99");
......@@ -286,11 +286,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction019
* @tc.name: testConstructor019
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction019', 0, function () {
it('testConstructor019', 0, function () {
let gaogao =
new uri.URI('http://gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
......@@ -305,11 +305,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction020
* @tc.name: testConstructor020
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction020', 0, function () {
it('testConstructor020', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[fe80::0001:0000]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[fe80::0001:0000]:99");
......@@ -323,11 +323,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction021
* @tc.name: SUB_Runtime_JSAPI_021
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction021', 0, function () {
it('SUB_Runtime_JSAPI_021', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@199.98.55.44:99");
......@@ -341,11 +341,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction022
* @tc.name: SUB_Runtime_JSAPI_022
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction022', 0, function () {
it('SUB_Runtime_JSAPI_022', 0, function () {
let gaogao = new uri.URI('http://16.9.5.4:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("16.9.5.4:99");
......@@ -359,11 +359,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction023
* @tc.name: testConstructor023
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction023', 0, function () {
it('testConstructor023', 0, function () {
let gaogao = new uri.URI('http://49.99.54.12:50/path/path23?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("49.99.54.12:50");
......@@ -377,11 +377,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction024
* @tc.name: SUB_Runtime_JSAPI_024
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction024', 0, function () {
it('SUB_Runtime_JSAPI_024', 0, function () {
let gaogao = new uri.URI('http://user@49.10pe8.54.12:80/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@49.10pe8.54.12:80");
......@@ -395,11 +395,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction025
* @tc.name: SUB_Runtime_JSAPI_025
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction025', 0, function () {
it('SUB_Runtime_JSAPI_025', 0, function () {
let gaogao = new uri.URI('http://user@www.baidu.com/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@www.baidu.com");
......@@ -413,11 +413,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction026
* @tc.name: SUB_Runtime_JSAPI_026
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction026', 0, function () {
it('SUB_Runtime_JSAPI_026', 0, function () {
let gaogao = new uri.URI('http://user@www.hw.com:77/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@www.hw.com:77");
......@@ -431,11 +431,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction027
* @tc.name: SUB_Runtime_JSAPI_027
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction027', 0, function () {
it('SUB_Runtime_JSAPI_027', 0, function () {
let gaogao = new uri.URI('ht2tp://user@www.h12343w.com:77/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("ht2tp");
expect(gaogao.authority).assertEqual("user@www.h12343w.com:77");
......@@ -449,11 +449,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction028
* @tc.name: testConstructor028
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction028', 0, function () {
it('testConstructor028', 0, function () {
let gaogao = new uri.URI('ht2tp://user@www.1hw.1com:77/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("ht2tp");
expect(gaogao.authority).assertEqual("user@www.1hw.1com:77");
......@@ -467,11 +467,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction029
* @tc.name: testConstructor029
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction029', 0, function () {
it('testConstructor029', 0, function () {
let gaogao = new uri.URI('http://user@hosthost/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@hosthost");
......@@ -485,11 +485,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction030
* @tc.name: testConstructor030
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction030', 0, function () {
it('testConstructor030', 0, function () {
let gaogao = new uri.URI('http://user@[::]/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@[::]");
......@@ -503,11 +503,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testUriConstruction031
* @tc.name: testConstructor031
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/
it('testUriConstruction031', 0, function () {
it('testConstructor031', 0, function () {
let gaogao = new uri.URI('http://[::192:0:5]/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("[::192:0:5]");
......@@ -533,11 +533,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testEquals002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Tests this URI for equality with another object.
* @tc.author: zhaoduwei
*/
it('testEquals002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let res = gaogao.equals(gaogao1);
......@@ -545,11 +545,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testEquals003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Tests this URI for equality with another object.
* @tc.author: zhaoduwei
*/
it('testEquals003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123');
let res = gaogao.equals(gaogao1);
......@@ -581,11 +581,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testNormalize001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/
it('testNormalize001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment');
let res = gaogao.normalize();
expect(res.path).assertEqual("/path/path1");
......@@ -593,11 +593,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testNormalize002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/
it('testNormalize002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment');
let res = gaogao.normalize();
expect(res.path).assertEqual("/../../path");
......@@ -617,11 +617,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testNormalize004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/
it('testNormalize004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query');
let res = gaogao.normalize();
expect(res.path).assertEqual("/../../aa/bb/cc");
......@@ -629,11 +629,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testNormalize005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/
it('testNormalize005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment');
let res = gaogao.normalize();
expect(res.path).assertEqual("/path/aa/bb/cc");
......@@ -641,11 +641,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testToString001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.author: zhaoduwei
*/
it('testToString001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
let res = gaogao.toString();
expect(res).assertEqual('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
......@@ -674,11 +674,11 @@ describe('UriTest', function () {
})
/**
* @tc.name: testToString004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.author: zhaoduwei
*/
it('testToString004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
let gaogao = new uri.URI('http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment');
let res = gaogao.toString();
expect(res).assertEqual('http://gg:gao%E4%BD%A0%E5%A5%BDgao@199.98.55.44:99/path/' +
......@@ -697,22 +697,22 @@ describe('UriTest', function () {
})
/**
* @tc.name: testCheckIsAbsolute001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Tells whether or not this URI is absolute.
* @tc.author: zhaoduwei
*/
it('testCheckIsAbsolute001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
let gaogao = new uri.URI('f/tp://username:password@www.baidu.com:88/path?query#fagment');
let res = gaogao.checkIsAbsolute();
expect(res).assertEqual(false);
})
/**
* @tc.name: testCheckIsAbsolute002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Tells whether or not this URI is absolute.
* @tc.author: zhaoduwei
*/
it('testCheckIsAbsolute002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
let gaogao = new uri.URI('ftp://username:password@www.baidu.com:88/path?query#fagment');
let res = gaogao.checkIsAbsolute();
expect(res).assertEqual(true);
......
......@@ -436,22 +436,22 @@ describe('UrlFunTest', function () {
})
/**
* @tc.name: testUrlGet002
* @tc.name: testUrlForEach002
* @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/
it('testUrlGet002', 0, function () {
it('testUrlForEach002', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2")
var result = params.get("key2")
expect(result).assertEqual("value2")
})
/**
* @tc.name: testUrlGet003
* @tc.name: testUrlForEach003
* @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/
it('testUrlGet003', 0, function () {
it('testUrlForEach003', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2")
params.append("5","JKL")
var result = params.get("5")
......@@ -459,22 +459,22 @@ describe('UrlFunTest', function () {
})
/**
* @tc.name: testUrlGet004
* @tc.name: testUrlForEach004
* @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/
it('testUrlGet004', 0, function () {
it('testUrlForEach004', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2")
var result = params.get("key1")
expect(result).assertEqual("value1")
})
/**
* @tc.name: testUrlGet005
* @tc.name: testUrlForEach005
* @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/
it('testUrlGet005', 0, function () {
it('testUrlForEach005', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2")
params.append("jss","JL")
var result = params.get("jss")
......@@ -893,22 +893,22 @@ describe('UrlFunTest', function () {
})
/**
* @tc.name: testUrlSearchParamsToString001
* @tc.name: testUrlToString001
* @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/
it('testUrlSearchParamsToString001', 0, function () {
it('testUrlToString001', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大")
var result= params.toString()
expect(result).assertEqual("d=value1&c=value2&b=%E5%A4%A7")
})
/**
* @tc.name: testUrlSearchParamsToString002
* @tc.name: testUrlToString002
* @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/
it('testUrlSearchParamsToString002', 0, function () {
it('testUrlToString002', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b= 大")
params.append("1 12","QQQ")
var result= params.toString()
......@@ -916,11 +916,11 @@ describe('UrlFunTest', function () {
})
/**
* @tc.name: testUrlSearchParamsToString003
* @tc.name: testUrlToString003
* @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/
it('testUrlSearchParamsToString003', 0, function () {
it('testUrlToString003', 0, function () {
let params = new Url.URLSearchParams("¥=)")
params.delete("5")
var result= params.toString()
......@@ -928,22 +928,22 @@ describe('UrlFunTest', function () {
})
/**
* @tc.name: testUrlSearchParamsToString004
* @tc.name: testUrlToString004
* @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/
it('testUrlSearchParamsToString004', 0, function () {
it('testUrlToString004', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大&4=key4")
var result= params.toString()
expect(result).assertEqual("d=value1&c=value2&b=%E5%A4%A7&4=key4")
})
/**
* @tc.name: testUrlSearchParamsToString005
* @tc.name: testUrlToString005
* @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/
it('testUrlSearchParamsToString005', 0, function () {
it('testUrlToString005', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b= 大&4=key4&5=key5")
params.append("1 12","QQQ")
var result= params.toString()
......@@ -2064,4 +2064,4 @@ describe('UrlFunTest', function () {
var result = params.searchParams.toString();
expect(result).assertEqual('abc=123&def=456')
})
})
\ No newline at end of file
})}
......@@ -169,12 +169,12 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testUtilPromiseWrapper_new_001
* @tc.name: testUtilPromiseWrapper001
* @tc.desc: Takes a function following the common error-first callback style,
taking an callback as the last argument, and return a function that returns promises.
* @tc.author: shikai
*/
it('testUtilPromiseWrapper_new_001', 0, async function () {
it('testUtilPromiseWrapper001', 0, async function () {
function aysnFun(str, callback) {
if (typeof str === 'string') {
callback(null, str);
......@@ -189,12 +189,12 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testUtilPromiseWrapper_new_002
* @tc.name: testUtilPromiseWrapper002
* @tc.desc: Takes a function following the common error-first callback style,
taking an callback as the last argument, and return a function that returns promises.
* @tc.author: shikai
*/
it('testUtilPromiseWrapper_new_002', 0, async function () {
it('testUtilPromiseWrapper002', 0, async function () {
function aysnFun(str, callback) {
if (typeof str === 'string') {
callback(null, str);
......@@ -209,12 +209,12 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testUtilPromiseWrapper_new_003
* @tc.name: testUtilPromiseWrapper003
* @tc.desc: Takes a function following the common error-first callback style,
taking an callback as the last argument, and return a function that returns promises.
* @tc.author: shikai
*/
it('testUtilPromiseWrapper_new_003', 0, async function () {
it('testUtilPromiseWrapper003', 0, async function () {
function fn(err, val, callback) {
callback(err, val);
}
......@@ -225,12 +225,12 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testUtilPromiseWrapper_new_004
* @tc.name: testUtilPromiseWrapper004
* @tc.desc: Takes a function following the common error-first callback style,
taking an callback as the last argument, and return a function that returns promises.
* @tc.author: shikai
*/
it('testUtilPromiseWrapper_new_004', 0, async function () {
it('testUtilPromiseWrapper004', 0, async function () {
function aysnFun(str1, str2, callback) {
if (typeof str1 === 'string' && typeof str1 === 'string') {
callback(null, str1 + str2);
......@@ -245,12 +245,12 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testUtilPromiseWrapper_new_005
* @tc.name: testUtilPromiseWrapper005
* @tc.desc: Takes a function following the common error-first callback style,
taking an callback as the last argument, and return a function that returns promises.
* @tc.author: shikai
*/
it('testUtilPromiseWrapper_new_005', 0, async function () {
it('testUtilPromiseWrapper005', 0, async function () {
function aysnFun(str1, str2, callback) {
if (typeof str1 === 'string' && typeof str1 === 'string') {
callback(null, str1 + str2);
......@@ -494,55 +494,55 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testencoding_textdecoder_001
* @tc.name: testEncoding001
* @tc.desc: The source encoding's name, lowercased.
* @tc.author: wangben
*/
it('testencoding_textdecoder_001', 0, function () {
it('testEncoding001', 0, function () {
var that = new util.TextDecoder('utf-8', { ignoreBOM : true })
var retStr = that.encoding
expect(retStr).assertEqual('utf-8')
})
/**
* @tc.name: testencoding_textdecoder_002
* @tc.name: testEncoding002
* @tc.desc: The source encoding's name, lowercased.
* @tc.author: wangben
*/
it('testencoding_textdecoder_002', 0, function () {
it('testEncoding002', 0, function () {
var that = new util.TextDecoder('utf-16le')
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16le')
})
/**
* @tc.name: testencoding_textdecoder_003
* @tc.name: testEncoding003
* @tc.desc: The source encoding's name, lowercased.
* @tc.author: wangben
*/
it('testencoding_textdecoder_003', 0, function () {
it('testEncoding003', 0, function () {
var that = new util.TextDecoder('utf-16be')
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
})
/**
* @tc.name: testencoding_textdecoder_004
* @tc.name: testEncoding004
* @tc.desc: The source encoding's name, lowercased.
* @tc.author: wangben
*/
it('testencoding_textdecoder_004', 0, function () {
it('testEncoding004', 0, function () {
var that = new util.TextDecoder('utf-16be', { ignoreBOM : true })
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
})
/**
* @tc.name: testencoding_textdecoder_005
* @tc.name: testEncoding005
* @tc.desc: The source encoding's name, lowercased.
* @tc.author: wangben
*/
it('testencoding_textdecoder_005', 0, function () {
it('testEncoding005', 0, function () {
var that = new util.TextDecoder('utf-16be', { ignoreBOM : false })
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
......@@ -704,11 +704,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testIgnoreBOM007
* @tc.name: testIgnoreBOM006
* @tc.desc: Returns `true` if ignore BOM flag is set, and `false` otherwise.
* @tc.author: wangben
*/
it('testIgnoreBOM007', 0, function () {
it('testIgnoreBOM006', 0, function () {
var that = new util.TextDecoder('gb18030')
var ignoreBOMStr = that.ignoreBOM
expect(ignoreBOMStr).assertEqual(false)
......@@ -726,11 +726,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testdecode_testdecode_001
* @tc.name: testDecode001
* @tc.desc: Returns the result of running encoding's decoder.
* @tc.author: wangben
*/
it('testdecode_testdecode_001', 0, function () {
it('testDecode001', 0, function () {
var that = new util.TextDecoder('utf-8');
var arr = new Uint8Array(3);
for (var i = 0; i < 3; i++) {
......@@ -742,11 +742,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testdecode_testdecode_002
* @tc.name: testDecode002
* @tc.desc: Returns the result of running encoding's decoder.
* @tc.author: wangben
*/
it('testdecode_testdecode_002', 0, function () {
it('testDecode002', 0, function () {
var that = new util.TextDecoder('utf-16le')
var arr = new Uint8Array(6)
arr[0] = 0x61;
......@@ -761,11 +761,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testdecode_testdecode_003
* @tc.name: testDecode003
* @tc.desc: Returns the result of running encoding's decoder.
* @tc.author: wangben
*/
it('testdecode_testdecode_003', 0, function () {
it('testDecode003', 0, function () {
var that = new util.TextDecoder('utf-16be');
var arr = new Uint8Array(6);
arr[0] = 0x00;
......@@ -780,11 +780,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testdecode_testdecode_004
* @tc.name: testDecode004
* @tc.desc: Returns the result of running encoding's decoder.
* @tc.author: wangben
*/
it('testdecode_testdecode_004', 0, function () {
it('testDecode004', 0, function () {
var that = new util.TextDecoder('utf-8', { ignoreBOM : true })
var arr = new Uint8Array(6)
arr[0] = 0xEF;
......@@ -801,11 +801,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testdecode_testdecode_005
* @tc.name: testDecode005
* @tc.desc: Returns the result of running encoding's decoder.
* @tc.author: wangben
*/
it('testdecode_testdecode_005', 0, function () {
it('testDecode005', 0, function () {
var that = new util.TextDecoder('utf-16le', { ignoreBOM : false })
var arr = new Uint8Array(8)
arr[0] = 0xFF;
......@@ -824,11 +824,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testdecode_testdecode_006
* @tc.name: testDecode006
* @tc.desc: Returns the result of running encoding's decoder.
* @tc.author: wangben
*/
it('testdecode_testdecode_006', 0, function () {
it('testDecode006', 0, function () {
var that = new util.TextDecoder('gbk')
var arr = new Uint8Array(8)
arr[0] = 0xC4;
......@@ -845,11 +845,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testdecode_testdecode_007
* @tc.name: testDecode007
* @tc.desc: Returns the result of running encoding's decoder.
* @tc.author: wangben
*/
it('testdecode_testdecode_007', 0, function () {
it('testDecode007', 0, function () {
var that = new util.TextDecoder('gb18030')
var arr = new Uint8Array(8)
arr[0] = 0xC4;
......@@ -866,11 +866,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testdecode_testdecode_008
* @tc.name: testDecode008
* @tc.desc: Returns the result of running encoding's decoder.
* @tc.author: wangben
*/
it('testdecode_testdecode_008', 0, function () {
it('testDecode008', 0, function () {
var that = new util.TextDecoder('gb2312')
var arr = new Uint8Array(8)
arr[0] = 0xC4;
......@@ -887,22 +887,35 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testencoding_textencoder_001
* @tc.name: testGetEncoding001
* @tc.desc: Encoding format.
* @tc.author: wangben
*/
it('testencoding_textencoder_001', 0, function () {
it('testGetEncoding001', 0, function () {
var that = new util.TextEncoder()
var str = that.encoding
expect(str).assertEqual('utf-8')
})
/**
* @tc.name: testencoding_textencoder_002
* @tc.name: testEncode001
* @tc.desc: Returns the result of encoder.
* @tc.author: wangben
*/
it('testEncode001', 0, function () {
var that = new util.TextEncoder()
var buffer = new ArrayBuffer(20)
var result = new Uint8Array(buffer)
result = that.encode('abc')
expect(result[0]).assertEqual(0x61)
})
/**
* @tc.name: testEncoding002
* @tc.desc: Encoding format test gb18030.
* @tc.author: wangben
*/
it('testencoding_textencoder_002', 0, function () {
it('testEncoding002', 0, function () {
let that = new util.TextEncoder('gb18030')
let str = that.encoding
expect(str).assertEqual('gb18030')
......@@ -912,11 +925,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testencoding_textencoder_003
* @tc.name: testEncoding003
* @tc.desc: Encoding format test gbk.
* @tc.author: wangben
*/
it('testencoding_textencoder_003', 0, function () {
it('testEncoding003', 0, function () {
let that = new util.TextEncoder('gbk')
let str = that.encoding
expect(str).assertEqual('gbk')
......@@ -926,11 +939,11 @@ describe('TextEncoderTest', function () {
})
/**
* @tc.name: testencoding_textencoder_004
* @tc.name: testEncoding004
* @tc.desc: Encoding format test gb2313.
* @tc.author: wangben
*/
it('testencoding_textencoder_004', 0, function () {
it('testEncoding004', 0, function () {
let that = new util.TextEncoder('gb2312')
let str = that.encoding
expect(str).assertEqual('gb2312')
......@@ -939,19 +952,6 @@ describe('TextEncoderTest', function () {
expect(str).assertEqual('GB2312')
})
/**
* @tc.name: testEncode001
* @tc.desc: Returns the result of encoder.
* @tc.author: wangben
*/
it('testEncode001', 0, function () {
var that = new util.TextEncoder()
var buffer = new ArrayBuffer(20)
var result = new Uint8Array(buffer)
result = that.encode('abc')
expect(result[0]).assertEqual(0x61)
})
/**
* @tc.name: testEncode002
* @tc.desc: Returns the result of encoder.
......@@ -1287,556 +1287,556 @@ describe('TextEncoderTest', function () {
describe('ScopeTest', function () {
/**
* @tc.name: test_getLower_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Obtains the lower bound of the current range.
* @tc.author: jiangkai
*/
it('test_getLower_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var result = range.getLower()
expect(result.toString()).assertEqual('30')
})
/**
* @tc.name: test_getLower_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Obtains the lower bound of the current range.
* @tc.author: jiangkai
*/
it('test_getLower_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var result = rangeFir.getLower()
expect(result.toString()).assertEqual('35')
})
/**
* @tc.name: test_getLower_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Obtains the lower bound of the current range.
* @tc.author: jiangkai
*/
it('test_getLower_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var result = rangeSec.getLower()
expect(result.toString()).assertEqual('20')
})
/**
* @tc.name: test_getLower_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Obtains the lower bound of the current range.
* @tc.author: jiangkai
*/
it('test_getLower_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var result = rangeThi.getLower()
expect(result.toString()).assertEqual('20')
})
/**
* @tc.name: test_getLower_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Obtains the lower bound of the current range.
* @tc.author: jiangkai
*/
it('test_getLower_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var result = rangeFif.getLower()
expect(result.toString()).assertEqual('35')
})
/**
* @tc.name: test_getUpper_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Obtains the upper bound of the current range.
* @tc.author: jiangkai
*/
it('test_getUpper_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var result = range.getUpper()
expect(result.toString()).assertEqual('40')
})
/**
* @tc.name: test_getUpper_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Obtains the upper bound of the current range.
* @tc.author: jiangkai
*/
it('test_getUpper_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var result = rangeFir.getUpper()
expect(result.toString()).assertEqual('39')
})
/**
* @tc.name: test_getUpper_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Obtains the upper bound of the current range.
* @tc.author: jiangkai
*/
it('test_getUpper_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var result = rangeSec.getUpper()
expect(result.toString()).assertEqual('45')
})
/**
* @tc.name: test_getUpper_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Obtains the upper bound of the current range.
* @tc.author: jiangkai
*/
it('test_getUpper_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var result = rangeThi.getUpper()
expect(result.toString()).assertEqual('35')
})
/**
* @tc.name: test_getUpper_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Obtains the upper bound of the current range.
* @tc.author: jiangkai
*/
it('test_getUpper_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var result = rangeFif.getUpper()
expect(result.toString()).assertEqual('45')
})
/**
* @tc.name: test_clamp_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Clamps a given value to the current range.
* @tc.author: jiangkai
*/
it('test_clamp_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var result =range.clamp(tempLess)
expect(result.toString()).assertEqual('30')
})
/**
* @tc.name: test_clamp_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Clamps a given value to the current range.
* @tc.author: jiangkai
*/
it('test_clamp_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var result =range.clamp(tempMiDF)
expect(result.toString()).assertEqual('35')
})
/**
* @tc.name: test_clamp_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Clamps a given value to the current range.
* @tc.author: jiangkai
*/
it('test_clamp_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var result =range.clamp(tempMore)
expect(result.toString()).assertEqual('40')
})
/**
* @tc.name: test_clamp_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Clamps a given value to the current range.
* @tc.author: jiangkai
*/
it('test_clamp_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var result =range.clamp(tempLower)
expect(result.toString()).assertEqual('30')
})
/**
* @tc.name: test_clamp_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Clamps a given value to the current range.
* @tc.author: jiangkai
*/
it('test_clamp_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var result =range.clamp(tempUpper)
expect(result.toString()).assertEqual('40')
})
/**
* @tc.name: test_contains_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Checks whether a given value is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var result = range.contains(tempLess)
expect(result).assertEqual(false)
})
/**
* @tc.name: test_contains_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Checks whether a given value is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var result = range.contains(tempMiDF)
expect(result).assertEqual(true)
})
/**
* @tc.name: test_contains_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Checks whether a given value is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var result = range.contains(tempMore)
expect(result).assertEqual(false)
})
/**
* @tc.name: test_contains_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Checks whether a given value is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var result = range.contains(tempLower)
expect(result).assertEqual(true)
})
/**
* @tc.name: test_contains_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Checks whether a given value is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var result = range.contains(tempUpper)
expect(result).assertEqual(true)
})
/**
* @tc.name: test_contains_006
* @tc.name: SUB_Runtime_JSAPI_006
* @tc.desc: Checks whether a given range is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_006', 0, function () {
it('SUB_Runtime_JSAPI_006', 0, function () {
var result = range.contains(rangeFir)
expect(result).assertEqual(true)
})
/**
* @tc.name: test_contains_007
* @tc.name: SUB_Runtime_JSAPI_007
* @tc.desc: Checks whether a given range is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_007', 0, function () {
it('SUB_Runtime_JSAPI_007', 0, function () {
var result = range.contains(rangeSec)
expect(result).assertEqual(false)
})
/**
* @tc.name: test_contains_008
* @tc.name: SUB_Runtime_JSAPI_008
* @tc.desc: Checks whether a given range is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_008', 0, function () {
it('SUB_Runtime_JSAPI_008', 0, function () {
var result = range.contains(rangeThi)
expect(result).assertEqual(false)
})
/**
* @tc.name: test_contains_009
* @tc.name: SUB_Runtime_JSAPI_009
* @tc.desc: Checks whether a given range is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_009', 0, function () {
it('SUB_Runtime_JSAPI_009', 0, function () {
var result = range.contains(rangeFif)
expect(result).assertEqual(false)
})
/**
* @tc.name: test_contains_010
* @tc.name: SUB_Runtime_JSAPI_010
* @tc.desc: Checks whether a given range is within the current range.
* @tc.author: jiangkai
*/
it('test_contains_010', 0, function () {
it('SUB_Runtime_JSAPI_010', 0, function () {
var result = range.contains(range)
expect(result).assertEqual(true)
})
/**
* @tc.name: test_expand_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_expand_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var result = range.expand(tempMiDF, tempMidS)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_expand_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_expand_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var result = range.expand(tempLess, tempMore)
expect(result.toString()).assertEqual('[20, 45]')
})
/**
* @tc.name: test_expand_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_expand_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var result = range.expand(tempLess, tempMiDF)
expect(result.toString()).assertEqual('[20, 40]')
})
/**
* @tc.name: test_expand_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_expand_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var result = range.expand(tempMiDF, tempMore)
expect(result.toString()).assertEqual('[30, 45]')
})
/**
* @tc.name: test_expand_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_expand_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var result = range.expand(tempLower, tempUpper)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_expand_006
* @tc.name: SUB_Runtime_JSAPI_006
* @tc.desc: Creates the smallest range that includes the current range and a given range.
* @tc.author: jiangkai
*/
it('test_expand_006', 0, function () {
it('SUB_Runtime_JSAPI_006', 0, function () {
var result = range.expand(rangeFir)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_expand_007
* @tc.name: SUB_Runtime_JSAPI_007
* @tc.desc: Creates the smallest range that includes the current range and a given range.
* @tc.author: jiangkai
*/
it('test_expand_007', 0, function () {
it('SUB_Runtime_JSAPI_007', 0, function () {
var result = range.expand(rangeSec)
expect(result.toString()).assertEqual('[20, 45]')
})
/**
* @tc.name: test_expand_008
* @tc.name: SUB_Runtime_JSAPI_008
* @tc.desc: Creates the smallest range that includes the current range and a given range.
* @tc.author: jiangkai
*/
it('test_expand_008', 0, function () {
it('SUB_Runtime_JSAPI_008', 0, function () {
var result = range.expand(rangeThi)
expect(result.toString()).assertEqual('[20, 40]')
})
/**
* @tc.name: test_expand_009
* @tc.name: SUB_Runtime_JSAPI_009
* @tc.desc: Creates the smallest range that includes the current range and a given range.
* @tc.author: jiangkai
*/
it('test_expand_009', 0, function () {
it('SUB_Runtime_JSAPI_009', 0, function () {
var result = range.expand(rangeFif)
expect(result.toString()).assertEqual('[30, 45]')
})
/**
* @tc.name: test_expand_010
* @tc.name: SUB_Runtime_JSAPI_010
* @tc.desc: Creates the smallest range that includes the current range and a given range.
* @tc.author: jiangkai
*/
it('test_expand_010', 0, function () {
it('SUB_Runtime_JSAPI_010', 0, function () {
var result = range.expand(range)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_expand_011
* @tc.name: SUB_Runtime_JSAPI_011
* @tc.desc: Creates the smallest range that includes the current range and a given value.
* @tc.author: jiangkai
*/
it('test_expand_011', 0, function () {
it('SUB_Runtime_JSAPI_011', 0, function () {
var result = range.expand(tempMiDF)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_expand_012
* @tc.name: SUB_Runtime_JSAPI_012
* @tc.desc: Creates the smallest range that includes the current range and a given value.
* @tc.author: jiangkai
*/
it('test_expand_012', 0, function () {
it('SUB_Runtime_JSAPI_012', 0, function () {
var result = range.expand(tempLess)
expect(result.toString()).assertEqual('[20, 40]')
})
/**
* @tc.name: test_expand_013
* @tc.name: SUB_Runtime_JSAPI_013
* @tc.desc: Creates the smallest range that includes the current range and a given value.
* @tc.author: jiangkai
*/
it('test_expand_013', 0, function () {
it('SUB_Runtime_JSAPI_013', 0, function () {
var result = range.expand(tempMore)
expect(result.toString()).assertEqual('[30, 45]')
})
/**
* @tc.name: test_expand_014
* @tc.name: SUB_Runtime_JSAPI_014
* @tc.desc: Creates the smallest range that includes the current range and a given value.
* @tc.author: jiangkai
*/
it('test_expand_014', 0, function () {
it('SUB_Runtime_JSAPI_014', 0, function () {
var result = range.expand(tempLower)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_expand_015
* @tc.name: SUB_Runtime_JSAPI_015
* @tc.desc: Creates the smallest range that includes the current range and a given value.
* @tc.author: jiangkai
*/
it('test_expand_015', 0, function () {
it('SUB_Runtime_JSAPI_015', 0, function () {
var result = range.expand(tempUpper)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_intersect_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Returns the intersection of a given range and the current range.
* @tc.author: jiangkai
*/
it('test_intersect_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var result = range.intersect(rangeFir)
expect(result.toString()).assertEqual('[35, 39]')
})
/**
* @tc.name: test_intersect_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Returns the intersection of a given range and the current range.
* @tc.author: jiangkai
*/
it('test_intersect_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var result = range.intersect(rangeSec)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_intersect_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Returns the intersection of a given range and the current range.
* @tc.author: jiangkai
*/
it('test_intersect_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var result = range.intersect(rangeThi)
expect(result.toString()).assertEqual('[30, 35]')
})
/**
* @tc.name: test_intersect_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Returns the intersection of a given range and the current range.
* @tc.author: jiangkai
*/
it('test_intersect_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var result = range.intersect(rangeFif)
expect(result.toString()).assertEqual('[35, 40]')
})
/**
* @tc.name: test_intersect_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Returns the intersection of a given range and the current range.
* @tc.author: jiangkai
*/
it('test_intersect_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var result = range.intersect(range)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_intersect_006
* @tc.name: SUB_Runtime_JSAPI_006
* @tc.desc: Returns the intersection of the current range and the range specified by
the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_intersect_006', 0, function () {
it('SUB_Runtime_JSAPI_006', 0, function () {
var result = range.intersect(tempMiDF, tempMidS)
expect(result.toString()).assertEqual('[35, 39]')
})
/**
* @tc.name: test_intersect_007
* @tc.name: SUB_Runtime_JSAPI_007
* @tc.desc: Returns the intersection of the current range and the range specified by
the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_intersect_007', 0, function () {
it('SUB_Runtime_JSAPI_007', 0, function () {
var result = range.intersect(tempLess, tempMore)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_intersect_008
* @tc.name: SUB_Runtime_JSAPI_008
* @tc.desc: Returns the intersection of the current range and the range specified by
the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_intersect_008', 0, function () {
it('SUB_Runtime_JSAPI_008', 0, function () {
var result = range.intersect(tempLess, tempMiDF)
expect(result.toString()).assertEqual('[30, 35]')
})
/**
* @tc.name: test_intersect_009
* @tc.name: SUB_Runtime_JSAPI_009
* @tc.desc: Returns the intersection of the current range and the range specified by
the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_intersect_009', 0, function () {
it('SUB_Runtime_JSAPI_009', 0, function () {
var result = range.intersect(tempMiDF, tempMore)
expect(result.toString()).assertEqual('[35, 40]')
})
/**
* @tc.name: test_intersect_010
* @tc.name: SUB_Runtime_JSAPI_010
* @tc.desc: Returns the intersection of the current range and the range specified by
the given lower and upper bounds.
* @tc.author: jiangkai
*/
it('test_intersect_010', 0, function () {
it('SUB_Runtime_JSAPI_010', 0, function () {
var result = range.intersect(tempLower, tempUpper)
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_toString_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Obtains a string representation of the current range.
* @tc.author: jiangkai
*/
it('test_toString_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var result = range.toString()
expect(result.toString()).assertEqual('[30, 40]')
})
/**
* @tc.name: test_toString_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Obtains a string representation of the current range.
* @tc.author: jiangkai
*/
it('test_toString_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var result = rangeFir.toString()
expect(result.toString()).assertEqual('[35, 39]')
})
/**
* @tc.name: test_toString_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Obtains a string representation of the current range.
* @tc.author: jiangkai
*/
it('test_toString_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var result = rangeSec.toString()
expect(result.toString()).assertEqual('[20, 45]')
})
/**
* @tc.name: test_toString_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Obtains a string representation of the current range.
* @tc.author: jiangkai
*/
it('test_toString_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var result = rangeThi.toString()
expect(result.toString()).assertEqual('[20, 35]')
})
/**
* @tc.name: test_toString_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Obtains a string representation of the current range.
* @tc.author: jiangkai
*/
it('test_toString_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var result = rangeFif.toString()
expect(result.toString()).assertEqual('[35, 45]')
})
......@@ -1845,12 +1845,12 @@ describe('ScopeTest', function () {
describe('Base64Test', function () {
/**
* @tc.name: test_encodeSync_base64_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([115,49,51]);
var rarray = new Uint8Array([99,122,69,122]);
......@@ -1861,12 +1861,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeSync_base64_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]);
var rarray = new Uint8Array([81,109,70,122,90,84,89,48,73,69,53,118,90,71,85,117,97,110,77,61]);
......@@ -1877,12 +1877,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeSync_base64_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,105,
110,32,78,111,100,101,46,106,115]);
......@@ -1895,12 +1895,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeSync_base64_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([168, 174, 155, 255]);
var rarray = new Uint8Array([113,75,54,98,47,119,61,61]);
......@@ -1911,12 +1911,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeSync_base64_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([66, 97, 115, 101, 54, 52]);
var rarray = new Uint8Array([81, 109, 70, 122, 90, 84, 89, 48]);
......@@ -1927,11 +1927,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToStringSync_base64_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToStringSync_base64_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([115,49,51]);
var result = that.encodeToStringSync(array)
......@@ -1939,11 +1939,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToStringSync_base64_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToStringSync_base64_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]);
var result = that.encodeToStringSync(array);
......@@ -1951,11 +1951,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToStringSync_base64_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToStringSync_base64_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,105,110,
32,78,111,100,101,46,106,115]);
......@@ -1964,11 +1964,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToStringSync_base64_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToStringSync_base64_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([168, 174, 155, 255]);
var result = that.encodeToStringSync(array);
......@@ -1976,11 +1976,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToStringSync_base64_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToStringSync_base64_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([66, 97, 115, 101, 54, 52]);
var result = that.encodeToStringSync(array);
......@@ -1988,12 +1988,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var that = new util.Base64()
var buff = 'czEz';
var rarray = new Uint8Array([115,49,51]);
......@@ -2004,12 +2004,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var that = new util.Base64()
var buff = 'QmFzZTY0IE5vZGUuanM=';
var rarray = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]);
......@@ -2020,12 +2020,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var that = new util.Base64()
var buff = 'QmFzZTY0IEVuY29kaW5nIGluIE5vZGUuanM=';
var rarray = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,
......@@ -2037,12 +2037,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var that = new util.Base64()
var buff = 'qK6b/w==';
var rarray = new Uint8Array([168, 174, 155, 255]);
......@@ -2053,12 +2053,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_005
* @tc.name: testDecodeSync005
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_005', 0, function () {
it('testDecodeSync005', 0, function () {
var that = new util.Base64()
var buff = 'QmFzZTY0';
var rarray = new Uint8Array([66, 97, 115, 101, 54, 52]);
......@@ -2069,12 +2069,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_006
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_006', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([99,122,69,122]);
var rarray = new Uint8Array([115,49,51]);
......@@ -2085,12 +2085,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_007
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_007', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,53,118,90,71,85,117,97,110,77,61]);
var rarray = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]);
......@@ -2101,12 +2101,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_008
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_008', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,86,117,89,50,57,107,97,87,
53,110,73,71,108,117,73,69,53,118,90,71,85,117,97,110,77,61]);
......@@ -2119,12 +2119,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_009
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_009', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([113,75,54,98,47,119,61,61]);
var rarray = new Uint8Array([168, 174, 155, 255]);
......@@ -2135,12 +2135,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decodeSync_base64_010
* @tc.name: testDecodeSync005
* @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_decodeSync_base64_010', 0, function () {
it('testDecodeSync005', 0, function () {
var that = new util.Base64()
var array = new Uint8Array([81, 109, 70, 122, 90, 84, 89, 48]);
var rarray = new Uint8Array([66, 97, 115, 101, 54, 52]);
......@@ -2152,12 +2152,12 @@ describe('Base64Test', function () {
//base64 EncodeAsync test
/**
* @tc.name: test_encodeSync_base64_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly
allocated u8 array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_001', 0, async function () {
it('SUB_Runtime_JSAPI_001', 0, async function () {
var that = await new util.Base64();
var array = new Uint8Array([115,49,51]);
var rarray = new Uint8Array([99,122,69,122]);
......@@ -2169,12 +2169,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeSync_base64_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly
allocated u8 array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_002', 0, async function () {
it('SUB_Runtime_JSAPI_002', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]);
var rarray = new Uint8Array([81,109,70,122,90,84,89,48,73,69,53,118,90,71,85,117,97,110,77,61]);
......@@ -2186,12 +2186,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeSync_base64_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_003', 0, async function () {
it('SUB_Runtime_JSAPI_003', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,105,110,32,
78,111,100,101,46,106,115]);
......@@ -2205,12 +2205,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeSync_base64_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_004', 0, async function () {
it('SUB_Runtime_JSAPI_004', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([168, 174, 155, 255]);
var rarray = new Uint8Array([113,75,54,98,47,119,61,61]);
......@@ -2222,12 +2222,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeSync_base64_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8
array using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeSync_base64_005', 0, async function () {
it('SUB_Runtime_JSAPI_005', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([66, 97, 115, 101, 54, 52]);
var rarray = new Uint8Array([81, 109, 70, 122, 90, 84, 89, 48]);
......@@ -2239,11 +2239,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToString_base64_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToString_base64_001', 0, async function () {
it('SUB_Runtime_JSAPI_001', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([115,49,51]);
that.encodeToString(array).then(val=>{
......@@ -2252,11 +2252,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToString_base64_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToString_base64_002', 0, async function () {
it('SUB_Runtime_JSAPI_002', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]);
that.encodeToString(array).then(val=>{
......@@ -2265,11 +2265,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToString_base64_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToString_base64_003', 0, async function () {
it('SUB_Runtime_JSAPI_003', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,86,117,89,50,57,107,97,87,53,110,73,71,108,
117,73,69,53,118,90,71,85,117,97,110,77,61]);
......@@ -2279,11 +2279,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToString_base64_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToString_base64_004', 0, async function () {
it('SUB_Runtime_JSAPI_004', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([168, 174, 155, 255]);
that.encodeToString(array).then(val=>{
......@@ -2292,11 +2292,11 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_encodeToString_base64_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme.
* @tc.author: bihu
*/
it('test_encodeToString_base64_005', 0, async function () {
it('SUB_Runtime_JSAPI_005', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([66, 97, 115, 101, 54, 52]);
that.encodeToString(array).then(val=>{
......@@ -2305,12 +2305,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_001', 0, async function () {
it('SUB_Runtime_JSAPI_001', 0, async function () {
var that = new util.Base64()
var buff = 'czEz';
var array = new Uint8Array([115,49,51]);
......@@ -2322,12 +2322,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_002', 0, async function () {
it('SUB_Runtime_JSAPI_002', 0, async function () {
var that = new util.Base64()
var buff = 'QmFzZTY0IE5vZGUuanM=';
var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]);
......@@ -2339,12 +2339,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_003', 0, async function () {
it('SUB_Runtime_JSAPI_003', 0, async function () {
var that = new util.Base64()
var buff = 'QmFzZTY0IEVuY29kaW5nIGluIE5vZGUuanM=';
var array = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,105,110,32,78,
......@@ -2357,12 +2357,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_004', 0, async function () {
it('SUB_Runtime_JSAPI_004', 0, async function () {
var that = new util.Base64()
var buff = 'qK6b/w==';
var array = new Uint8Array([168, 174, 155, 255]);
......@@ -2374,12 +2374,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_005
* @tc.name: testDecode005
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_005', 0, async function () {
it('testDecode005', 0, async function () {
var that = new util.Base64()
var buff = 'QmFzZTY0';
var rarray = new Uint8Array([66, 97, 115, 101, 54, 52]);
......@@ -2391,12 +2391,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_006
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_006', 0, async function () {
it('SUB_Runtime_JSAPI_001', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([99,122,69,122]);
var rarray = new Uint8Array([115,49,51]);
......@@ -2408,12 +2408,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_007
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_007', 0, async function () {
it('SUB_Runtime_JSAPI_002', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,53,118,90,71,85,117,97,110,77,61]);
var rarray = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]);
......@@ -2425,12 +2425,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_008
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_008', 0, async function () {
it('SUB_Runtime_JSAPI_003', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,86,117,89,50,57,107,97,87,53,110,73,71,108,
117,73,69,53,118,90,71,85,117,97,110,77,61]);
......@@ -2444,12 +2444,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_009
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array
into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_009', 0, async function () {
it('SUB_Runtime_JSAPI_004', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([113,75,54,98,47,119,61,61]);
var rarray = new Uint8Array([168, 174, 155, 255]);
......@@ -2461,12 +2461,12 @@ describe('Base64Test', function () {
})
/**
* @tc.name: test_decode_base64_010
* @tc.name: testDecode005
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
* @tc.author: bihu
*/
it('test_decode_base64_010', 0, async function () {
it('testDecode005', 0, async function () {
var that = new util.Base64()
var array = new Uint8Array([81, 109, 70, 122, 90, 84, 89, 48]);
var rarray = new Uint8Array([66, 97, 115, 101, 54, 52]);
......@@ -2481,11 +2481,11 @@ describe('Base64Test', function () {
describe('RationalNumberFunTest', function () {
/**
* @tc.name: test_createRationalFromString_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Creates a RationalNumber object based on a given string.
* @tc.author: liuqiang
*/
it('test_createRationalFromString_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('-1:2')
var result1 = res.valueOf()
......@@ -2493,11 +2493,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_createRationalFromString_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Creates a RationalNumber object based on a given string.
* @tc.author: liuqiang
*/
it('test_createRationalFromString_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+3/4')
var result1 = res.valueOf()
......@@ -2505,11 +2505,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_createRationalFromString_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Creates a RationalNumber object based on a given string.
* @tc.author: liuqiang
*/
it('test_createRationalFromString_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+3:-4')
var result1 = res.valueOf()
......@@ -2517,11 +2517,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_createRationalFromString_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Creates a RationalNumber object based on a given string.
* @tc.author: liuqiang
*/
it('test_createRationalFromString_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+2:4')
var result1 = res.valueOf()
......@@ -2529,11 +2529,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_createRationalFromString_005
* @tc.name: testRationalNumberCreateRationalFromString005
* @tc.desc: Creates a RationalNumber object based on a given string.
* @tc.author: liuqiang
*/
it('test_createRationalFromString_005', 0, function () {
it('testRationalNumberCreateRationalFromString005', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+2:-4')
var result1 = res.valueOf()
......@@ -2541,11 +2541,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_compareTo_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Compares the current RationalNumber object with a given object.
* @tc.author: liuqiang
*/
it('test_compareTo_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(2, 1)
var proc = new util.RationalNumber(3, 4)
var res = pro.compareTo(proc)
......@@ -2553,11 +2553,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_compareTo_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Compares the current RationalNumber object with a given object.
* @tc.author: liuqiang
*/
it('test_compareTo_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(2, 1)
var proc = new util.RationalNumber(0, 0)
var res = pro.compareTo(proc)
......@@ -2565,11 +2565,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_compareTo_003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Compares the current RationalNumber object with a given object.
* @tc.author: liuqiang
*/
it('test_compareTo_003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var pro = new util.RationalNumber(2, 1)
var proc = new util.RationalNumber(8, 3)
var res = pro.compareTo(proc)
......@@ -2577,11 +2577,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_compareTo_004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Compares the current RationalNumber object with a given object.
* @tc.author: liuqiang
*/
it('test_compareTo_004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(2, 1)
var proc = new util.RationalNumber(2, 1)
var res = pro.compareTo(proc)
......@@ -2589,11 +2589,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_compareTo_005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Compares the current RationalNumber object with a given object.
* @tc.author: liuqiang
*/
it('test_compareTo_005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var pro = new util.RationalNumber(0, 0)
var proc = new util.RationalNumber(2, 1)
var res = pro.compareTo(proc)
......@@ -2601,11 +2601,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_equals_001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Checks whether a given object is the same as the current RationalNumber object.
* @tc.author: liuqiang
*/
it('test_equals_001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(2, 1)
var proc = new util.RationalNumber(3, 4)
var res = pro.equals(proc)
......@@ -2613,11 +2613,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_equals_002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Checks whether a given object is the same as the current RationalNumber object.
* @tc.author: liuqiang
*/
it('test_equals_002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(2, 1)
var proc = new util.RationalNumber(4, 2)
var res = pro.equals(proc)
......@@ -2625,11 +2625,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_equals_003
* @tc.name: testRationalNumberEquals003
* @tc.desc: Checks whether a given object is the same as the current RationalNumber object.
* @tc.author: liuqiang
*/
it('test_equals_003', 0, function () {
it('testRationalNumberEquals003', 0, function () {
var pro = new util.RationalNumber(0, 1)
var proc = new util.RationalNumber(0, 2)
var res = pro.equals(proc)
......@@ -2637,11 +2637,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_equals_004
* @tc.name: testRationalNumberEquals004
* @tc.desc: Checks whether a given object is the same as the current RationalNumber object.
* @tc.author: liuqiang
*/
it('test_equals_004', 0, function () {
it('testRationalNumberEquals004', 0, function () {
var pro = new util.RationalNumber(0, 0)
var proc = new util.RationalNumber(0, 2)
var res = pro.equals(proc)
......@@ -2649,11 +2649,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: test_equals_005
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Checks whether a given object is the same as the current RationalNumber object.
* @tc.author: liuqiang
*/
it('test_equals_005', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(-2, 0)
var proc = new util.RationalNumber(2, 0)
var res = pro.equals(proc)
......@@ -2672,11 +2672,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: testRationalNumberValueOf002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Obtains the value of the current RationalNumber object as a number.
* @tc.author: liuqiang
*/
it('testRationalNumberValueOf002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(2, 10)
var res = pro.valueOf()
expect(res).assertEqual(0.2)
......@@ -2694,11 +2694,11 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: testRationalNumberValueOf004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Obtains the value of the current RationalNumber object as a number.
* @tc.author: liuqiang
*/
it('testRationalNumberValueOf004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(4, 2)
var res = pro.valueOf()
expect(res).assertEqual(2)
......@@ -2716,341 +2716,341 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: testGetCommonDivisor001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
* @tc.author: liuqiang
*/
it('testGetCommonDivisor001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(0, 0)
var res = pro.getCommonDivisor(4, 8)
expect(res).assertEqual(4)
})
/**
* @tc.name: testGetCommonDivisor002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
* @tc.author: liuqiang
*/
it('testGetCommonDivisor002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(0, 0)
var res = pro.getCommonDivisor(10, 15)
expect(res).assertEqual(5)
})
/**
* @tc.name: testGetCommonDivisor003
* @tc.name: testRationalNumberGetCommonDivisor003
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
* @tc.author: liuqiang
*/
it('testGetCommonDivisor003', 0, function () {
it('testRationalNumberGetCommonDivisor003', 0, function () {
var pro = new util.RationalNumber(0, 0)
var res = pro.getCommonDivisor(8, 4)
expect(res).assertEqual(4)
})
/**
* @tc.name: testGetCommonDivisor004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
* @tc.author: liuqiang
*/
it('testGetCommonDivisor004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(0, 0)
var res = pro.getCommonDivisor(8, 16)
expect(res).assertEqual(8)
})
/**
* @tc.name: testGetCommonDivisor005
* @tc.name: testRationalNumberGetCommonDivisor005
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
* @tc.author: liuqiang
*/
it('testGetCommonDivisor005', 0, function () {
it('testRationalNumberGetCommonDivisor005', 0, function () {
var pro = new util.RationalNumber(0, 0)
var res = pro.getCommonDivisor(2, 16)
expect(res).assertEqual(2)
})
/**
* @tc.name: testGetDenominator001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Obtains the denominator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetDenominator001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(2, 1)
var res = pro.getDenominator()
expect(res).assertEqual(1)
})
/**
* @tc.name: testGetDenominator002
* @tc.name: testRationalNumberGetDenominator002
* @tc.desc: Obtains the denominator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetDenominator002', 0, function () {
it('testRationalNumberGetDenominator002', 0, function () {
var pro = new util.RationalNumber(2, 3)
var res = pro.getDenominator()
expect(res).assertEqual(3)
})
/**
* @tc.name: testGetDenominator003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Obtains the denominator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetDenominator003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var pro = new util.RationalNumber(2, 0)
var res = pro.getDenominator()
expect(res).assertEqual(0)
})
/**
* @tc.name: testGetDenominator004
* @tc.name: testRationalNumberGetDenominator004
* @tc.desc: Obtains the denominator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetDenominator004', 0, function () {
it('testRationalNumberGetDenominator004', 0, function () {
var pro = new util.RationalNumber(10, 5)
var res = pro.getDenominator()
expect(res).assertEqual(1)
})
/**
* @tc.name: testGetDenominator005
* @tc.name: testRationalNumberGetDenominator005
* @tc.desc: Obtains the denominator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetDenominator005', 0, function () {
it('testRationalNumberGetDenominator005', 0, function () {
var pro = new util.RationalNumber(6, 3)
var res = pro.getDenominator()
expect(res).assertEqual(1)
})
/**
* @tc.name: testGetDenominator006
* @tc.name: SUB_Runtime_JSAPI_006
* @tc.desc: Obtains the denominator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetDenominator006', 0, function () {
it('SUB_Runtime_JSAPI_006', 0, function () {
var pro = new util.RationalNumber(6, -3)
var res = pro.getDenominator()
expect(res).assertEqual(1)
})
/**
* @tc.name: testGetNumerator001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Obtains the numerator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetNumerator001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(-2, 1)
var res = pro.getNumerator()
expect(res).assertEqual(-2)
})
/**
* @tc.name: testGetNumerator002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Obtains the numerator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetNumerator002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(0, 3)
var res = pro.getNumerator()
expect(res).assertEqual(0)
})
/**
* @tc.name: testGetNumerator003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Obtains the numerator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetNumerator003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var pro = new util.RationalNumber(2, 4)
var res = pro.getNumerator()
expect(res).assertEqual(1)
})
/**
* @tc.name: testGetNumerator004
* @tc.name: testRationalNumberGetNumerator004
* @tc.desc: Obtains the numerator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetNumerator004', 0, function () {
it('testRationalNumberGetNumerator004', 0, function () {
var pro = new util.RationalNumber(3, 6)
var res = pro.getNumerator()
expect(res).assertEqual(1)
})
/**
* @tc.name: testGetNumerator005
* @tc.name: testRationalNumberGetNumerator005
* @tc.desc: Obtains the numerator of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testGetNumerator005', 0, function () {
it('testRationalNumberGetNumerator005', 0, function () {
var pro = new util.RationalNumber(10, 5)
var res = pro.getNumerator()
expect(res).assertEqual(2)
})
/**
* @tc.name: testisFinite001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Checks whether the current RationalNumber object represents a finite value.
* @tc.author: liuqiang
*/
it('testisFinite001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(-2, 1)
var res = pro.isFinite()
expect(res).assertEqual(true)
})
/**
* @tc.name: testisFinite002
* @tc.name: testRationalNumberIsFinite002
* @tc.desc: Checks whether the current RationalNumber object represents a finite value.
* @tc.author: liuqiang
*/
it('testisFinite002', 0, function () {
it('testRationalNumberIsFinite002', 0, function () {
var pro = new util.RationalNumber(0, 3)
var res = pro.isFinite()
expect(res).assertEqual(true)
})
/**
* @tc.name: testisFinite003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Checks whether the current RationalNumber object represents a finite value.
* @tc.author: liuqiang
*/
it('testisFinite003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var pro = new util.RationalNumber(2, 0)
var res = pro.isFinite()
expect(res).assertEqual(false)
})
/**
* @tc.name: testisFinite004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Checks whether the current RationalNumber object represents a finite value.
* @tc.author: liuqiang
*/
it('testisFinite004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(1, 3)
var res = pro.isFinite()
expect(res).assertEqual(true)
})
/**
* @tc.name: testisFinite005
* @tc.name: testRationalNumberIsFinite005
* @tc.desc: Checks whether the current RationalNumber object represents a finite value.
* @tc.author: liuqiang
*/
it('testisFinite005', 0, function () {
it('testRationalNumberIsFinite005', 0, function () {
var pro = new util.RationalNumber(10, 5)
var res = pro.isFinite()
expect(res).assertEqual(true)
})
/**
* @tc.name: testisNaN001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Checks whether the current RationalNumber object represents a finite value.
* @tc.author: liuqiang
*/
it('testisNaN001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(-2, 1)
var res = pro.isNaN()
expect(res).assertEqual(false)
})
/**
* @tc.name: testisNaN002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value.
* @tc.author: liuqiang
*/
it('testisNaN002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(0, 3)
var res = pro.isNaN()
expect(res).assertEqual(false)
})
/**
* @tc.name: testisNaN003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value.
* @tc.author: liuqiang
*/
it('testisNaN003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var pro = new util.RationalNumber(0, 0)
var res = pro.isNaN()
expect(res).assertEqual(true)
})
/**
* @tc.name: testisNaN004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value.
* @tc.author: liuqiang
*/
it('testisNaN004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(10, 0)
var res = pro.isNaN()
expect(res).assertEqual(false)
})
/**
* @tc.name: testisNaN005
* @tc.name: testRationalNumberIsNaN005
* @tc.desc: Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value.
* @tc.author: liuqiang
*/
it('testisNaN005', 0, function () {
it('testRationalNumberIsNaN005', 0, function () {
var pro = new util.RationalNumber(10, 1)
var res = pro.isNaN()
expect(res).assertEqual(false)
})
/**
* @tc.name: testisZero001
* @tc.name: SUB_Runtime_JSAPI_001
* @tc.desc: Checks whether the current RationalNumber object represents the value 0.
* @tc.author: liuqiang
*/
it('testisZero001', 0, function () {
it('SUB_Runtime_JSAPI_001', 0, function () {
var pro = new util.RationalNumber(-2, 1)
var res = pro.isZero()
expect(res).assertEqual(false)
})
/**
* @tc.name: testisZero002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Checks whether the current RationalNumber object represents the value 0.
* @tc.author: liuqiang
*/
it('testisZero002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(0, 3)
var res = pro.isZero()
expect(res).assertEqual(true)
})
/**
* @tc.name: testisZero003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Checks whether the current RationalNumber object represents the value 0.
* @tc.author: liuqiang
*/
it('testisZero003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var pro = new util.RationalNumber(0, 0)
var res = pro.isZero()
expect(res).assertEqual(false)
})
/**
* @tc.name: testisZero004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Checks whether the current RationalNumber object represents the value 0.
* @tc.author: liuqiang
*/
it('testisZero004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(10, 2)
var res = pro.isZero()
expect(res).assertEqual(false)
})
/**
* @tc.name: testisZero005
* @tc.name: testRationalNumberIsZero005
* @tc.desc: Checks whether the current RationalNumber object represents the value 0.
* @tc.author: liuqiang
*/
it('testisZero005', 0, function () {
it('testRationalNumberIsZero005', 0, function () {
var pro = new util.RationalNumber(1, 1)
var res = pro.isZero()
expect(res).assertEqual(false)
......@@ -3068,44 +3068,44 @@ describe('RationalNumberFunTest', function () {
})
/**
* @tc.name: testRationalNumberToString002
* @tc.name: SUB_Runtime_JSAPI_002
* @tc.desc: Obtains a string representation of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testRationalNumberToString002', 0, function () {
it('SUB_Runtime_JSAPI_002', 0, function () {
var pro = new util.RationalNumber(0, 0)
var res = pro.toString()
expect(res).assertEqual("NaN")
})
/**
* @tc.name: testRationalNumberToString003
* @tc.name: SUB_Runtime_JSAPI_003
* @tc.desc: Obtains a string representation of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testRationalNumberToString003', 0, function () {
it('SUB_Runtime_JSAPI_003', 0, function () {
var pro = new util.RationalNumber(3, 0)
var res = pro.toString()
expect(res).assertEqual("Infinity")
})
/**
* @tc.name: testRationalNumberToString004
* @tc.name: SUB_Runtime_JSAPI_004
* @tc.desc: Obtains a string representation of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testRationalNumberToString004', 0, function () {
it('SUB_Runtime_JSAPI_004', 0, function () {
var pro = new util.RationalNumber(-3, 0)
var res = pro.toString()
expect(res).assertEqual("-Infinity")
})
/**
* @tc.name: testRationalNumberToString005
* @tc.name: SUB_Runtime_JSAPI_005
* @tc.desc: Obtains a string representation of the current RationalNumber object.
* @tc.author: liuqiang
*/
it('testRationalNumberToString005', 0, function () {
it('SUB_Runtime_JSAPI_005', 0, function () {
var pro = new util.RationalNumber(2, 3)
var res = pro.toString()
expect(res).assertEqual('2/3')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册