提交 1ec68330 编写于 作者: J jiangkai43

Modify the test case of rationalnumber and some test case names

https://gitee.com/openharmony/xts_acts/issues/I62GKASigned-off-by: Njiangkai43 <jiangkai43@huawei.com>
上级 63e674ec
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import util from '@ohos.util' import util from '@ohos.util'
import url from '@ohos.url'
import app from '@system.app'
import process from '@ohos.process'
import file from '@system.file';
class Temperature { class Temperature {
constructor(value) { constructor(value) {
...@@ -3317,7 +3313,7 @@ describe('FunctionTest', function () { ...@@ -3317,7 +3313,7 @@ describe('FunctionTest', function () {
}) })
/** /**
* @tc.name: testUtilformat001 * @tc.name: testUtilformatThrowError001
* @tc.desc: Returns the formatted string. * @tc.desc: Returns the formatted string.
*/ */
it('testUtilformatThrowError001', 0, function () { it('testUtilformatThrowError001', 0, function () {
...@@ -4112,11 +4108,11 @@ describe('Base64HelperTest', function () { ...@@ -4112,11 +4108,11 @@ describe('Base64HelperTest', function () {
}) })
/** /**
* @tc.name: test_encodeSync_base64_005 * @tc.name: test_encodeSync_base64_throwError_001
* @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 * @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8
array using the Base64 encoding scheme. array using the Base64 encoding scheme.
*/ */
it('test_encodeSync_base64_005', 0, async function () { it('test_encodeSync_base64_throwError_001', 0, async function () {
try { try {
var that = new util.Base64Helper() var that = new util.Base64Helper()
var array = new Uint32Array([66, 97, 115, 101, 54, 52]); var array = new Uint32Array([66, 97, 115, 101, 54, 52]);
...@@ -4365,11 +4361,11 @@ describe('Base64HelperTest', function () { ...@@ -4365,11 +4361,11 @@ describe('Base64HelperTest', function () {
}) })
/** /**
* @tc.name: test_decode_base64_011 * @tc.name: test_decode_base64_throwError_001
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array. array into a newly allocated u8 array.
*/ */
it('test_decode_base64_006', 0, async function () { it('test_decode_base64_throwError_001', 0, async function () {
try { try {
var that = new util.Base64Helper() var that = new util.Base64Helper()
var array = new Uint16Array([99,122,69,122]); var array = new Uint16Array([99,122,69,122]);
...@@ -4467,10 +4463,10 @@ describe('DecodeEncodeTest', function () { ...@@ -4467,10 +4463,10 @@ describe('DecodeEncodeTest', function () {
}) })
/** /**
* @tc.name: testencoding_textdecoder_ThrowError_002 * @tc.name: testencoding_textdecoder_ThrowError_003
* @tc.desc: The source encoding's name, lowercased. * @tc.desc: The source encoding's name, lowercased.
*/ */
it('testencoding_textdecoder_ThrowError_002', 0, function () { it('testencoding_textdecoder_ThrowError_003', 0, function () {
try { try {
var that = new util.TextDecoder() var that = new util.TextDecoder()
that.create('utf-16be', 123) that.create('utf-16be', 123)
...@@ -4598,7 +4594,7 @@ describe('DecodeEncodeTest', function () { ...@@ -4598,7 +4594,7 @@ describe('DecodeEncodeTest', function () {
* @tc.name: testEncodeInto010 * @tc.name: testEncodeInto010
* @tc.desc: Returns the result of encoder for GB18030. * @tc.desc: Returns the result of encoder for GB18030.
*/ */
it('testEncodeInto0010', 0, function () { it('testEncodeInto010', 0, function () {
let that = new util.TextEncoder('GB18030') let that = new util.TextEncoder('GB18030')
let buffer = new ArrayBuffer(20) let buffer = new ArrayBuffer(20)
let result = new Uint8Array(buffer) let result = new Uint8Array(buffer)
......
...@@ -46,12 +46,6 @@ var rangeSec = new util.Scope(tempLess, tempMore); ...@@ -46,12 +46,6 @@ var rangeSec = new util.Scope(tempLess, tempMore);
var rangeThi = new util.Scope(tempLess, tempMiDF); var rangeThi = new util.Scope(tempLess, tempMiDF);
var rangeFif = new util.Scope(tempMiDF, tempMore); var rangeFif = new util.Scope(tempMiDF, tempMore);
var rangeHp = new util.ScopeHelper(tempLower, tempUpper);
var rangeHpFir = new util.ScopeHelper(tempMiDF, tempMidS);
var rangeHpSec = new util.ScopeHelper(tempLess, tempMore);
var rangeHpThi = new util.ScopeHelper(tempLess, tempMiDF);
var rangeHpFif = new util.ScopeHelper(tempMiDF, tempMore);
export default function UtilFunTest() { export default function UtilFunTest() {
describe('TextEncoderTest', function () { describe('TextEncoderTest', function () {
...@@ -2448,9 +2442,9 @@ describe('RationalNumberFunTest', function () { ...@@ -2448,9 +2442,9 @@ describe('RationalNumberFunTest', function () {
*/ */
it('test_createRationalFromString_005', 0, function () { it('test_createRationalFromString_005', 0, function () {
var pro = new util.RationalNumber(1, 2) var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+2:-4') var res = pro.createRationalFromString('-2:-4')
var result1 = res.valueOf() var result1 = res.valueOf()
expect(result1).assertEqual(-0.5) expect(result1).assertEqual(0.5)
}) })
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册