mirror of https://git.tukaani.org/xz.git
Tests: Fix compilation error when threading support has been disabled.
Now tests that require threading are skipped when threading support has been disabled. Thanks to Sebastian Andrzej Siewior.
This commit is contained in:
parent
fae37ad2af
commit
6ca5c354bd
|
@ -235,6 +235,9 @@ test_lzma_get_check_st(void)
|
||||||
static void
|
static void
|
||||||
test_lzma_get_check_mt(void)
|
test_lzma_get_check_mt(void)
|
||||||
{
|
{
|
||||||
|
#ifndef MYTHREAD_ENABLED
|
||||||
|
assert_skip("Threading support disabed");
|
||||||
|
#else
|
||||||
const uint32_t flags = LZMA_TELL_ANY_CHECK |
|
const uint32_t flags = LZMA_TELL_ANY_CHECK |
|
||||||
LZMA_TELL_UNSUPPORTED_CHECK |
|
LZMA_TELL_UNSUPPORTED_CHECK |
|
||||||
LZMA_TELL_NO_CHECK;
|
LZMA_TELL_NO_CHECK;
|
||||||
|
@ -311,6 +314,7 @@ test_lzma_get_check_mt(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lzma_end(&strm);
|
lzma_end(&strm);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,12 @@ test_lzma_physmem(void)
|
||||||
static void
|
static void
|
||||||
test_lzma_cputhreads(void)
|
test_lzma_cputhreads(void)
|
||||||
{
|
{
|
||||||
|
#ifndef MYTHREAD_ENABLED
|
||||||
|
assert_skip("Threading support disabed");
|
||||||
|
#else
|
||||||
if (lzma_cputhreads() == 0)
|
if (lzma_cputhreads() == 0)
|
||||||
assert_skip("Could not determine cpu core count");
|
assert_skip("Could not determine cpu core count");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,9 @@ test_memlimit_stream_decoder(void)
|
||||||
static void
|
static void
|
||||||
test_memlimit_stream_decoder_mt(void)
|
test_memlimit_stream_decoder_mt(void)
|
||||||
{
|
{
|
||||||
|
#ifndef MYTHREAD_ENABLED
|
||||||
|
assert_skip("Threading support disabed");
|
||||||
|
#else
|
||||||
lzma_stream strm = LZMA_STREAM_INIT;
|
lzma_stream strm = LZMA_STREAM_INIT;
|
||||||
lzma_mt mt = {
|
lzma_mt mt = {
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
|
@ -79,6 +82,7 @@ test_memlimit_stream_decoder_mt(void)
|
||||||
|
|
||||||
assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END);
|
assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END);
|
||||||
lzma_end(&strm);
|
lzma_end(&strm);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue