1 #include <theora/theora.h>
6 #define ARTIST1 "Bug-eyed Fish"
7 #define ARTIST2 "VJ Fugu"
8 #define COPYRIGHT "Copyright (C) 2005. Some Rights Reserved."
9 #define LICENSE "Creative Commons Attribution-ShareAlike 2.5"
18 INFO ("+ Initializing theora_comment");
19 theora_comment_init (&tc
);
21 INFO ("+ Adding ARTIST1");
22 theora_comment_add (&tc
, "ARTIST=" ARTIST1
);
24 INFO ("+ Adding LICENSE by tag");
25 theora_comment_add_tag (&tc
, "LICENSE", LICENSE
);
27 INFO ("+ Adding ARTIST2 by tag");
28 theora_comment_add_tag (&tc
, "ARTIST", ARTIST2
);
30 INFO ("+ Querying value of LICENSE");
31 value
= theora_comment_query (&tc
, "LICENSE", 0);
32 if (strcmp (value
, LICENSE
))
33 FAIL ("Incorrect value for LICENSE");
35 INFO ("+ Querying count of ARTIST comments");
36 n
= theora_comment_query_count (&tc
, "ARTIST");
39 FAIL ("Incorrect count of ARTIST comments");
41 INFO ("+ Querying value of ARTIST index 0");
42 value
= theora_comment_query (&tc
, "ARTIST", 0);
43 if (strcmp (value
, ARTIST1
))
44 FAIL ("Incorrect value for ARTIST index 0");
46 INFO ("+ Querying value of ARTIST index 1");
47 value
= theora_comment_query (&tc
, "ARTIST", 1);
48 if (strcmp (value
, ARTIST2
))
49 FAIL ("Incorrect value for ARTIST index 1");
51 INFO ("+ Querying value of ARTIST index 2 (out of bounds)");
52 value
= theora_comment_query (&tc
, "ARTIST", 2);
54 FAIL ("Non-NULL value for ARTIST index 2 (out of bounds)");
56 INFO ("+ Querying value of UNDEF index 7 (tag not defined)");
57 value
= theora_comment_query (&tc
, "UNDEF", 7);
59 FAIL ("Non-NULL value for UNDEF index 7 (tag not defined)");
61 INFO ("+ Clearing theora_comment");
62 theora_comment_clear (&tc
);
67 int main(int argc
, char *argv
[])