Files
whetstone_DSL/editor/tests/step119_test.cpp
2026-02-09 13:04:58 -07:00

28 lines
934 B
C++

// Step 119 TDD Test: Zoom utilities
#include "ZoomUtils.h"
#include <iostream>
static void expect(bool cond, const std::string& name, int& passed, int& failed) {
if (cond) {
std::cout << "Test " << (passed + failed + 1) << " PASS: " << name << "\n";
++passed;
} else {
std::cout << "Test " << (passed + failed + 1) << " FAIL: " << name << "\n";
++failed;
}
}
int main() {
int passed = 0;
int failed = 0;
expect(clampFontSize(10) == 12, "clamp low", passed, failed);
expect(clampFontSize(30) == 24, "clamp high", passed, failed);
expect(clampFontSize(18) == 18, "clamp ok", passed, failed);
expect(zoomPercent(15, 15.0f) == 100, "zoom 100", passed, failed);
expect(zoomPercent(18, 15.0f) == 120, "zoom 120", passed, failed);
std::cout << "\n=== Step 119 Results: " << passed << " passed, " << failed << " failed ===\n";
return failed == 0 ? 0 : 1;
}