#pragma once #include #include Result test_main(); #define test_prelude bool rc #define test_success return true #define run_test(name) \ rc = TRY(name()); \ if (!rc) \ { \ dbgln("test failed: %s", #name); \ check(false); \ } \ else \ dbgln("test passed: %s", #name); #define validate(cond) \ if (!(cond)) \ { \ dbgln("unexpected result: %s", #cond); \ return false; \ } typedef Result TestResult;