+GST_START_TEST (test_equal)
+{
+ GstTagList *tags, *tags2;
+
+ tags = gst_tag_list_new ();
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_ARTIST, "Foo", NULL);
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_ARTIST, "Bar", NULL);
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_ARTIST, "Yay", NULL);
+
+ tags2 = gst_tag_list_new ();
+ fail_unless (!gst_tag_list_is_equal (tags2, tags));
+ gst_tag_list_add (tags2, GST_TAG_MERGE_APPEND, GST_TAG_ARTIST, "Yay", NULL);
+ fail_unless (!gst_tag_list_is_equal (tags2, tags));
+ gst_tag_list_add (tags2, GST_TAG_MERGE_APPEND, GST_TAG_ARTIST, "Bar", NULL);
+ fail_unless (!gst_tag_list_is_equal (tags2, tags));
+ gst_tag_list_add (tags2, GST_TAG_MERGE_APPEND, GST_TAG_ARTIST, "Foo", NULL);
+ fail_unless (gst_tag_list_is_equal (tags2, tags));
+
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_REFERENCE_LEVEL,
+ 9.87654321, NULL);
+ fail_unless (!gst_tag_list_is_equal (tags2, tags));
+ gst_tag_list_add (tags2, GST_TAG_MERGE_APPEND, GST_TAG_REFERENCE_LEVEL,
+ 9.87654320, NULL);
+ /* want these two double values to be equal despite minor differences */
+ fail_unless (gst_tag_list_is_equal (tags2, tags));
+
+ /* want this to be unequal though, difference too large */
+ gst_tag_list_add (tags2, GST_TAG_MERGE_REPLACE, GST_TAG_REFERENCE_LEVEL,
+ 9.87654310, NULL);
+ fail_unless (!gst_tag_list_is_equal (tags2, tags));
+
+ gst_tag_list_free (tags);
+ gst_tag_list_free (tags2);
+}
+
+GST_END_TEST;
+