summaryrefslogtreecommitdiff
path: root/tests/check/libs/rtsp.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-02-09 18:01:30 +0000
committerTim-Philipp Müller <tim@centricular.com>2015-02-09 18:03:43 +0000
commit1b4bd6e451fa9f6a7d33447a4f90ff7f0d266752 (patch)
treec6cd5df958d14f4872c44472c9efc80da7d9c564 /tests/check/libs/rtsp.c
parentef7f537a80d2d8813b169f5efe28bf7c7916b0d6 (diff)
rtspmessage: map headers we know that are added by string to their enum
That way we can look them up by their field enum later as well.
Diffstat (limited to 'tests/check/libs/rtsp.c')
-rw-r--r--tests/check/libs/rtsp.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/check/libs/rtsp.c b/tests/check/libs/rtsp.c
index 68046ad75..0730a318e 100644
--- a/tests/check/libs/rtsp.c
+++ b/tests/check/libs/rtsp.c
@@ -617,10 +617,37 @@ GST_START_TEST (test_rtsp_message)
fail_unless_equals_int (res, GST_RTSP_OK);
fail_unless_equals_string (val, "bar.0");
+ /* remove all headers for a name */
+ res = gst_rtsp_message_remove_header_by_name (msg, "FOO99-Version", -1);
+ fail_unless_equals_int (res, GST_RTSP_OK);
+ res = gst_rtsp_message_get_header_by_name (msg, "FOO99-Version", &val, 0);
+ fail_unless_equals_int (res, GST_RTSP_ENOTIMPL);
+
/* gst_rtsp_message_dump (msg); */
res = gst_rtsp_message_free (msg);
fail_unless_equals_int (res, GST_RTSP_OK);
+
+ /* === */
+
+ res = gst_rtsp_message_new_request (&msg, GST_RTSP_PLAY,
+ "rtsp://foo.bar:8554/test");
+ fail_unless_equals_int (res, GST_RTSP_OK);
+
+ res = gst_rtsp_message_add_header_by_name (msg, "CSeq", "3");
+ fail_unless_equals_int (res, GST_RTSP_OK);
+
+ res = gst_rtsp_message_get_header (msg, GST_RTSP_HDR_CSEQ, &val, 0);
+ fail_unless_equals_int (res, GST_RTSP_OK);
+ fail_unless_equals_string (val, "3");
+
+ val = NULL;
+ res = gst_rtsp_message_get_header_by_name (msg, "cseq", &val, 0);
+ fail_unless_equals_int (res, GST_RTSP_OK);
+ fail_unless_equals_string (val, "3");
+
+ res = gst_rtsp_message_free (msg);
+ fail_unless_equals_int (res, GST_RTSP_OK);
}
GST_END_TEST;