Skip to content

Commit

Permalink
tests: allow NULL-valued comments
Browse files Browse the repository at this point in the history
This test changes the policy on what comments are valid, to allow
plain comments, not of the form KEY=VALUE (the condition reported
in Mozilla #520500).

As this commit only modifies the test suite, 'make check' is
expected to fail.
  • Loading branch information
kfish committed Feb 2, 2010
1 parent 0e01ba9 commit d0b3830
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/tests/comment-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@ main (int argc, char * argv[])
INFO ("Initializing FishSound for comments (encode)");
fsound = fish_sound_new (FISH_SOUND_ENCODE, &fsinfo);

INFO ("+ Testing add of invalid unstructured COMMENT byname");
err = fish_sound_comment_add_byname (fsound, COMMENT, NULL);
if (err != FISH_SOUND_ERR_COMMENT_INVALID)
FAIL ("Invalid comment not detected");

INFO ("+ Testing add of invalid unstructured COMMENT from local storage");
mycomment.name = COMMENT;
mycomment.value = NULL;
err = fish_sound_comment_add (fsound, &mycomment);
if (err != FISH_SOUND_ERR_COMMENT_INVALID)
FAIL ("Invalid comment not detected");

INFO ("+ Adding ARTIST1 byname");
err = fish_sound_comment_add_byname (fsound, "ARTIST", ARTIST1);
if (err < 0) FAIL ("Operation failed");
Expand Down Expand Up @@ -145,6 +133,16 @@ main (int argc, char * argv[])
if (strcmp (comment->value, LICENSE))
FAIL ("Incorrect LICENSE value found");

INFO ("+ Testing add of valid plain (not key=value) COMMENT byname");
err = fish_sound_comment_add_byname (fsound, COMMENT, NULL);
if (err < 0) FAIL ("Operation failed");

INFO ("+ Testing add of valid plain (not key=value) COMMENT from local storage");
mycomment.name = COMMENT;
mycomment.value = NULL;
err = fish_sound_comment_add (fsound, &mycomment);
if (err < 0) FAIL ("Operation failed");

INFO ("+ Adding ARTIST2 byname");
err = fish_sound_comment_add_byname (fsound, "ARTIST", ARTIST2);
if (err < 0) FAIL ("Operation failed");
Expand Down

0 comments on commit d0b3830

Please sign in to comment.