Skip to content

Commit e493e45

Browse files
committed
test: expect fail on empty repo.js
After the fix for #192, the behavior of RepoLoadJson for empty JSON files changed from accepting the file to rejecting it. The new behavior is actually better than the old one, so we just update the tests to succeed with the new behavior and fail with the old one.
1 parent cfa4204 commit e493e45

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

thcrap_test/src/repo.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,7 @@ TEST(RepoTest, RepoLoadJsonInvalid)
2323
TEST(RepoTest, RepoLoadJsonEmpty)
2424
{
2525
ScopedJson json = json_object();
26-
repo_t *repo = RepoLoadJson(*json);
27-
ASSERT_NE(repo, nullptr);
28-
29-
EXPECT_EQ(repo->id, nullptr);
30-
EXPECT_EQ(repo->title, nullptr);
31-
EXPECT_EQ(repo->contact, nullptr);
32-
EXPECT_EQ(repo->servers, nullptr);
33-
EXPECT_EQ(repo->neighbors, nullptr);
34-
EXPECT_EQ(repo->patches, nullptr);
35-
36-
RepoFree(repo);
26+
EXPECT_EQ(RepoLoadJson(*json), nullptr);
3727
}
3828

3929
TEST(RepoTest, RepoLoadJsonValid)

0 commit comments

Comments
 (0)