提交 e3341345 编写于 作者: D dy

fix assert

Signed-off-by: Ndy <dingyao5@huawei.com>
上级 a2076d67
...@@ -291,13 +291,39 @@ export default function getHapModuleInfoJsunit() { ...@@ -291,13 +291,39 @@ export default function getHapModuleInfoJsunit() {
expect(info.icon).assertEqual("$media:icon"); expect(info.icon).assertEqual("$media:icon");
expect(info.process).assertEqual(""); expect(info.process).assertEqual("");
expect(info.supportedModes).assertEqual(0); expect(info.supportedModes).assertEqual(0);
expect(info.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
expect(info.moduleInfos[0].moduleName).assertEqual("entry");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration"); "com.ohos.acecollaboration/com.ohos.acecollaboration");
if (info.moduleSourceDirs.length == 1){
expect(info.moduleInfos[0].moduleName).assertEqual("entry");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
}else if(info.moduleSourceDirs.length == 2) {
if (info.moduleInfos[0].moduleName == "myapplication1") {
expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.example.myapplication1");
expect(info.moduleInfos[1].moduleName).assertEqual("entry");
expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
}else{
expect(info.moduleInfos[0].moduleName).assertEqual("myapplication2");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.example.myapplication2");
expect(info.moduleInfos[1].moduleName).assertEqual("entry");
expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
}
}else {
expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.example.myapplication1");
expect(info.moduleInfos[1].moduleName).assertEqual("myapplication2");
expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.example.myapplication2");
expect(info.moduleInfos[2].moduleName).assertEqual("entry");
expect(info.moduleInfos[2].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
}
console.log(msg + "---checkApplicationInfo End--- "); console.log(msg + "---checkApplicationInfo End--- ");
......
...@@ -233,8 +233,8 @@ export default function getHapModuleInfoJsunit() { ...@@ -233,8 +233,8 @@ export default function getHapModuleInfoJsunit() {
expect(data.label).assertEqual("$string:entry_MainAbility"); expect(data.label).assertEqual("$string:entry_MainAbility");
expect(data.description).assertEqual("$string:mainability_description"); expect(data.description).assertEqual("$string:mainability_description");
expect(data.icon).assertEqual("$media:icon"); expect(data.icon).assertEqual("$media:icon");
expect(data.descriptionId).assertEqual(16777220); expect(data.descriptionId > 0).assertTrue();
expect(data.iconId).assertEqual(16777221); expect(data.iconId > 0).assertTrue();
expect(data.moduleName).assertEqual("entry"); expect(data.moduleName).assertEqual("entry");
expect(data.process).assertEqual(""); expect(data.process).assertEqual("");
expect(data.targetAbility).assertEqual(""); expect(data.targetAbility).assertEqual("");
...@@ -254,7 +254,7 @@ export default function getHapModuleInfoJsunit() { ...@@ -254,7 +254,7 @@ export default function getHapModuleInfoJsunit() {
expect(data.minFormWidth).assertEqual(0); expect(data.minFormWidth).assertEqual(0);
expect(data.defaultFormWidth).assertEqual(0); expect(data.defaultFormWidth).assertEqual(0);
expect(data.uri).assertEqual(""); expect(data.uri).assertEqual("");
expect(data.labelId).assertEqual(16777218); expect(data.labelId > 0).assertTrue();
expect(data.subType).assertEqual(0); expect(data.subType).assertEqual(0);
console.log(msg+ "---checkAbilityInfo End--- "); console.log(msg+ "---checkAbilityInfo End--- ");
} }
...@@ -337,13 +337,11 @@ export default function getHapModuleInfoJsunit() { ...@@ -337,13 +337,11 @@ export default function getHapModuleInfoJsunit() {
} }
expect(info.name).assertEqual("com.ohos.acecollaboration"); expect(info.name).assertEqual("com.ohos.acecollaboration");
expect(info.description).assertEqual("$string:mainability_description"); expect(info.description).assertEqual("$string:mainability_description");
expect(info.descriptionId).assertEqual(16777220); expect(info.descriptionId > 0).assertTrue();
expect(info.systemApp).assertEqual(true); expect(info.systemApp).assertEqual(true);
expect(info.enabled).assertEqual(true); expect(info.enabled).assertEqual(true);
expect(info.label).assertEqual("$string:entry_MainAbility"); expect(info.label).assertEqual("$string:entry_MainAbility");
expect(info.labelId).assertEqual("16777218");
expect(info.icon).assertEqual("$media:icon"); expect(info.icon).assertEqual("$media:icon");
expect(info.iconId).assertEqual("16777221");
expect(info.process).assertEqual(""); expect(info.process).assertEqual("");
expect(info.supportedModes).assertEqual(0); expect(info.supportedModes).assertEqual(0);
expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" +
......
...@@ -206,13 +206,39 @@ export default function getAbilityInfoJsunit() { ...@@ -206,13 +206,39 @@ export default function getAbilityInfoJsunit() {
expect(info.icon).assertEqual("$media:icon"); expect(info.icon).assertEqual("$media:icon");
expect(info.process).assertEqual(""); expect(info.process).assertEqual("");
expect(info.supportedModes).assertEqual(0); expect(info.supportedModes).assertEqual(0);
expect(info.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
expect(info.moduleInfos[0].moduleName).assertEqual("entry");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration"); "com.ohos.acecollaboration/com.ohos.acecollaboration");
if (info.moduleSourceDirs.length == 1){
expect(info.moduleInfos[0].moduleName).assertEqual("entry");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
}else if(info.moduleSourceDirs.length == 2) {
if (info.moduleInfos[0].moduleName == "myapplication1") {
expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.example.myapplication1");
expect(info.moduleInfos[1].moduleName).assertEqual("entry");
expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
}else{
expect(info.moduleInfos[0].moduleName).assertEqual("myapplication2");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.example.myapplication2");
expect(info.moduleInfos[1].moduleName).assertEqual("entry");
expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
}
}else {
expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1");
expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.example.myapplication1");
expect(info.moduleInfos[1].moduleName).assertEqual("myapplication2");
expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.example.myapplication2");
expect(info.moduleInfos[2].moduleName).assertEqual("entry");
expect(info.moduleInfos[2].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" +
"com.ohos.acecollaboration/com.ohos.acecollaboration");
}
console.log(msg+ "---checkApplicationInfo End--- "); console.log(msg+ "---checkApplicationInfo End--- ");
} }
}) })
......
...@@ -183,8 +183,8 @@ export default function getHapModuleInfoJsunit() { ...@@ -183,8 +183,8 @@ export default function getHapModuleInfoJsunit() {
expect(data.label).assertEqual("$string:myapplication1_MainAbility"); expect(data.label).assertEqual("$string:myapplication1_MainAbility");
expect(data.description).assertEqual("$string:description_mainability"); expect(data.description).assertEqual("$string:description_mainability");
expect(data.icon).assertEqual("$media:icon"); expect(data.icon).assertEqual("$media:icon");
expect(data.descriptionId).assertEqual(16777220); expect(data.descriptionId > 0).assertTrue();
expect(data.iconId).assertEqual(16777221); expect(data.iconId > 0).assertTrue();
expect(data.moduleName).assertEqual("myapplication1"); expect(data.moduleName).assertEqual("myapplication1");
expect(data.process).assertEqual(""); expect(data.process).assertEqual("");
expect(data.targetAbility).assertEqual(""); expect(data.targetAbility).assertEqual("");
...@@ -204,7 +204,7 @@ export default function getHapModuleInfoJsunit() { ...@@ -204,7 +204,7 @@ export default function getHapModuleInfoJsunit() {
expect(data.minFormWidth).assertEqual(0); expect(data.minFormWidth).assertEqual(0);
expect(data.defaultFormWidth).assertEqual(0); expect(data.defaultFormWidth).assertEqual(0);
expect(data.uri).assertEqual(""); expect(data.uri).assertEqual("");
expect(data.labelId).assertEqual(16777218); expect(data.labelId > 0).assertTrue();
expect(data.subType).assertEqual(0); expect(data.subType).assertEqual(0);
console.log(msg+ "---checkAbilityInfo End--- "); console.log(msg+ "---checkAbilityInfo End--- ");
} }
...@@ -254,13 +254,11 @@ export default function getHapModuleInfoJsunit() { ...@@ -254,13 +254,11 @@ export default function getHapModuleInfoJsunit() {
expect(typeof (info.entryDir)).assertEqual("string"); expect(typeof (info.entryDir)).assertEqual("string");
expect(info.name).assertEqual("com.ohos.acecollaboration"); expect(info.name).assertEqual("com.ohos.acecollaboration");
expect(info.description).assertEqual("$string:mainability_description"); expect(info.description).assertEqual("$string:mainability_description");
expect(info.descriptionId).assertEqual(16777220); expect(info.descriptionId > 0).assertTrue();
expect(info.systemApp).assertEqual(true); expect(info.systemApp).assertEqual(true);
expect(info.enabled).assertEqual(true); expect(info.enabled).assertEqual(true);
expect(info.label).assertEqual("$string:entry_MainAbility"); expect(info.label).assertEqual("$string:entry_MainAbility");
expect(info.labelId).assertEqual("16777218");
expect(info.icon).assertEqual("$media:icon"); expect(info.icon).assertEqual("$media:icon");
expect(info.iconId).assertEqual("16777221");
expect(info.process).assertEqual(""); expect(info.process).assertEqual("");
expect(info.supportedModes).assertEqual(0); expect(info.supportedModes).assertEqual(0);
if (info.moduleSourceDirs.length == 1){ if (info.moduleSourceDirs.length == 1){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册