/* * * Copyright (C) 2024 Brett Terpstra * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LILFBTF5_TESTS_H #define LILFBTF5_TESTS_H #include "blt/std/types.h" #include #include #include namespace fb { using arg_count_t = blt::size_t; //template //using arg_t = std::variant; template, bool> = true> class function_base_t { protected: ENUM_TYPE type_; arg_count_t args_count_; public: constexpr function_base_t(ENUM_TYPE type, arg_count_t args_count): type_(type), args_count_(args_count) {} template constexpr auto operator()(arg_types&& ... args) const { return BASE::call(std::forward(args)...); } [[nodiscard]] constexpr ENUM_TYPE type() const noexcept { return type_; } [[nodiscard]] constexpr arg_count_t argCount() const noexcept { return args_count_; } }; void run_tree_type_tests(blt::size_t population_size, blt::size_t tree_min_size, blt::size_t tree_max_size); inline void execute_tests() { run_tree_type_tests(1, 5, 17); run_tree_type_tests(10, 5, 17); run_tree_type_tests(100, 5, 17); run_tree_type_tests(1000, 5, 17); run_tree_type_tests(10000, 5, 17); run_tree_type_tests(100000, 5, 17); run_tree_type_tests(1000000, 5, 17); } } #endif //LILFBTF5_TESTS_H