/*+ ARES/HADES/BORG Package -- ./libLSS/tests/testFramework.hpp Copyright (C) 2014-2020 Guilhem Lavaux Copyright (C) 2009-2020 Jens Jasche Additional contributions from: Guilhem Lavaux (2023) +*/ #ifndef __LIBLSS_TESTS_TESTFRAMEWORK_HPP #define __LIBLSS_TESTS_TESTFRAMEWORK_HPP #include #include #include namespace LibLSS_tests { extern std::string reference_path; namespace { namespace prefix { namespace details { std::string prefix_type(float a) { return "f"; } std::string prefix_type(double a) { return "f"; } std::string prefix_type(int a) { return "i"; } std::string prefix_type(std::complex a) { return "c"; } std::string prefix_type(std::complex a) { return "c"; } } // namespace details template std::string get() { return details::prefix_type(T()); } } // namespace prefix } // namespace template void loadReferenceInput(size_t N, boost::multi_array_ref &data) { H5::H5File f(reference_path, H5F_ACC_RDONLY); CosmoTool::hdf5_read_array( f, boost::str(boost::format("%s_size_%d") % prefix::get() % N), data, false, true); } } // namespace LibLSS_tests #endif