Update THANKS
[xz/debian.git] / tests / test_hardware.c
blob45763f686446178f136a443f7e0624272b524634
1 // SPDX-License-Identifier: 0BSD
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 /// \file test_hardware.c
6 /// \brief Tests src/liblzma/api/lzma/hardware.h API functions
7 ///
8 /// Since the output values of these functions are hardware dependent, these
9 /// tests are trivial. They are simply used to detect errors and machines
10 /// that these function are not supported on.
12 // Author: Jia Tan
14 ///////////////////////////////////////////////////////////////////////////////
16 #include "tests.h"
17 #include "mythread.h"
20 static void
21 test_lzma_physmem(void)
23 // NOTE: Use _skip instead of _fail because 0 can also mean that we
24 // don't know how to get this information on this operating system.
25 if (lzma_physmem() == 0)
26 assert_skip("Could not determine amount of physical memory");
30 static void
31 test_lzma_cputhreads(void)
33 #ifndef MYTHREAD_ENABLED
34 assert_skip("Threading support disabled");
35 #else
36 if (lzma_cputhreads() == 0)
37 assert_skip("Could not determine cpu core count");
38 #endif
42 extern int
43 main(int argc, char **argv)
45 tuktest_start(argc, argv);
46 tuktest_run(test_lzma_physmem);
47 tuktest_run(test_lzma_cputhreads);
48 return tuktest_end();