liblzma: Use LZMA1EXT feature in lzma_alone_decoder().
[xz.git] / tests / test_hardware.c
blobc72d9b28fd077b168371b46aaed48551b8714153
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file test_hardware.c
4 /// \brief Tests src/liblzma/api/lzma/hardware.h API functions
5 ///
6 /// Since the output values of these functions are hardware dependent, these
7 /// tests are trivial. They are simply used to detect errors and machines
8 /// that these function are not supported on.
9 //
10 // Author: Jia Tan
12 // This file has been put into the public domain.
13 // You can do whatever you want with this file.
15 ///////////////////////////////////////////////////////////////////////////////
17 #include "tests.h"
18 #include "mythread.h"
21 static void
22 test_lzma_physmem(void)
24 // NOTE: Use _skip instead of _fail because 0 can also mean that we
25 // don't know how to get this information on this operating system.
26 if (lzma_physmem() == 0)
27 assert_skip("Could not determine amount of physical memory");
31 static void
32 test_lzma_cputhreads(void)
34 #ifndef MYTHREAD_ENABLED
35 assert_skip("Threading support disabled");
36 #else
37 if (lzma_cputhreads() == 0)
38 assert_skip("Could not determine cpu core count");
39 #endif
43 extern int
44 main(int argc, char **argv)
46 tuktest_start(argc, argv);
47 tuktest_run(test_lzma_physmem);
48 tuktest_run(test_lzma_cputhreads);
49 return tuktest_end();