pipewire/test
Wim Taymans d4581755e6 spa: Improve JSON error reporting
Add struct spa_error_location that holds information about some parsing
context such as the line and column number, error and line fragment
with the error.

Make spa_json_get_error() fill in the spa_error_location instead. Add
some error codes to the error state and use this to add a parsing reason
to the location.

Add a debug function to log the error location in a nice way. Also
add a FILE based debug context to log to any FILE.

Replace pw_properties_check_string() with
pw_properties_update_string_checked() and add
pw_properties_new_string_checked(). The check string behaviour can still
be done by setting props to NULL but the main purpose is to be able to
avoid parsing the json file twice in the future.

When using the old pw_properties_update_string(), log a warning to the
log when we fail to parse the complete string.

Use the new checked functions and the debug functions to report about
parsing errors in the tools and conf parsing.

This gives errors like:

```
> pw-loopback --playback-props '{ foo =  [ f : g ] }'
error: syntax error in --playback-props: Invalid array separator
line:      1 | { foo =  [ f : g ] }
col:      14 |              ^
```
2024-03-27 15:42:29 +01:00
..
data test: add "strict" JSON tests 2024-03-25 20:49:25 +02:00
meson.build meson: fix compilation when spa-plugins is disabled 2024-02-06 11:50:54 +01:00
pwtest-compat.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
pwtest-implementation.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
pwtest.c test: add "strict" JSON tests 2024-03-25 20:49:25 +02:00
pwtest.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-array.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-client.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-config.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-context.c test: fix test 2023-07-19 11:35:03 +02:00
test-example.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-functional.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-lib.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-logger.c test: fix test error message check 2024-01-04 10:02:55 +00:00
test-loop.c hooks: add and use _fast callback function 2023-05-06 00:27:12 +02:00
test-map.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-properties.c spa: json: more parsing errors & add spa_json_get_error 2024-03-25 20:49:25 +02:00
test-pwtest.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-spa-buffer.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-spa-json.c spa: Improve JSON error reporting 2024-03-27 15:42:29 +01:00
test-spa-log.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-spa-node.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-spa-pod.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-spa-utils.c Port: Add tag param 2023-08-29 14:22:13 +02:00
test-support.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-utils.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00