Closed wkearn closed 2 days ago
Test failures are due to unused variable errors in Release builds. The assert
macros don't get expanded in Release builds, so any variables that are only used in the asserts count as unused. Since we do want to test on the Release builds, I think we need to use something other than assert
for the tests.
Relevant to #55
This PR refactors
test/random_dem.cpp
to make the tests more clear. Each test is extracted to its own function, and therandom_dem_test
function sets up the data, calls the appropriate libtopotoolbox functions, and calls the appropriate test functions.test/gwdt.cpp
, which largely duplicatedtest/random_dem.cpp
, is not merged withtest/random_dem.cpp
. Its tests are put into a functiontest_gwdt
, which is run with the others. This improves the test speed, because the flow routing functions likefillsinks
only need to be run once.This is not exactly what I would like to do for #55. Adding a new property still requires a lot of boilerplate code for scanning through the result arrays. I am using the
assert
macro now to throw errors, which is simpler and more readable, but provides less information. Also theassert
macro immediately aborts upon test failure, so a single failing property halts the entire testing process.