12#define BOOST_TEST_MODULE Test SimSetup StaticTLSReserve
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
22 const std::string reserve =
"glibc.rtld.optional_static_tls=32768";
26 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls", 32768), reserve);
27 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=", 32768), reserve);
28 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=512", 32768), reserve);
29 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=-1", 32768), reserve);
30 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=32768x", 32768), reserve);
35 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=32768", 32768),
"");
36 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=1048576", 32768),
"");
37 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.malloc.arena_max=4:glibc.rtld.optional_static_tls=65536", 32768),
"");
39 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=0x100000", 32768),
"");
40 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=0100000", 32768),
"");
41 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=0x200", 32768),
"glibc.rtld.optional_static_tls=32768");
47 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=32768:glibc.malloc.arena_max", 32768),
48 "glibc.rtld.optional_static_tls=32768");
49 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.malloc.arena_max:glibc.malloc.tcache_count=0", 32768),
50 "glibc.rtld.optional_static_tls=32768:glibc.malloc.tcache_count=0");
56 "glibc.rtld.optional_static_tls=32768:glibc.malloc.arena_max=4");
57 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls:glibc.malloc.arena_max=4", 32768),
58 "glibc.rtld.optional_static_tls=32768:glibc.malloc.arena_max=4");
60 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tlsx=1", 32768),
61 "glibc.rtld.optional_static_tls=32768:glibc.rtld.optional_static_tlsx=1");
67 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=65536:glibc.rtld.optional_static_tls=512", 32768),
68 "glibc.rtld.optional_static_tls=32768");
69 BOOST_CHECK_EQUAL(withStaticTLSReserve(
"glibc.rtld.optional_static_tls=512:glibc.rtld.optional_static_tls=65536", 32768),
"");
std::string withStaticTLSReserve(const char *tunables, unsigned long reserve=Geant4StaticTLSReserve)
BOOST_AUTO_TEST_CASE(missing_or_broken_reserve_is_added)
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())