Skip to content

Commit fd7c2e0

Browse files
authored
Merge pull request #902 from apple/fix-120671990
2 parents e15b815 + 4438e23 commit fd7c2e0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

unittests/Core/SQLiteBuildDBTest.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ TEST(SQLiteBuildDBTest, ErrorHandling) {
4747
bool result = true;
4848
buildDB->getCurrentEpoch(&result, &error);
4949
EXPECT_FALSE(result);
50-
51-
std::stringstream out;
52-
out << "error: accessing build database \"" << path << "\": database is locked Possibly there are two concurrent builds running in the same filesystem location.";
53-
EXPECT_EQ(error, out.str());
50+
EXPECT_TRUE(error.find("database is locked") != std::string::npos);
5451

5552
// Clean up database connections before unlinking
5653
sqlite3_exec(db, "END;", nullptr, nullptr, nullptr);
@@ -85,9 +82,7 @@ TEST(SQLiteBuildDBTest, LockedWhileBuilding) {
8582
// Tests that we cannot start a second build with an existing connection
8683
result = secondBuildDB->buildStarted(&error);
8784
EXPECT_FALSE(result);
88-
std::stringstream out;
89-
out << "error: accessing build database \"" << path << "\": database is locked Possibly there are two concurrent builds running in the same filesystem location.";
90-
EXPECT_EQ(error, out.str());
85+
EXPECT_TRUE(error.find("database is locked") != std::string::npos);
9186

9287
// Tests that we cannot create new connections while a build is running
9388
std::unique_ptr<BuildDB> otherBuildDB = createSQLiteBuildDB(dbPath, 1, /* recreateUnmatchedVersion = */ true, &error);
@@ -98,7 +93,7 @@ TEST(SQLiteBuildDBTest, LockedWhileBuilding) {
9893
bool success = true;
9994
otherBuildDB->getCurrentEpoch(&success, &error);
10095
EXPECT_FALSE(success);
101-
EXPECT_EQ(error, out.str());
96+
EXPECT_TRUE(error.find("database is locked") != std::string::npos);
10297

10398
// Clean up database connections before unlinking
10499
buildDB->buildComplete();

0 commit comments

Comments
 (0)