core: clang-format pass against the landed root .clang-format

Pure formatting, no behaviour change. PKG landed .clang-format (Google
base, 4-space indent, 100 cols); this brings util/ and the test harness
into conformance so `clang-format --dry-run -Werror` is clean. Build and
all six test binaries unchanged and green.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HPPSGhiArbvQgwC2DNiURS
This commit is contained in:
2026-09-09 19:11:21 +04:00
co-authored by Claude Sonnet 5
parent ddf36e848a
commit a40585f419
10 changed files with 155 additions and 115 deletions
+32 -33
View File
@@ -52,11 +52,11 @@ struct Registrar {
Registrar(const char *name, void (*fn)()) { registry().push_back({name, fn}); }
};
inline void report(const char *file, int line, std::string_view expr,
std::string_view detail, bool fatal) {
inline void report(const char *file, int line, std::string_view expr, std::string_view detail,
bool fatal) {
stats().failures++;
std::fprintf(stderr, " FAIL %s:%d %.*s", file, line,
static_cast<int>(expr.size()), expr.data());
std::fprintf(stderr, " FAIL %s:%d %.*s", file, line, static_cast<int>(expr.size()),
expr.data());
if (!detail.empty())
std::fprintf(stderr, " [%.*s]", static_cast<int>(detail.size()), detail.data());
std::fprintf(stderr, "\n");
@@ -110,46 +110,45 @@ inline int run_all() {
} // namespace vt
#define VT_TEST(NAME) \
static void NAME##_impl(); \
static ::vt::Registrar NAME##_reg(#NAME, &NAME##_impl); \
#define VT_TEST(NAME) \
static void NAME##_impl(); \
static ::vt::Registrar NAME##_reg(#NAME, &NAME##_impl); \
static void NAME##_impl()
#define VT_CHECK(COND) \
do { \
::vt::stats().checks++; \
if (!(COND)) \
::vt::report(__FILE__, __LINE__, #COND, {}, /*fatal=*/false); \
#define VT_CHECK(COND) \
do { \
::vt::stats().checks++; \
if (!(COND)) \
::vt::report(__FILE__, __LINE__, #COND, {}, /*fatal=*/false); \
} while (0)
#define VT_REQUIRE(COND) \
do { \
::vt::stats().checks++; \
if (!(COND)) \
::vt::report(__FILE__, __LINE__, #COND, {}, /*fatal=*/true); \
#define VT_REQUIRE(COND) \
do { \
::vt::stats().checks++; \
if (!(COND)) \
::vt::report(__FILE__, __LINE__, #COND, {}, /*fatal=*/true); \
} while (0)
#define VT_CHECK_EQ(A, B) \
#define VT_CHECK_EQ(A, B) \
do { \
::vt::stats().checks++; \
auto &&_a = (A); \
auto &&_b = (B); \
if (!(_a == _b)) \
::vt::report(__FILE__, __LINE__, #A " == " #B, \
::vt::show(_a) + " vs " + ::vt::show(_b), false); \
::vt::stats().checks++; \
auto &&_a = (A); \
auto &&_b = (B); \
if (!(_a == _b)) \
::vt::report(__FILE__, __LINE__, #A " == " #B, \
::vt::show(_a) + " vs " + ::vt::show(_b), false); \
} while (0)
#define VT_CHECK_NE(A, B) \
#define VT_CHECK_NE(A, B) \
do { \
::vt::stats().checks++; \
auto &&_a = (A); \
auto &&_b = (B); \
if (!(_a != _b)) \
::vt::report(__FILE__, __LINE__, #A " != " #B, \
::vt::show(_a) + " vs " + ::vt::show(_b), false); \
::vt::stats().checks++; \
auto &&_a = (A); \
auto &&_b = (B); \
if (!(_a != _b)) \
::vt::report(__FILE__, __LINE__, #A " != " #B, \
::vt::show(_a) + " vs " + ::vt::show(_b), false); \
} while (0)
#define VT_FAIL(MSG) \
::vt::report(__FILE__, __LINE__, "VT_FAIL", (MSG), /*fatal=*/false)
#define VT_FAIL(MSG) ::vt::report(__FILE__, __LINE__, "VT_FAIL", (MSG), /*fatal=*/false)
#endif // VDM_TESTS_VTEST_HPP
+3 -1
View File
@@ -1,4 +1,6 @@
// vtest_main.cpp — shared entry point for every CORE test binary.
#include "vtest.hpp"
int main() { return ::vt::run_all(); }
int main() {
return ::vt::run_all();
}