提交 b4488d23 编写于 作者: H hu0475

完成startup子系统deviceinfo模块的跨平台测试套

Signed-off-by: Nhu0475 <huyanqiang5@huawei.com>
上级 04cbce8d
...@@ -13,35 +13,30 @@ ...@@ -13,35 +13,30 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import deviceinfo from '@ohos.deviceInfo' import deviceinfo from "@ohos.deviceInfo";
export default function DeviceInfoTest() { export default function DeviceInfoTest() {
describe('DeviceInfoTest', function () { describe("DeviceInfoTest", function () {
const MAX_CHARACTERS_NUM_ONE = 33; const MAX_CHARACTERS_NUM_ONE = 33;
const MAX_CHARACTERS_NUM_TWO = 65; const MAX_CHARACTERS_NUM_TWO = 65;
const MAX_CHARACTERS_NUM = 0; const MAX_CHARACTERS_NUM = 0;
beforeAll(function () { beforeAll(function () {
console.info('beforeAll: Prerequisites at the test suite level, which are executed before the test suite is executed.'); console.info("beforeAll: Prerequisites at the test suite level, which are executed before the test suite is executed.");
});
})
beforeEach(function () { beforeEach(function () {
console.info('beforeEach: Prerequisites at the test case level, which are executed before each test case is executed.'); console.info("beforeEach: Prerequisites at the test case level, which are executed before each test case is executed.");
});
})
afterEach(function () { afterEach(function () {
console.info('afterEach: Test case-level clearance conditions, which are executed after each test case is executed.'); console.info("afterEach: Test case-level clearance conditions, which are executed after each test case is executed.");
});
})
afterAll(function () { afterAll(function () {
console.info('afterAll: Test suite-level cleanup condition, which is executed after the test suite is executed'); console.info("afterAll: Test suite-level cleanup condition, which is executed after the test suite is executed");
});
})
console.info('start################################start'); console.info("start################################start");
/** /**
* @tc.number DEVICE_INFO_TEST_001 * @tc.number DEVICE_INFO_TEST_001
...@@ -51,19 +46,19 @@ export default function DeviceInfoTest() { ...@@ -51,19 +46,19 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest001', 0, function () { it("deviceInfoTest001", 0, function () {
console.info('device_info_test_001 start'); console.info("device_info_test_001 start");
let ret = false; let ret = false;
let deviceTypeInfo = deviceinfo.deviceType; let deviceTypeInfo = deviceinfo.deviceType;
console.info('the value of the deviceType is :' + deviceTypeInfo); console.info("the value of the deviceType is :" + deviceTypeInfo);
expect(deviceTypeInfo).assertInstanceOf('String'); expect(deviceTypeInfo).assertInstanceOf("String");
if (deviceTypeInfo != "" && deviceTypeInfo != null && deviceTypeInfo != undefined) { if (deviceTypeInfo != "" && deviceTypeInfo != null && deviceTypeInfo != undefined) {
ret = true; ret = true;
} }
expect(ret).assertTrue() expect(ret).assertTrue();
console.info('device_info_test_001 : end'); console.info("device_info_test_001 : end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_002 * @tc.number DEVICE_INFO_TEST_002
...@@ -73,25 +68,25 @@ export default function DeviceInfoTest() { ...@@ -73,25 +68,25 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest002', 0, function () { it("deviceInfoTest002", 0, function () {
console.info('device_info_test_002 start'); console.info("device_info_test_002 start");
let manufactureInfo = deviceinfo.manufacture; let manufactureInfo = deviceinfo.manufacture;
console.info('the value of the manufactureInfo is :' + manufactureInfo); console.info("the value of the manufactureInfo is :" + manufactureInfo);
expect(manufactureInfo).assertInstanceOf('String'); expect(manufactureInfo).assertInstanceOf("String");
if (manufactureInfo != "" && manufactureInfo != null && manufactureInfo != undefined) { if (manufactureInfo != "" && manufactureInfo != null && manufactureInfo != undefined) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = manufactureInfo.match(str); let arr = manufactureInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(manufactureInfo).assertEqual(bufferstr); expect(manufactureInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('device_info_test_002 :end'); console.info("device_info_test_002 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_003 * @tc.number DEVICE_INFO_TEST_003
...@@ -101,26 +96,26 @@ export default function DeviceInfoTest() { ...@@ -101,26 +96,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest003', 0, function () { it("deviceInfoTest003", 0, function () {
console.info('testGetDeviceBrand01 start'); console.info("testGetDeviceBrand01 start");
let brandInfo = deviceinfo.brand; let brandInfo = deviceinfo.brand;
console.info('the value of the device brand is :' + brandInfo); console.info("the value of the device brand is :" + brandInfo);
expect(brandInfo).assertInstanceOf('String'); expect(brandInfo).assertInstanceOf("String");
if (brandInfo != "" && brandInfo != null && brandInfo != undefined) { if (brandInfo != "" && brandInfo != null && brandInfo != undefined) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = brandInfo.match(str); let arr = brandInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(brandInfo).assertEqual(bufferstr); expect(brandInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetDeviceBrand01 :end'); console.info("testGetDeviceBrand01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_004 * @tc.number DEVICE_INFO_TEST_004
...@@ -130,20 +125,19 @@ export default function DeviceInfoTest() { ...@@ -130,20 +125,19 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest004', 0, function () { it("deviceInfoTest004", 0, function () {
console.info('testGetMarketName01 start') console.info("testGetMarketName01 start");
let ret = false; let ret = false;
let marketNameInfo = deviceinfo.marketName; let marketNameInfo = deviceinfo.marketName;
console.info('the value of the deviceinfo marketName is :' + marketNameInfo); console.info("the value of the deviceinfo marketName is :" + marketNameInfo);
expect(marketNameInfo).assertInstanceOf('String'); expect(marketNameInfo).assertInstanceOf("String");
if (marketNameInfo != "" && marketNameInfo != null && marketNameInfo != undefined) { if (marketNameInfo != "" && marketNameInfo != null && marketNameInfo != undefined) {
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetMarketName01 :end'); console.info("testGetMarketName01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_005 * @tc.number DEVICE_INFO_TEST_005
...@@ -153,26 +147,26 @@ export default function DeviceInfoTest() { ...@@ -153,26 +147,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest005', 0, function () { it("deviceInfoTest005", 0, function () {
console.info('testGetProductSeries01 start'); console.info("testGetProductSeries01 start");
let productSeriesInfo = deviceinfo.productSeries; let productSeriesInfo = deviceinfo.productSeries;
console.info('the value of the deviceinfo productSeries is :' + productSeriesInfo); console.info("the value of the deviceinfo productSeries is :" + productSeriesInfo);
expect(productSeriesInfo).assertInstanceOf('String'); expect(productSeriesInfo).assertInstanceOf("String");
if (productSeriesInfo != "" && productSeriesInfo != null && productSeriesInfo != undefined) { if (productSeriesInfo != "" && productSeriesInfo != null && productSeriesInfo != undefined) {
let str = /[\w-\.\(\)\s]/g; let str = /[\w-\.\(\)\s:;~/]/g;
let arr = productSeriesInfo.match(str); let arr = productSeriesInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(productSeriesInfo).assertEqual(bufferstr); expect(productSeriesInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetProductSeries01 :end'); console.info("testGetProductSeries01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_006 * @tc.number DEVICE_INFO_TEST_006
...@@ -182,20 +176,19 @@ export default function DeviceInfoTest() { ...@@ -182,20 +176,19 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest006', 0, function () { it("deviceInfoTest006", 0, function () {
console.info('testGetProductModel01 start'); console.info("testGetProductModel01 start");
let ret = false; let ret = false;
let productModelInfo = deviceinfo.productModel; let productModelInfo = deviceinfo.productModel;
console.info('the value of the deviceinfo productModel is :' + productModelInfo); console.info("the value of the deviceinfo productModel is :" + productModelInfo);
expect(productModelInfo).assertInstanceOf('String'); expect(productModelInfo).assertInstanceOf("String");
if (productModelInfo != "" && productModelInfo != null && productModelInfo != undefined) { if (productModelInfo != "" && productModelInfo != null && productModelInfo != undefined) {
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetProductModel01 : end'); console.info("testGetProductModel01 : end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_007 * @tc.number DEVICE_INFO_TEST_007
...@@ -205,26 +198,26 @@ export default function DeviceInfoTest() { ...@@ -205,26 +198,26 @@ export default function DeviceInfoTest() {
* @tc.type : const * @tc.type : const
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest007', 0, function () { it("deviceInfoTest007", 0, function () {
console.info('testGetSoftwareModel01 start'); console.info("testGetSoftwareModel01 start");
let softwareModelInfo = deviceinfo.softwareModel; let softwareModelInfo = deviceinfo.softwareModel;
console.info('the value of the deviceinfo softwareModel is :' + softwareModelInfo); console.info("the value of the deviceinfo softwareModel is :" + softwareModelInfo);
expect(softwareModelInfo).assertInstanceOf('String'); expect(softwareModelInfo).assertInstanceOf("String");
if (softwareModelInfo != "" && softwareModelInfo != null && softwareModelInfo != undefined) { if (softwareModelInfo != "" && softwareModelInfo != null && softwareModelInfo != undefined) {
let str = /[\w-\.\(\)\s]/g; let str = /[\w-\.\(\)\s]/g;
let arr = softwareModelInfo.match(str); let arr = softwareModelInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(softwareModelInfo).assertEqual(bufferstr); expect(softwareModelInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetSoftwareModel01 :end'); console.info("testGetSoftwareModel01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_008 * @tc.number DEVICE_INFO_TEST_008
...@@ -234,26 +227,26 @@ export default function DeviceInfoTest() { ...@@ -234,26 +227,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest008', 0, function () { it("deviceInfoTest008", 0, function () {
console.info('testGetHardWareModel01 start'); console.info("testGetHardWareModel01 start");
let hardwareModelInfo = deviceinfo.hardwareModel; let hardwareModelInfo = deviceinfo.hardwareModel;
console.info('the value of the deviceinfo hardwareModel is :' + hardwareModelInfo); console.info("the value of the deviceinfo hardwareModel is :" + hardwareModelInfo);
expect(hardwareModelInfo).assertInstanceOf('String'); expect(hardwareModelInfo).assertInstanceOf("String");
if (hardwareModelInfo != "" && hardwareModelInfo != null && hardwareModelInfo != undefined) { if (hardwareModelInfo != "" && hardwareModelInfo != null && hardwareModelInfo != undefined) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = hardwareModelInfo.match(str); let arr = hardwareModelInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(hardwareModelInfo).assertEqual(bufferstr); expect(hardwareModelInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetHardWareModel01 :end'); console.info("testGetHardWareModel01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_009 * @tc.number DEVICE_INFO_TEST_009
...@@ -263,26 +256,26 @@ export default function DeviceInfoTest() { ...@@ -263,26 +256,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest009', 0, function () { it("deviceInfoTest009", 0, function () {
console.info('testGetBootLoaderVersion01 start'); console.info("testGetBootLoaderVersion01 start");
let bootloaderVersionInfo = deviceinfo.bootloaderVersion; let bootloaderVersionInfo = deviceinfo.bootloaderVersion;
console.info('the value of the deviceinfo bootloaderVersion is :' + bootloaderVersionInfo); console.info("the value of the deviceinfo bootloaderVersion is :" + bootloaderVersionInfo);
expect(bootloaderVersionInfo).assertInstanceOf('String'); expect(bootloaderVersionInfo).assertInstanceOf("String");
if (bootloaderVersionInfo != "" && bootloaderVersionInfo != null && bootloaderVersionInfo != undefined) { if (bootloaderVersionInfo != "" && bootloaderVersionInfo != null && bootloaderVersionInfo != undefined) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = bootloaderVersionInfo.match(str); let arr = bootloaderVersionInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(bootloaderVersionInfo).assertEqual(bufferstr); expect(bootloaderVersionInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetBootLoaderVersion01 :end') console.info("testGetBootLoaderVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_010 * @tc.number DEVICE_INFO_TEST_010
...@@ -292,27 +285,26 @@ export default function DeviceInfoTest() { ...@@ -292,27 +285,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest010', 0, function () { it("deviceInfoTest010", 0, function () {
console.info('testGetabiList01 start'); console.info("testGetabiList01 start");
let abiListInfo = deviceinfo.abiList; let abiListInfo = deviceinfo.abiList;
console.info('the value of the deviceinfo abiList is :' + abiListInfo); console.info("the value of the deviceinfo abiList is :" + abiListInfo);
expect(abiListInfo).assertInstanceOf('String'); expect(abiListInfo).assertInstanceOf("String");
if (abiListInfo != "" && abiListInfo != null && abiListInfo != undefined) { if (abiListInfo != "" && abiListInfo != null && abiListInfo != undefined) {
let str = /[\w-\.\(\)\,]/g; let str = /[\w-\.\(\)\,]/g;
let arr = abiListInfo.match(str); let arr = abiListInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(abiListInfo).assertEqual(bufferstr); expect(abiListInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetabiList01 :end'); console.info("testGetabiList01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_011 * @tc.number DEVICE_INFO_TEST_011
...@@ -322,26 +314,26 @@ export default function DeviceInfoTest() { ...@@ -322,26 +314,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest011', 0, function () { it("deviceInfoTest011", 0, function () {
console.info('testGetSecurityPatchTag01 start'); console.info("testGetSecurityPatchTag01 start");
let securityPatchTagInfo = deviceinfo.securityPatchTag; let securityPatchTagInfo = deviceinfo.securityPatchTag;
console.info('the value of the deviceinfo securityPatchTag is :' + securityPatchTagInfo); console.info("the value of the deviceinfo securityPatchTag is :" + securityPatchTagInfo);
expect(securityPatchTagInfo).assertInstanceOf('String'); expect(securityPatchTagInfo).assertInstanceOf("String");
if (securityPatchTagInfo != "" && securityPatchTagInfo != null && securityPatchTagInfo != undefined) { if (securityPatchTagInfo != "" && securityPatchTagInfo != null && securityPatchTagInfo != undefined) {
let str = /[\w\/\.\(\)]/g; let str = /[\w\/\.\(\)]/g;
let arr = securityPatchTagInfo.match(str); let arr = securityPatchTagInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(securityPatchTagInfo).assertEqual(bufferstr); expect(securityPatchTagInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetSecurityPatchTag01 :end'); console.info("testGetSecurityPatchTag01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_012 * @tc.number DEVICE_INFO_TEST_012
...@@ -351,19 +343,19 @@ export default function DeviceInfoTest() { ...@@ -351,19 +343,19 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest012', 0, function () { it("deviceInfoTest012", 0, function () {
console.info('testGetDisplayVersion01 start'); console.info("testGetDisplayVersion01 start");
let ret = false; let ret = false;
let displayVersionInfo = deviceinfo.displayVersion; let displayVersionInfo = deviceinfo.displayVersion;
console.info('the value of the deviceinfo displayVersion is :' + displayVersionInfo); console.info("the value of the deviceinfo displayVersion is :" + displayVersionInfo);
expect(displayVersionInfo).assertInstanceOf('String'); expect(displayVersionInfo).assertInstanceOf("String");
if (displayVersionInfo != "" && displayVersionInfo != null && displayVersionInfo != undefined) { if (displayVersionInfo != "" && displayVersionInfo != null && displayVersionInfo != undefined) {
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetDisplayVersion01 :end'); console.info("testGetDisplayVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_013 * @tc.number DEVICE_INFO_TEST_013
...@@ -373,26 +365,26 @@ export default function DeviceInfoTest() { ...@@ -373,26 +365,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest013', 0, function () { it("deviceInfoTest013", 0, function () {
console.info('testGetIncrementalVersion01 start'); console.info("testGetIncrementalVersion01 start");
let incrementalVersionInfo = deviceinfo.incrementalVersion; let incrementalVersionInfo = deviceinfo.incrementalVersion;
console.info('the value of the deviceinfo incrementalVersion is :' + incrementalVersionInfo); console.info("the value of the deviceinfo incrementalVersion is :" + incrementalVersionInfo);
expect(incrementalVersionInfo).assertInstanceOf('String'); expect(incrementalVersionInfo).assertInstanceOf("String");
if (incrementalVersionInfo != "" && incrementalVersionInfo != null && incrementalVersionInfo != undefined) { if (incrementalVersionInfo != "" && incrementalVersionInfo != null && incrementalVersionInfo != undefined) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = incrementalVersionInfo.match(str); let arr = incrementalVersionInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(incrementalVersionInfo).assertEqual(bufferstr); expect(incrementalVersionInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetIncrementalVersion01 :end'); console.info("testGetIncrementalVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_014 * @tc.number DEVICE_INFO_TEST_014
...@@ -402,26 +394,26 @@ export default function DeviceInfoTest() { ...@@ -402,26 +394,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest014', 0, function () { it("deviceInfoTest014", 0, function () {
console.info('testGetOSReleaserType01 start'); console.info("testGetOSReleaserType01 start");
let osReleaseTypeInfo = deviceinfo.osReleaseType; let osReleaseTypeInfo = deviceinfo.osReleaseType;
console.info('the value of the deviceinfo osReleaseType is :' + osReleaseTypeInfo); console.info("the value of the deviceinfo osReleaseType is :" + osReleaseTypeInfo);
expect(osReleaseTypeInfo).assertInstanceOf('String'); expect(osReleaseTypeInfo).assertInstanceOf("String");
if (osReleaseTypeInfo != "" && osReleaseTypeInfo != null && osReleaseTypeInfo != undefined) { if (osReleaseTypeInfo != "" && osReleaseTypeInfo != null && osReleaseTypeInfo != undefined) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = osReleaseTypeInfo.match(str); let arr = osReleaseTypeInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(osReleaseTypeInfo).assertEqual(bufferstr); expect(osReleaseTypeInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetOSReleaserType01 :end'); console.info("testGetOSReleaserType01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_015 * @tc.number DEVICE_INFO_TEST_015
...@@ -431,26 +423,26 @@ export default function DeviceInfoTest() { ...@@ -431,26 +423,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest015', 0, function () { it("deviceInfoTest015", 0, function () {
console.info('testGetOSFullName01 start'); console.info("testGetOSFullName01 start");
let osFullNameInfo = deviceinfo.osFullName; let osFullNameInfo = deviceinfo.osFullName;
console.info('the value of the deviceinfo osFullName is :' + osFullNameInfo); console.info("the value of the deviceinfo osFullName is :" + osFullNameInfo);
expect(osFullNameInfo).assertInstanceOf('String'); expect(osFullNameInfo).assertInstanceOf("String");
if (osFullNameInfo != "" && osFullNameInfo != null && osFullNameInfo != undefined) { if (osFullNameInfo != "" && osFullNameInfo != null && osFullNameInfo != undefined) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)\s]/g;
let arr = osFullNameInfo.match(str); let arr = osFullNameInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(osFullNameInfo).assertEqual(bufferstr); expect(osFullNameInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetOSFullName01 :end'); console.info("testGetOSFullName01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_016 * @tc.number DEVICE_INFO_TEST_016
...@@ -460,27 +452,27 @@ export default function DeviceInfoTest() { ...@@ -460,27 +452,27 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest016', 0, function () { it("deviceInfoTest016", 0, function () {
console.info('testGetMajorVersion01 start'); console.info("testGetMajorVersion01 start");
let majorVersionInfo = deviceinfo.majorVersion; let majorVersionInfo = deviceinfo.majorVersion;
console.info('the value of the deviceinfo majorVersion is :' + majorVersionInfo); console.info("the value of the deviceinfo majorVersion is :" + majorVersionInfo);
expect(majorVersionInfo).assertInstanceOf('Number'); expect(majorVersionInfo).assertInstanceOf("Number");
if (majorVersionInfo >= 1 && majorVersionInfo <= 99) { if (majorVersionInfo >= 1 && majorVersionInfo <= 99) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = majorVersionInfo.toString().match(str); let arr = majorVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join("");
let numstr = parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info("the value of the bufferstr is :" + numstr);
expect(majorVersionInfo).assertEqual(numstr); expect(majorVersionInfo).assertEqual(numstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetMajorVersion01 :end'); console.info("testGetMajorVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_017 * @tc.number DEVICE_INFO_TEST_017
...@@ -490,28 +482,27 @@ export default function DeviceInfoTest() { ...@@ -490,28 +482,27 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest017', 0, function () { it("deviceInfoTest017", 0, function () {
console.info('testGetSeniorVersion01 start'); console.info("testGetSeniorVersion01 start");
let seniorVersionInfo = deviceinfo.seniorVersion; let seniorVersionInfo = deviceinfo.seniorVersion;
console.info('the value of the deviceinfo seniorVersion is :' + seniorVersionInfo); console.info("the value of the deviceinfo seniorVersion is :" + seniorVersionInfo);
expect(seniorVersionInfo).assertInstanceOf('Number'); expect(seniorVersionInfo).assertInstanceOf("Number");
if (seniorVersionInfo >= 0 && seniorVersionInfo <= 99) { if (seniorVersionInfo >= 0 && seniorVersionInfo <= 99) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = seniorVersionInfo.toString().match(str); let arr = seniorVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join("");
let numstr = parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info("the value of the bufferstr is :" + numstr);
expect(seniorVersionInfo).assertEqual(numstr); expect(seniorVersionInfo).assertEqual(numstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetSeniorVersion01 :end'); console.info("testGetSeniorVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_018 * @tc.number DEVICE_INFO_TEST_018
...@@ -521,27 +512,27 @@ export default function DeviceInfoTest() { ...@@ -521,27 +512,27 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest018', 0, function () { it("deviceInfoTest018", 0, function () {
console.info('testGetFeatureVersion01 start'); console.info("testGetFeatureVersion01 start");
let featureVersionInfo = deviceinfo.featureVersion; let featureVersionInfo = deviceinfo.featureVersion;
console.info('the value of the deviceinfo featureVersion is :' + featureVersionInfo); console.info("the value of the deviceinfo featureVersion is :" + featureVersionInfo);
expect(featureVersionInfo).assertInstanceOf('Number'); expect(featureVersionInfo).assertInstanceOf("Number");
if ((featureVersionInfo >= 1 && featureVersionInfo <= 99) || featureVersionInfo == 0) { if ((featureVersionInfo >= 1 && featureVersionInfo <= 99) || featureVersionInfo == 0) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = featureVersionInfo.toString().match(str); let arr = featureVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join("");
let numstr = parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info("the value of the bufferstr is :" + numstr);
expect(featureVersionInfo).assertEqual(numstr); expect(featureVersionInfo).assertEqual(numstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetFeatureVersion01 :end'); console.info("testGetFeatureVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_019 * @tc.number DEVICE_INFO_TEST_019
...@@ -551,27 +542,27 @@ export default function DeviceInfoTest() { ...@@ -551,27 +542,27 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest019', 0, function () { it("deviceInfoTest019", 0, function () {
console.info('testGetBuildVersion01 start'); console.info("testGetBuildVersion01 start");
let buildVersionInfo = deviceinfo.buildVersion; let buildVersionInfo = deviceinfo.buildVersion;
console.info('the value of the deviceinfo buildVersion is :' + buildVersionInfo); console.info("the value of the deviceinfo buildVersion is :" + buildVersionInfo);
expect(buildVersionInfo).assertInstanceOf('Number'); expect(buildVersionInfo).assertInstanceOf("Number");
if (buildVersionInfo == 0 || (buildVersionInfo >= 1 && buildVersionInfo <= 999)) { if (buildVersionInfo == 0 || (buildVersionInfo >= 1 && buildVersionInfo <= 999)) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = buildVersionInfo.toString().match(str); let arr = buildVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join("");
let numstr = parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info("the value of the bufferstr is :" + numstr);
expect(buildVersionInfo).assertEqual(numstr); expect(buildVersionInfo).assertEqual(numstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetBuildVersion01 :end'); console.info("testGetBuildVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_020 * @tc.number DEVICE_INFO_TEST_020
...@@ -581,13 +572,13 @@ export default function DeviceInfoTest() { ...@@ -581,13 +572,13 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest020', 0, function () { it("deviceInfoTest020", 0, function () {
console.info('testGetSdkApiVersion01 start'); console.info("testGetSdkApiVersion01 start");
let ret = false; let ret = false;
let sdkApiVersionInfo = deviceinfo.sdkApiVersion; let sdkApiVersionInfo = deviceinfo.sdkApiVersion;
console.info('the value of the deviceinfo sdkApiVersion is :' + sdkApiVersionInfo); console.info("the value of the deviceinfo sdkApiVersion is :" + sdkApiVersionInfo);
expect(sdkApiVersionInfo).assertInstanceOf('Number'); expect(sdkApiVersionInfo).assertInstanceOf("Number");
if (sdkApiVersionInfo >= 0) { if (sdkApiVersionInfo >= 0) {
ret = true; ret = true;
} }
...@@ -595,13 +586,13 @@ export default function DeviceInfoTest() { ...@@ -595,13 +586,13 @@ export default function DeviceInfoTest() {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = sdkApiVersionInfo.toString().match(str); let arr = sdkApiVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join("");
let numstr = parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info("the value of the bufferstr is :" + numstr);
expect(sdkApiVersionInfo).assertEqual(numstr); expect(sdkApiVersionInfo).assertEqual(numstr);
console.info('testGetSdkApiVersion01 :end'); console.info("testGetSdkApiVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_021 * @tc.number DEVICE_INFO_TEST_021
...@@ -611,13 +602,13 @@ export default function DeviceInfoTest() { ...@@ -611,13 +602,13 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest021', 0, function () { it("deviceInfoTest021", 0, function () {
console.info('testGetFirstApiVersion01 start'); console.info("testGetFirstApiVersion01 start");
let ret = true; let ret = true;
let firstApiVersionInfo = deviceinfo.firstApiVersion; let firstApiVersionInfo = deviceinfo.firstApiVersion;
console.info('the value of the deviceinfo firstApiVersion is :' + firstApiVersionInfo); console.info("the value of the deviceinfo firstApiVersion is :" + firstApiVersionInfo);
expect(firstApiVersionInfo).assertInstanceOf('Number'); expect(firstApiVersionInfo).assertInstanceOf("Number");
if (firstApiVersionInfo >= 0) { if (firstApiVersionInfo >= 0) {
ret = true; ret = true;
} }
...@@ -625,13 +616,13 @@ export default function DeviceInfoTest() { ...@@ -625,13 +616,13 @@ export default function DeviceInfoTest() {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = firstApiVersionInfo.toString().match(str); let arr = firstApiVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join("");
let numstr = parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info("the value of the bufferstr is :" + numstr);
expect(firstApiVersionInfo).assertEqual(numstr); expect(firstApiVersionInfo).assertEqual(numstr);
console.info('testGetFirstApiVersion01 :end'); console.info("testGetFirstApiVersion01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_022 * @tc.number DEVICE_INFO_TEST_022
...@@ -641,19 +632,19 @@ export default function DeviceInfoTest() { ...@@ -641,19 +632,19 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest022', 0, function () { it("deviceInfoTest022", 0, function () {
console.info('testGetVersionId01 start'); console.info("testGetVersionId01 start");
let ret = false; let ret = false;
let versionIdInfo = deviceinfo.versionId; let versionIdInfo = deviceinfo.versionId;
console.info('the value of the deviceinfo versionId is :' + versionIdInfo); console.info("the value of the deviceinfo versionId is :" + versionIdInfo);
expect(versionIdInfo).assertInstanceOf('String'); expect(versionIdInfo).assertInstanceOf("String");
if (versionIdInfo != "" && versionIdInfo != null && versionIdInfo != undefined) { if (versionIdInfo != "" && versionIdInfo != null && versionIdInfo != undefined) {
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetVersionId01 end'); console.info("testGetVersionId01 end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_023 * @tc.number DEVICE_INFO_TEST_023
...@@ -663,26 +654,26 @@ export default function DeviceInfoTest() { ...@@ -663,26 +654,26 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest023', 0, function () { it("deviceInfoTest023", 0, function () {
console.info('testGetBuildType01 start'); console.info("testGetBuildType01 start");
let buildTypeInfo = deviceinfo.buildType; let buildTypeInfo = deviceinfo.buildType;
console.info('the value of the deviceinfo buildType is :' + buildTypeInfo); console.info("the value of the deviceinfo buildType is :" + buildTypeInfo);
expect(buildTypeInfo).assertInstanceOf('String'); expect(buildTypeInfo).assertInstanceOf("String");
if (buildTypeInfo != "" && buildTypeInfo != null && buildTypeInfo != undefined) { if (buildTypeInfo != "" && buildTypeInfo != null && buildTypeInfo != undefined) {
let str = /[\w-\.\(\)\:]/g; let str = /[\w-\.\(\)\:]/g;
let arr = buildTypeInfo.match(str); let arr = buildTypeInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(buildTypeInfo).assertEqual(bufferstr); expect(buildTypeInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetBuildType01 :end'); console.info("testGetBuildType01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_024 * @tc.number DEVICE_INFO_TEST_024
...@@ -692,19 +683,19 @@ export default function DeviceInfoTest() { ...@@ -692,19 +683,19 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest024', 0, function () { it("deviceInfoTest024", 0, function () {
console.info('testGetBuildUser01 start'); console.info("testGetBuildUser01 start");
let ret = true; let ret = true;
let buildUserInfo = deviceinfo.buildUser; let buildUserInfo = deviceinfo.buildUser;
console.info('the value of the deviceinfo buildUser is :' + buildUserInfo); console.info("the value of the deviceinfo buildUser is :" + buildUserInfo);
expect(buildUserInfo).assertInstanceOf('String'); expect(buildUserInfo).assertInstanceOf("String");
if (buildUserInfo != "" && buildUserInfo != null && buildUserInfo != undefined) { if (buildUserInfo != "" && buildUserInfo != null && buildUserInfo != undefined) {
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetBuildUser01 :end'); console.info("testGetBuildUser01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_025 * @tc.number DEVICE_INFO_TEST_025
...@@ -714,19 +705,19 @@ export default function DeviceInfoTest() { ...@@ -714,19 +705,19 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest025', 0, function () { it("deviceInfoTest025", 0, function () {
console.info('testGetBuildHost01 start'); console.info("testGetBuildHost01 start");
let ret = false; let ret = false;
let buildHostInfo = deviceinfo.buildHost; let buildHostInfo = deviceinfo.buildHost;
console.info('the value of the deviceinfo buildHost is :' + buildHostInfo); console.info("the value of the deviceinfo buildHost is :" + buildHostInfo);
expect(buildHostInfo).assertInstanceOf('String'); expect(buildHostInfo).assertInstanceOf("String");
if (buildHostInfo != "" && buildHostInfo != null && buildHostInfo != undefined) { if (buildHostInfo != "" && buildHostInfo != null && buildHostInfo != undefined) {
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetBuildHost01 :end'); console.info("testGetBuildHost01 :end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_026 * @tc.number DEVICE_INFO_TEST_026
...@@ -736,19 +727,19 @@ export default function DeviceInfoTest() { ...@@ -736,19 +727,19 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest026', 0, function () { it("deviceInfoTest026", 0, function () {
console.info('testGetBuildTime01 start'); console.info("testGetBuildTime01 start");
let ret = false; let ret = false;
let buildTimeInfo = deviceinfo.buildTime; let buildTimeInfo = deviceinfo.buildTime;
console.info('the value of the deviceinfo buildTime is :' + buildTimeInfo); console.info("the value of the deviceinfo buildTime is :" + buildTimeInfo);
expect(buildTimeInfo).assertInstanceOf('String'); expect(buildTimeInfo).assertInstanceOf("String");
if (buildTimeInfo != "" && buildTimeInfo != null && buildTimeInfo != undefined) { if (buildTimeInfo != "" && buildTimeInfo != null && buildTimeInfo != undefined) {
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetBuildTime01 : end'); console.info("testGetBuildTime01 : end");
}) });
/** /**
* @tc.number DEVICE_INFO_TEST_027 * @tc.number DEVICE_INFO_TEST_027
...@@ -758,31 +749,25 @@ export default function DeviceInfoTest() { ...@@ -758,31 +749,25 @@ export default function DeviceInfoTest() {
* @tc.type : Constant * @tc.type : Constant
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('deviceInfoTest027', 0, function () { it("deviceInfoTest027", 0, function () {
console.info('testGetBuildRootHash01 start'); console.info("testGetBuildRootHash01 start");
let buildRootHashInfo = deviceinfo.buildRootHash; let buildRootHashInfo = deviceinfo.buildRootHash;
console.info('the value of the deviceinfo buildRootHash is :' + buildRootHashInfo); console.info("the value of the deviceinfo buildRootHash is :" + buildRootHashInfo);
expect(buildRootHashInfo).assertInstanceOf('String'); expect(buildRootHashInfo).assertInstanceOf("String");
if (buildRootHashInfo != "" && buildRootHashInfo != null && buildRootHashInfo != undefined) { if (buildRootHashInfo != "" && buildRootHashInfo != null && buildRootHashInfo != undefined) {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = buildRootHashInfo.match(str); let arr = buildRootHashInfo.match(str);
let bufferstr = arr.join(''); let bufferstr = arr.join("");
console.info('the value of the bufferstr is :' + bufferstr); console.info("the value of the bufferstr is :" + bufferstr);
expect(buildRootHashInfo).assertEqual(bufferstr); expect(buildRootHashInfo).assertEqual(bufferstr);
} else { } else {
console.info('the return value is null or incorrect.'); console.info("the return value is null or incorrect.");
expect(false).assertFalse(); expect(false).assertFalse();
} }
console.info('testGetBuildRootHash01 :end'); console.info("testGetBuildRootHash01 :end");
}) });
});
})
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册