]> git.ipfire.org Git - thirdparty/kmod.git/commit
testsuite: fix test_array_sort pointers inderection
authorYauheni Kaliuta <yauheni.kaliuta@redhat.com>
Tue, 8 Nov 2016 20:57:26 +0000 (22:57 +0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 9 Nov 2016 00:21:13 +0000 (22:21 -0200)
commitd24270321142baead92285e2637f09da71992868
tree50af88aa99553ba4589d65dd7539514daf195cdf
parentcb51a641d6d4c777ed38855b29131b8a1e941175
testsuite: fix test_array_sort pointers inderection

The array elements in the tests are strings, what means "char *"
in ะก. The comparation funtion takes pointers to the elements, so
the arguments become "char **". It means, that strcmp() cannot be
used directrly.

The patch creates a wrapper on strcmp() which perfoms
dereferencing of the "char **" to supply the actual strings to
strcmp(), and uses the wrapper as a comparation function for the
qsort() call.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
testsuite/test-array.c