gstreamer/tests/check/gst
Henry Wilkes 445df0c799 gstvalue: make gst_string_unwrap less strict
Allow a string in gst_string_unwrap to include unescaped characters that
are not in GST_STRING_IS_ASCII. This extra leniency allows
gst_structure_from_string to, e.g., receive
    name, val=(string)"string with space";

Note that many gst tests, and potentially users, exploited this behaviour
by giving
    name, val="string with space";
i.e. without the (string) type specifier. This was allowed before
because, without a type specifier, the string was passed to
_priv_gst_value_parse_string with unescape set to TRUE, *rather* than
being sent to gst_string_unwrap. This caused a difference in behaviour
between strings that are or are not preceded by (string). E.g.
    name, val=(string)"string with space";
would fail, whilst
    name, val="string with space";
would not. And
    name, val=(string)"\316\261";
would produce a val="α", whereas
    name, val=(string)"\316\261";
would produce a val="316261" (a bug).

The current behaviour is to treat both of these cases the same, which is
desirable. But in order to not break potentially common usage of this
discrepancy (it was in our own tests), the best option is to make string
parsing less strict in general.

New behaviour would be for
    name, val=(string)"string with space";
to pass and give val="string with space", and
    name, val="\316\261";
would produce a val="α".

Also changed deserializing string test to expect successes where
previously a failure was expected.

In a similar way, this also effected the deserializing of GstStructure,
GstCaps, GstTagList and GstCapsFeatures. So, now
    name, val=(structure)"sub-name, sub-val=(string)\"a: \\316\\261\";";
will also pass and give sub-val="a: α". Note that the quote marks
and backslash still need to be escaped for the sub-structure, but other
characters need not be.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/303>
2021-01-19 13:25:07 +00:00
..
capslist.h gst: Add new structure/caps/_to_string using the brackets for nesting 2020-12-03 21:46:27 -03:00
gst.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstabi.c tests: abi: fix abi test on 64-bit Windows 2018-01-11 12:04:31 +00:00
gstatomicqueue.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstbin.c bin: When removing a sink, check if the EOS status changed. 2020-10-30 03:56:02 +11:00
gstbuffer.c tests: fix leak in buffer test_wrapped_bytes test 2019-03-06 09:04:54 +00:00
gstbufferlist.c bufferlist: foreach: always remove as parent if buffer is changed 2020-03-18 14:43:08 +01:00
gstbufferpool.c tests: bufferpool: add dead lock test for buffer discard 2020-05-14 07:04:02 +00:00
gstbus.c bus: Ensure that only one GSource can be attached to the bus 2020-12-11 12:29:50 +00:00
gstcaps.c gst: Add new structure/caps/_to_string using the brackets for nesting 2020-12-03 21:46:27 -03:00
gstcapsfeatures.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstchildproxy.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstclock.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstcontext.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstcontroller.c documentation: fix a number of typos 2019-10-06 11:12:11 -04:00
gstcpp.cc tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstdatetime.c datetime: Update tests for returning NULL instead of g_return_val_if_fail() in error cases 2020-12-07 12:23:15 +02:00
gstdeinit.c Skip gst_deinit() if gstreamer was not initialized properly 2017-12-24 16:21:38 +01:00
gstdevice.c device provider: add convenience macros to register 2020-12-10 12:45:16 +01:00
gstelement.c tests: element: Don't run too many loop 2020-09-15 04:41:19 +09:00
gstelementfactory.c Use gst_object_unref() / gst_object_clear() instead of the GObject ones 2020-04-20 16:28:52 +00:00
gstevent.c event: Add unit test for INSTANT_RATE_CHANGE and INSTANT_RATE_SYNC_TIME 2020-06-11 23:16:30 +09:00
gstghostpad.c documentation: fix a number of typos 2019-10-06 11:12:11 -04:00
gstindex.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstinfo.c tests: info: Fix thread-id pattern matching on Windows 2020-03-02 04:16:50 +00:00
gstiterator.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstmemory.c Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gstmessage.c message: Add unit test for GST_MESSAGE_RATE_CHANGE 2020-06-11 23:16:33 +09:00
gstmeta.c meta: expose API to register and create custom meta 2020-09-27 11:08:03 +00:00
gstminiobject.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstobject.c Use gst_object_unref() / gst_object_clear() instead of the GObject ones 2020-04-20 16:28:52 +00:00
gstpad.c gstpad: Probes that return HANDLED can reset the data info field 2019-05-16 15:13:48 +02:00
gstparamspecs.c Use gst_object_unref() / gst_object_clear() instead of the GObject ones 2020-04-20 16:28:52 +00:00
gstpipeline.c pipeline: Call gst_task_cleanup_all() before checking reference counts after shutdown 2019-01-03 14:05:31 +00:00
gstplugin.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstpoll.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstpreset.c Source code typo fixes 2018-05-01 11:25:21 +01:00
gstprintf.c check: Don't leak test string 2020-05-08 12:10:38 +02:00
gstpromise.c check: gst_promise_reply() takes ownership 2020-05-08 12:10:38 +02:00
gstprotection.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstquery.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gstregistry.c Fix FSF address 2012-11-03 20:44:48 +00:00
gstsegment.c segment: Add unit test for GST_SEEK_FLAG_INSTANT_RATE_CHANGE 2020-06-11 10:53:59 +09:00
gststream.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gststructure.c structure: Handle trailing comas in serialized structs 2020-12-10 13:35:17 +00:00
gstsystemclock.c tests: systemclock: Stop all stress threads before joining them 2021-01-14 15:50:05 +01:00
gsttag.c taglist: Fix crash when comparing two lists of the same length but with different items 2020-05-08 11:04:14 +03:00
gsttagsetter.c Use gst_object_unref() / gst_object_clear() instead of the GObject ones 2020-04-20 16:28:52 +00:00
gsttask.c taskpool: expose new "shared" task pool implementation 2020-11-05 18:18:28 +00:00
gsttoc.c tests: include config.h and don't include unix headers 2017-11-24 13:41:20 +01:00
gsttocsetter.c Use gst_object_unref() / gst_object_clear() instead of the GObject ones 2020-04-20 16:28:52 +00:00
gsttracerrecord.c Use gst_object_unref() / gst_object_clear() instead of the GObject ones 2020-04-20 16:28:52 +00:00
gsturi.c gsturi: Add new API for storing unmodified userinfo / fragment 2020-08-03 16:07:45 +00:00
gstutils.c utils: expose GstPluginAPIFlags 2020-06-06 00:38:29 +02:00
gstvalue.c gstvalue: make gst_string_unwrap less strict 2021-01-19 13:25:07 +00:00
struct_arm.h meta: remove unnecessary padding for GstMetaInfo struct 2016-12-05 20:35:41 +00:00
struct_hppa.h meta: remove unnecessary padding for GstMetaInfo struct 2016-12-05 20:35:41 +00:00
struct_i386.h meta: remove unnecessary padding for GstMetaInfo struct 2016-12-05 20:35:41 +00:00
struct_i386w.h meta: remove unnecessary padding for GstMetaInfo struct 2016-12-05 20:35:41 +00:00
struct_ppc32.h meta: remove unnecessary padding for GstMetaInfo struct 2016-12-05 20:35:41 +00:00
struct_ppc64.h meta: remove unnecessary padding for GstMetaInfo struct 2016-12-05 20:35:41 +00:00
struct_sparc.h meta: remove unnecessary padding for GstMetaInfo struct 2016-12-05 20:35:41 +00:00
struct_x86_64.h meta: remove unnecessary padding for GstMetaInfo struct 2016-12-05 20:35:41 +00:00
struct_x86_64w.h tests: abi: fix abi test on 64-bit Windows 2018-01-11 12:04:31 +00:00