Commit graph

5 commits

Author SHA1 Message Date
Peter Hutterer 49f3d5842e test: replace all spa_assert() macros with spa_assert_se()
These are tests, we never want those to be optimized away.
2021-07-27 10:24:44 +10:00
Peter Hutterer 4f49e893c1 test: init the pod test buffer with a fixed value
Works around the valgrind complaints when we call spa_debug_mem() on the
buffer with various sizes.
2021-07-07 11:03:23 +00:00
Barnabás Pőcze f5d51162c4 treewide: mark things static and const
Mark some structures, arrays static/const at various places.
In some cases this prevents unnecessary initialization
when a function is entered.

All in all, the text segments across all shared
libraries are reduced by about 2 KiB. However,
the total size increases by about 2 KiB as well.
2021-06-30 14:44:08 +02:00
Peter Hutterer 01c2cb3d45 test: shut up coverity complaints about side effects
CID 1457494:  Incorrect expression  (ASSERT_SIDE_EFFECT)
Assignment "ai = (void *)((uint8_t *)pod + 16)" has a side effect.  This code will work differently in a non-debug build.
550             spa_assert((ai = SPA_POD_ARRAY_VALUES(pod)) != NULL);

Patch generated with coccinelle snippet
	@@
	expression E1, E2;
	@@
	- spa_assert((E1 = E2) != NULL);
	+ E1 = E2;
	+ spa_assert(E1 != NULL);

And run again for == NULL
2021-06-24 11:14:27 +00:00
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
Renamed from spa/tests/test-pod.c (Browse further)