Added more testcases

Original commit message from CVS:
Added more testcases
This commit is contained in:
Wim Taymans 2001-10-14 20:41:03 +00:00
parent cccf1891e2
commit 3f4b8084d2
4 changed files with 110 additions and 8 deletions

View file

@ -45,6 +45,7 @@ struct _GstBsTest
GstByteStream *bs; GstByteStream *bs;
gchar *accesspattern; gchar *accesspattern;
guint num_patterns;
gchar **patterns; gchar **patterns;
guint sizemin; guint sizemin;
guint sizemax; guint sizemax;
@ -235,12 +236,11 @@ gst_bstest_loop (GstElement * element)
bstest = GST_BSTEST (element); bstest = GST_BSTEST (element);
/* THIS IS THE BUFFER BASED ONE */
do { do {
guint size = 0; guint size = 0;
guint i = 0; guint i = 0;
while (bstest->patterns[i]) { while (i < bstest->num_patterns) {
buf = NULL; buf = NULL;
if (bstest->patterns[i][0] == 'r') { if (bstest->patterns[i][0] == 'r') {
@ -271,7 +271,6 @@ gst_bstest_loop (GstElement * element)
i++; i++;
} }
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element)); } while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element));
} }
@ -300,10 +299,14 @@ gst_bstest_set_property (GObject * object, guint prop_id, const GValue * value,
if (g_value_get_string (value) == NULL) { if (g_value_get_string (value) == NULL) {
gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL); gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL);
bstest->accesspattern = NULL; bstest->accesspattern = NULL;
/* otherwise set the new filename */ bstest->num_patterns = 0;
} else { } else {
guint i = 0;
bstest->accesspattern = g_strdup (g_value_get_string (value)); bstest->accesspattern = g_strdup (g_value_get_string (value));
bstest->patterns = g_strsplit (bstest->accesspattern, ":", 0); bstest->patterns = g_strsplit (bstest->accesspattern, ":", 0);
while (bstest->patterns[i++]);
bstest->num_patterns = i-1;
} }
break; break;
case ARG_COUNT: case ARG_COUNT:

View file

@ -43,3 +43,51 @@
2 2 pr:rr 1 2 2 pr:rr 1
2 3 p:rr 1 2 3 p:rr 1
2 3 pr:rr 1 2 3 pr:rr 1
1 2 pb:r 1
1 2 pbr:r 1
1 3 pb:r 1
1 3 pbr:r 1
2 2 pb:r 1
2 2 pbr:r 1
2 3 pb:r 1
2 3 pbr:r 1
1 2 pb:rr 1
1 2 pbr:rr 1
1 3 pb:rr 1
1 3 pbr:rr 1
2 2 pb:rr 1
2 2 pbr:rr 1
2 3 pb:rr 1
2 3 pbr:rr 1
1 2 p:fr:rr 0
1 2 pr:fr:rr 0
1 3 p:fr:rr 0
1 3 pr:fr:rr 0
2 2 p:fr:rr 0
2 2 pr:fr:rr 0
2 3 p:fr:rr 0
2 3 pr:fr:rr 0
1 2 fr:rr 0
1 2 fr:rr 0
1 3 fr:rr 0
1 3 fr:rr 0
2 2 fr:rr 0
2 2 fr:rr 0
2 3 fr:rr 0
2 3 fr:rr 0
1 2 fr:fr:rr 0
1 2 fr:fr:rr 0
1 3 fr:fr:rr 0
1 3 fr:fr:rr 0
2 2 fr:fr:rr 0
2 2 fr:fr:rr 0
2 3 fr:fr:rr 0
2 3 fr:fr:rr 0
1 2 pbr:pbr:rr 1
1 2 pbr:pbr:rr 1
1 3 pbr:pbr:rr 1
1 3 pbr:pbr:rr 1
2 2 pbr:pbr:rr 1
2 2 pbr:pbr:rr 1
2 3 pbr:pbr:rr 1
2 3 pbr:pbr:rr 1

View file

@ -45,6 +45,7 @@ struct _GstBsTest
GstByteStream *bs; GstByteStream *bs;
gchar *accesspattern; gchar *accesspattern;
guint num_patterns;
gchar **patterns; gchar **patterns;
guint sizemin; guint sizemin;
guint sizemax; guint sizemax;
@ -235,12 +236,11 @@ gst_bstest_loop (GstElement * element)
bstest = GST_BSTEST (element); bstest = GST_BSTEST (element);
/* THIS IS THE BUFFER BASED ONE */
do { do {
guint size = 0; guint size = 0;
guint i = 0; guint i = 0;
while (bstest->patterns[i]) { while (i < bstest->num_patterns) {
buf = NULL; buf = NULL;
if (bstest->patterns[i][0] == 'r') { if (bstest->patterns[i][0] == 'r') {
@ -271,7 +271,6 @@ gst_bstest_loop (GstElement * element)
i++; i++;
} }
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element)); } while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element));
} }
@ -300,10 +299,14 @@ gst_bstest_set_property (GObject * object, guint prop_id, const GValue * value,
if (g_value_get_string (value) == NULL) { if (g_value_get_string (value) == NULL) {
gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL); gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL);
bstest->accesspattern = NULL; bstest->accesspattern = NULL;
/* otherwise set the new filename */ bstest->num_patterns = 0;
} else { } else {
guint i = 0;
bstest->accesspattern = g_strdup (g_value_get_string (value)); bstest->accesspattern = g_strdup (g_value_get_string (value));
bstest->patterns = g_strsplit (bstest->accesspattern, ":", 0); bstest->patterns = g_strsplit (bstest->accesspattern, ":", 0);
while (bstest->patterns[i++]);
bstest->num_patterns = i-1;
} }
break; break;
case ARG_COUNT: case ARG_COUNT:

View file

@ -43,3 +43,51 @@
2 2 pr:rr 1 2 2 pr:rr 1
2 3 p:rr 1 2 3 p:rr 1
2 3 pr:rr 1 2 3 pr:rr 1
1 2 pb:r 1
1 2 pbr:r 1
1 3 pb:r 1
1 3 pbr:r 1
2 2 pb:r 1
2 2 pbr:r 1
2 3 pb:r 1
2 3 pbr:r 1
1 2 pb:rr 1
1 2 pbr:rr 1
1 3 pb:rr 1
1 3 pbr:rr 1
2 2 pb:rr 1
2 2 pbr:rr 1
2 3 pb:rr 1
2 3 pbr:rr 1
1 2 p:fr:rr 0
1 2 pr:fr:rr 0
1 3 p:fr:rr 0
1 3 pr:fr:rr 0
2 2 p:fr:rr 0
2 2 pr:fr:rr 0
2 3 p:fr:rr 0
2 3 pr:fr:rr 0
1 2 fr:rr 0
1 2 fr:rr 0
1 3 fr:rr 0
1 3 fr:rr 0
2 2 fr:rr 0
2 2 fr:rr 0
2 3 fr:rr 0
2 3 fr:rr 0
1 2 fr:fr:rr 0
1 2 fr:fr:rr 0
1 3 fr:fr:rr 0
1 3 fr:fr:rr 0
2 2 fr:fr:rr 0
2 2 fr:fr:rr 0
2 3 fr:fr:rr 0
2 3 fr:fr:rr 0
1 2 pbr:pbr:rr 1
1 2 pbr:pbr:rr 1
1 3 pbr:pbr:rr 1
1 3 pbr:pbr:rr 1
2 2 pbr:pbr:rr 1
2 2 pbr:pbr:rr 1
2 3 pbr:pbr:rr 1
2 3 pbr:pbr:rr 1