Commit graph

18 commits

Author SHA1 Message Date
Peter Hutterer
9a65d90e88 test: move the spa tests to pwtest
Move the spa tests to the pwtest framework. The pod tests have only been
wrapped in the function callers, they don't use the variuos pwtest helpers -
too much work for very little gain here. Can be done incrementally if needed.

Note that this removes the spa tests from the installed tests. Arguably,
installing those tests was unnecessary anyway since they are static binaries
and don't load anything. So having them installed runs the same tests as
having them run in the source tree.

Goal for the pwtest framework is to allow for installed tests, just not there
yet.
2021-06-09 18:00:59 +10:00
Peter Hutterer
7697ed0757 treewide: replace strcmp() == 0 with spa_streq()
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Wim Taymans
7c819320c7 tests: fix test of array values
Don't assign but test. Also test the right array index..
2021-03-27 20:10:01 +01:00
Wim Taymans
ebf324590b pod: handle various ways of making empty array/choice
Make it possible to make empty array/choice
Handle empty array/choice
Add some tests to make empty arrays/choice objects
2021-01-25 10:55:30 +01:00
Simon McVittie
a652edce0a Only assert about x86_64 struct sizes if ABI is LP64, not x32
The __x86_64__ macro identifies a CPU family, and is unfortunately not
enough to identify a concrete ABI.

The normal x86_64 ABI that is used by practical Linux distributions is
LP64 (i.e. 32-bit int, and 64-bit long and pointer), and defines
__x86_64__ and __LP64__.

x32 is a niche ILP32 ABI (i.e. 32-bit int, long and pointer) for x86_64
CPUs, which has different struct sizes due to sizeof(long) and
sizeof(void *) being smaller. It defines __x86_64__ and __ILP32__.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-09-07 15:21:17 +00:00
Wim Taymans
ffc50a1bbf tests: make test work on 32 bits 2020-01-15 20:53:47 +01:00
Wim Taymans
f649c6f3c1 tests: pass the right type to SPA_POD_Long() 2020-01-15 16:39:00 +01:00
Wim Taymans
4e8d85da2f Fix some unit test
Run abi checks only on x86_64 until we have sizes for more archs
Don't start a daemon in the tests because that would require
XDG_RUNTIME_DIR set
2020-01-15 13:23:49 +01:00
Wim Taymans
891c5fd79d builder: make _rewind part of _reset()
_reset() should also rewind the work that has been done. We don't
need _rewind() anymore then.
2019-06-26 12:45:36 +02:00
Wim Taymans
350e8051a7 builder: add _rewind method
Add a rewind method to undoes the data of a frame.
Add unit test for overflow and rewind
2019-06-26 12:17:01 +02:00
Wim Taymans
448c1937ad hook: separate spa_callbacks from the hook
Make a spa_callbacks with just the functions and data and use this
in the hook and objects.
2019-05-15 12:17:52 +02:00
Wim Taymans
6ee192dff5 hooks: use hook to implement the callbacks
This way we get the version check implemented and save some
code.
2019-05-15 11:19:23 +02:00
Wim Taymans
68bcc6b8e8 pod: move vararg macros to separate file 2019-01-25 16:17:29 +01:00
Wim Taymans
351fb9ce29 pod: improve parser and builder
Remove the spa_pod_iter helpers
Remove builder/parser vararg recurse option, you have to
manually recurse into structures when needed. This simplifies
things a lot.
Pass spa_pod_frames to builder and parser explicitly, we don't
have to keep an internal stack anymore.
The parser is now almost a mirror image of the builder.
Make the parser safer when iterating over objects, add functions
to check and get pod contents in a safe way.
Make the builder return errno style results on errors
Improve performance of object properties when they are stored and
retrieved in the same order.
Add many more tests for the builder and parser
Add some benchmarks
2019-01-22 17:38:23 +01:00
Wim Taymans
878ae769ef parser: improve parser
Add more unit tests
2019-01-18 13:40:05 +01:00
Wim Taymans
5f236203d6 test: add more pod tests 2019-01-17 18:05:52 +01:00
Wim Taymans
2622e085a9 pod: add more helpers
Implement more unit-tests
2019-01-17 17:23:47 +01:00
Wim Taymans
3ee463ed3a spa: Update tests and examples
Keep tests in spa/tests
Make spa/examples
Remove some old examples
2019-01-17 09:27:41 +01:00