Permalink
Browse files

tests: allow NULL-valued comments

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...
1 parent 0e01ba9 commit d0b3830b86302bf903a254d9fe49ac0a44104dfb @kfish committed Feb 2, 2010
Showing with 10 additions and 12 deletions.
  1. +10 −12 src/tests/comment-test.c
View
22 src/tests/comment-test.c
@@ -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");
@@ -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");

0 comments on commit d0b3830

Please sign in to comment.