1 | /* GStreamer |
---|
2 | * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> |
---|
3 | * |
---|
4 | * This library is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU Library General Public |
---|
6 | * License as published by the Free Software Foundation; either |
---|
7 | * version 2 of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This library is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
12 | * Library General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU Library General Public |
---|
15 | * License along with this library; if not, write to the |
---|
16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
17 | * Boston, MA 02111-1307, USA. |
---|
18 | */ |
---|
19 | |
---|
20 | #include <gst/gst.h> |
---|
21 | |
---|
22 | void |
---|
23 | assert_on_error (GstDebugCategory * category, GstDebugLevel level, |
---|
24 | const gchar * file, const gchar * function, gint line, GObject * object, |
---|
25 | GstDebugMessage * message, gpointer data) |
---|
26 | { |
---|
27 | g_assert (level != GST_LEVEL_ERROR); |
---|
28 | } |
---|
29 | |
---|
30 | gint |
---|
31 | main (gint argc, gchar * argv[]) |
---|
32 | { |
---|
33 | /* this file contains random tests for stuff that went wrong in some version |
---|
34 | * and should be tested so we're sure it works right now |
---|
35 | * Please add what exactly the code tests for in your test */ |
---|
36 | |
---|
37 | gst_init (&argc, &argv); |
---|
38 | |
---|
39 | /* TEST 1: |
---|
40 | * gstcaps.c 1.120 used a code path that caused a GST_ERROR for the tested |
---|
41 | * caps when simplifying even though that is absolutely valid */ |
---|
42 | { |
---|
43 | GstCaps *caps = |
---|
44 | gst_caps_from_string |
---|
45 | ("some/type, a=(int)2, b=(int)3, c=bla; some/type, a=(int)2, c=bla"); |
---|
46 | gst_debug_add_log_function (assert_on_error, NULL); |
---|
47 | gst_caps_do_simplify (caps); |
---|
48 | gst_debug_remove_log_function (assert_on_error); |
---|
49 | gst_caps_free (caps); |
---|
50 | } |
---|
51 | |
---|
52 | /* TEST 2: |
---|
53 | * gstvalue.c 1.34 had a broken comparison function for int ranges that |
---|
54 | * returned GST_VALUE_EQUAL even though the range end was different */ |
---|
55 | { |
---|
56 | GValue v1 = { 0, }; |
---|
57 | GValue v2 = { 0, }; |
---|
58 | |
---|
59 | g_value_init (&v1, GST_TYPE_INT_RANGE); |
---|
60 | g_value_init (&v2, GST_TYPE_INT_RANGE); |
---|
61 | gst_value_set_int_range (&v1, 1, 2); |
---|
62 | gst_value_set_int_range (&v2, 1, 3); |
---|
63 | g_assert (gst_value_compare (&v1, &v2) != GST_VALUE_EQUAL); |
---|
64 | g_value_unset (&v1); |
---|
65 | g_value_unset (&v2); |
---|
66 | } |
---|
67 | |
---|
68 | return 0; |
---|
69 | } |
---|