Commit d0b3830b authored by conrad's avatar conrad
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.
parent 0e01ba99
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment