test: add independent placement validation
Establish a CTest harness before changing solver behavior. Validate board dimensions, multiplicities, bounds, overlap and coverage against independent placement data, including known order-8 and constructed order-9 fixtures. Document Debug and sanitizer workflows while keeping the defects tracked by #7 and #14 separate. Prepare a result adapter so the feasible solver regression can be enabled with the completion fix. Tests: Release, ASan and UBSan CTest suites (3 passed each) Refs: #1
This commit was merged in pull request #17.
This commit is contained in:
@@ -67,6 +67,9 @@ namespace {
|
||||
|
||||
[[nodiscard]] auto length() const noexcept -> size_t { return length_; }
|
||||
|
||||
/** Get the square placements in this result. */
|
||||
[[nodiscard]] auto squares() const noexcept -> std::vector<Square> const & { return squares_; }
|
||||
|
||||
/** Output the grid. */
|
||||
auto output() const -> void {
|
||||
std::string out(length_ * length_, '.');
|
||||
@@ -303,6 +306,7 @@ namespace {
|
||||
}
|
||||
} // anon namespace
|
||||
|
||||
#ifndef PARTRIDGE_TESTING
|
||||
int main(int argc, char **argv) {
|
||||
auto n = (argc == 1) ? 8 : std::atol(argv[1]);
|
||||
auto const grid = find_solution(n);
|
||||
@@ -310,3 +314,4 @@ int main(int argc, char **argv) {
|
||||
grid.output();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user