diff --git a/tests/moduletests/backup_kit_inner/BUILD.gn b/tests/moduletests/backup_kit_inner/BUILD.gn index 961434ce155f7b1c758416261590abb6db68d229..71baea891c54c820e5671e1de93dbbf391f38360 100644 --- a/tests/moduletests/backup_kit_inner/BUILD.gn +++ b/tests/moduletests/backup_kit_inner/BUILD.gn @@ -41,6 +41,12 @@ ohos_unittest("b_session_test") { "${path_backup}/utils:backup_utils", ] + cflags = [ "--coverage" ] + + ldflags = [ "--coverage" ] + + cflags_cc = [ "--coverage" ] + external_deps = [ "c_utils:utils", "hilog:libhilog", diff --git a/tests/moduletests/backup_kit_inner/b_session_restore_test.cpp b/tests/moduletests/backup_kit_inner/b_session_restore_test.cpp index 5a2ff91017fa2acc7866ffbda33b29afddd22312..77bded075e92f4ad1b095e24c4beb3db98652fc4 100644 --- a/tests/moduletests/backup_kit_inner/b_session_restore_test.cpp +++ b/tests/moduletests/backup_kit_inner/b_session_restore_test.cpp @@ -255,9 +255,7 @@ HWTEST_F(BSessionRestoreTest, SUB_backup_b_session_restore_0600, testing::ext::T const string fileName = "1.tar"; TestManager tm("SUB_backup_b_session_restore_0600"); string filePath = tm.GetRootDirCurTest().append(fileName); - UniqueFd remoteCap( - open(filePath.data(), O_RDONLY | O_CREAT, - S_IRUSR | S_IWUSR)); + UniqueFd remoteCap(open(filePath.data(), O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR)); string bundleName = ""; vector bundlesToRestore; bundlesToRestore.emplace_back(bundleName);