// // libsemigroups - C++ library for semigroups and monoids // Copyright (C) 2019 James D. Mitchell // // 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 <http://www.gnu.org/licenses/>. //
// The purpose of this file is to test the Runner class.
#include <cstddef> // for size_t
#include"catch.hpp"// for REQUIRE, REQUIRE_NOTHROW #include"libsemigroups/report.hpp"// for ReportGuard #include"libsemigroups/runner.hpp"// for Runner #include"test-main.hpp"// for LIBSEMIGROUPS_TEST_CASE
bool first_time = true; namespace { bool fn_ptr() { if (first_time) {
first_time = false; returnfalse;
} // if we return true the first time, then run is not called at all returntrue;
}
} // namespace
LIBSEMIGROUPS_TEST_CASE("Runner", "009", "run_until with function pointer", "[quick][no-valgrind]") { auto rg = ReportGuard(REPORT);
TestRunner1 tr;
tr.run_until(fn_ptr);
REQUIRE(tr.finished());
REQUIRE(tr.stopped());
REQUIRE(!tr.dead());
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.