MCPcopy Create free account
hub / github.com/ArashPartow/exprtk / main

Function main

exprtk_test.cpp:12807–12866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12805template <> struct type_name<long double> { static inline std::string value() { return "long double"; } };
12806
12807int main(int argc, char*argv[])
12808{
12809 const std::string test_set = (argc == 2) ? std::string(argv[1]) : "";
12810
12811 #define perform_test(Type,Number) \
12812 { \
12813 const std::string test_name = "run_test"#Number; \
12814 if ( \
12815 test_set.empty() || \
12816 test_set.find(test_name) != std::string::npos \
12817 ) \
12818 { \
12819 exprtk::timer timer; \
12820 timer.start(); \
12821 if (!run_test##Number<Type>()) \
12822 { \
12823 printf("run_test"#Number" (%s) *** FAILED! ***\n", \
12824 type_name<Type>::value().c_str()); \
12825 result = EXIT_FAILURE; \
12826 } \
12827 else \
12828 { \
12829 timer.stop(); \
12830 printf("run_test"#Number" (%s) - Result: SUCCESS Time: %8.4fsec\n", \
12831 type_name<Type>::value().c_str(), \
12832 timer.time()); \
12833 } \
12834 } \
12835 } \
12836
12837 int result = 0;
12838
12839 perform_test( numeric_type, 00 )
12840 perform_test( numeric_type, 01 )
12841 perform_test( numeric_type, 02 )
12842 perform_test( numeric_type, 03 )
12843 perform_test( numeric_type, 04 )
12844 perform_test( numeric_type, 05 )
12845 perform_test( numeric_type, 06 )
12846 perform_test( numeric_type, 07 )
12847 perform_test( numeric_type, 08 )
12848 perform_test( numeric_type, 09 )
12849 perform_test( numeric_type, 10 )
12850 perform_test( numeric_type, 11 )
12851 perform_test( numeric_type, 12 )
12852 perform_test( numeric_type, 13 )
12853 perform_test( numeric_type, 14 )
12854 perform_test( numeric_type, 15 )
12855 perform_test( numeric_type, 16 )
12856 perform_test( numeric_type, 17 )
12857 perform_test( numeric_type, 18 )
12858 perform_test( numeric_type, 19 )
12859 perform_test( numeric_type, 20 )
12860 perform_test( numeric_type, 21 )
12861 perform_test( numeric_type, 22 )
12862
12863 #undef perform_test
12864

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected