Skip to content

Commit

Permalink
vcard_test.c: use test-data/test.vcf as test file by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmurchison committed Apr 25, 2024
1 parent 62af925 commit ae3d48e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/test/libicalvcard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ add_executable(vcard_test_encode vcard_test_encode.c)
add_dependencies(vcard_test_encode icalvcard)
target_link_libraries(vcard_test_encode icalvcard)

add_test(NAME vcard_construct
COMMAND vcard_test ${PROJECT_SOURCE_DIR}/test-data/test.vcf
)
add_test(NAME vcard_construct COMMAND vcard_test)
setprops(vcard_construct)

add_test(NAME vcard_encode COMMAND vcard_test_encode)
Expand Down
8 changes: 5 additions & 3 deletions src/test/libicalvcard/vcard_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,15 @@ static void test_n_restriction(vcardcomponent *card)
int main(int argc, const char **argv)
{
vcardcomponent *card;
const char *file;

if (argc != 2) {
fprintf(stderr, "Usage: %s fname\n", argv[0]);
exit(1);
file = TEST_DATADIR "/test.vcf";
} else {
file = argv[1];
}

test_parse_file(argv[1]);
test_parse_file(file);
card = test_comp_vanew();
test_add_props(card);
test_n_restriction(card);
Expand Down

0 comments on commit ae3d48e

Please sign in to comment.