diff --git a/storage/storagesecuritylabeljstest/src/main/js/test/securitylabel.test.js b/storage/storagesecuritylabeljstest/src/main/js/test/securitylabel.test.js index db94547a71e31a0d606a23bd135f939bc39a463b..1b51107d0815e1bd0c09f3d58f721c3293ea1a7a 100644 --- a/storage/storagesecuritylabeljstest/src/main/js/test/securitylabel.test.js +++ b/storage/storagesecuritylabeljstest/src/main/js/test/securitylabel.test.js @@ -81,8 +81,8 @@ describe('securitylabel', function () { it('securitylabel_test_set_security_label_sync_002', 0, async function () { try { let result = securityLabel.setSecurityLabelSync("/data/aaa.txt", "s0"); - expect(result.code == -1).assertTrue(); - } catch (e) { + expect(result.message == "No such file or directory").assertTrue(); + } catch (err) { console.log('securitylabel_test_set_security_label_sync_002 has failed for ' + err); } }); @@ -291,7 +291,7 @@ describe('securitylabel', function () { await securityLabel.setSecurityLabel('/data/test.txt', 's0'); } catch (err) { console.log('securitylabel_test_set_security_label_async_006 has failed for ' + err); - expect(err.code == -1).assertTrue(); + expect(err.message == "No such file or directory").assertTrue(); done(); } });