diff --git a/distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesHelper.test.ets b/distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesHelper.test.ets index 5f74af00f990f18d567daaa9df89732ba454216a..324f18a084741bed24144d803d6e6dba715a25ce 100644 --- a/distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesHelper.test.ets +++ b/distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesHelper.test.ets @@ -255,7 +255,7 @@ export default function preferencesHelperTest() { mPreferences.on("change"); } catch (err) { console.info("Failed to testPreferencesOn002. code =" + err.code + ", message =" + err.message); - expect(err.code === "401" && err.message === "Parameter error. Need 2 parameters!").assertTrue(); + expect(err.code === "401").assertTrue(); } }); @@ -277,7 +277,7 @@ export default function preferencesHelperTest() { mPreferences.on(null, observer); } catch (err) { console.info("Failed to testPreferencesOn003. code =" + err.code + ", message =" + err.message); - expect(err.code === "401" && err.message === "Parameter error. The type of 'type' must be string 'change'.").assertTrue(); + expect(err.code === "401").assertTrue(); } }); @@ -299,7 +299,7 @@ export default function preferencesHelperTest() { mPreferences.on("", observer); } catch (err) { console.info("Failed to testPreferencesOn004. code =" + err.code + ", message =" + err.message); - expect(err.code === "401" && err.message === "Parameter error. The type of 'type' must be string 'change'.").assertTrue(); + expect(err.code === "401").assertTrue(); } }); @@ -379,7 +379,7 @@ export default function preferencesHelperTest() { mPreferences.off(null); } catch (err) { console.info("Failed to testPreferencesOff003. code =" + err.code + ", message =" + err.message); - expect(err.code === "401" && err.message === "Parameter error. The type of 'type' must be string 'change'.").assertTrue(); + expect(err.code === "401").assertTrue(); } }); @@ -403,7 +403,7 @@ export default function preferencesHelperTest() { mPreferences.off(""); } catch (err) { console.info("Failed to testPreferencesOff004. code =" + err.code + ", message =" + err.message); - expect(err.code === "401" && err.message === "Parameter error. The type of 'type' must be string 'change'.").assertTrue(); + expect(err.code === "401").assertTrue(); } }); });