diff --git a/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_sqlite_utils_test.cpp b/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_sqlite_utils_test.cpp index 9d5966b088ce8d0af9eaae1e425f2ef1ee91d9b7..77d10cd5e133b575de35bb5384039729b2d69959 100644 --- a/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_sqlite_utils_test.cpp +++ b/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_sqlite_utils_test.cpp @@ -689,12 +689,12 @@ HWTEST_F(DistributedDBSqliteUtilsTest, RemoveKvDBTest001, TestSize.Level0) LOGD("Modifying permissions is ineffective for execution\n"); EXPECT_EQ(chmod(g_dirAll.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); EXPECT_EQ(chmod(g_dirStoreOnly.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); - return; + } else { + EXPECT_EQ(KvDBUtils::RemoveKvDB(g_dirAll, g_dirStoreOnly, g_name), -E_REMOVE_FILE); + EXPECT_EQ(chmod(g_dirAll.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); + EXPECT_EQ(KvDBUtils::RemoveKvDB(g_dirAll, g_dirStoreOnly, g_name), -E_REMOVE_FILE); + EXPECT_EQ(chmod(g_dirStoreOnly.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); } - EXPECT_EQ(KvDBUtils::RemoveKvDB(g_dirAll, g_dirStoreOnly, g_name), -E_REMOVE_FILE); - EXPECT_EQ(chmod(g_dirAll.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); - EXPECT_EQ(KvDBUtils::RemoveKvDB(g_dirAll, g_dirStoreOnly, g_name), -E_REMOVE_FILE); - EXPECT_EQ(chmod(g_dirStoreOnly.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); } /** @@ -712,10 +712,10 @@ HWTEST_F(DistributedDBSqliteUtilsTest, GetKvDbSizeTest001, TestSize.Level0) if (access(g_dirAll.c_str(), W_OK) == 0) { LOGD("Modifying permissions is ineffective for execution\n"); EXPECT_EQ(chmod(g_dirAll.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); - return; + } else { + EXPECT_EQ(KvDBUtils::GetKvDbSize(g_dirAll, g_dirStoreOnly, g_name, size), -E_INVALID_DB); + EXPECT_EQ(chmod(g_dirAll.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); } - EXPECT_EQ(KvDBUtils::GetKvDbSize(g_dirAll, g_dirStoreOnly, g_name, size), -E_INVALID_DB); - EXPECT_EQ(chmod(g_dirAll.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); } /** @@ -737,8 +737,8 @@ HWTEST_F(DistributedDBSqliteUtilsTest, GetKvDbSizeTest002, TestSize.Level0) if (access(g_dirStoreOnly.c_str(), W_OK) == 0) { LOGD("Modifying permissions is ineffective for execution\n"); EXPECT_EQ(chmod(g_dirStoreOnly.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); - return; + } else { + EXPECT_EQ(KvDBUtils::GetKvDbSize(g_dirAll, g_dirStoreOnly, g_name, size), -E_INVALID_DB); + EXPECT_EQ(chmod(g_dirStoreOnly.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); } - EXPECT_EQ(KvDBUtils::GetKvDbSize(g_dirAll, g_dirStoreOnly, g_name, size), -E_INVALID_DB); - EXPECT_EQ(chmod(g_dirStoreOnly.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); } \ No newline at end of file diff --git a/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_storage_single_ver_database_oper_test.cpp b/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_storage_single_ver_database_oper_test.cpp index 05dbda734537a47fc7c20aabe8c179437141cf44..766167f9f713ebed75f3755b4370d91a8309b8c1 100644 --- a/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_storage_single_ver_database_oper_test.cpp +++ b/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_storage_single_ver_database_oper_test.cpp @@ -213,11 +213,11 @@ HWTEST_F(DistributedDBStorageSingleVerDatabaseOperTest, DatabaseOperationTest003 if (access(backupDir.c_str(), W_OK) == 0) { LOGD("Modifying permissions is ineffective for execution\n"); EXPECT_EQ(chmod(backupDir.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); - return; + } else { + EXPECT_EQ(singleVerDatabaseOper->RekeyRecover(validProperty), -E_REMOVE_FILE); + EXPECT_EQ(chmod(backupDir.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); + EXPECT_EQ(singleVerDatabaseOper->RekeyRecover(validProperty), E_OK); } - EXPECT_EQ(singleVerDatabaseOper->RekeyRecover(validProperty), -E_REMOVE_FILE); - EXPECT_EQ(chmod(backupDir.c_str(), (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)), E_OK); - EXPECT_EQ(singleVerDatabaseOper->RekeyRecover(validProperty), E_OK); } /**