diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 10:39:45 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 10:39:45 +0000 |
| commit | 4a34e970fb224be7640883f6b0dfa602157759f4 (patch) | |
| tree | 3f2e0a54163b179b411e604b6362c08cb1075d3d /tests/ii/overload-methods/reference.cc | |
| parent | b47c302bbffd668334f307d512b674f804f8f2fc (diff) | |
test(overload): add randomized differential coverage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/ii/overload-methods/reference.cc')
| -rw-r--r-- | tests/ii/overload-methods/reference.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ii/overload-methods/reference.cc b/tests/ii/overload-methods/reference.cc new file mode 100644 index 0000000..1ef1829 --- /dev/null +++ b/tests/ii/overload-methods/reference.cc @@ -0,0 +1,21 @@ +#include <cstdint> +#include <iostream> +#include <string> + +int main() { + int count; + if (!(std::cin >> count)) return 1; + for (int row = 0; row < count; ++row) { + std::int64_t a, b, size; + std::string text; + if (!(std::cin >> a >> b >> size >> text)) return 1; + // Model the resulting values directly, without reproducing class dispatch. + const auto number = 2 * a + 3; + const auto length = text.size(); + std::cout << 5 << ':' << number << ':' << length + 20 << ':' << a - b + << ':' << 5 << ':' << 5 * size << ':' << number + 3 * b << ':' + << (number > b / 8.0 ? "TRUE" : "FALSE") << ':' << text << "!:" + << a - b << ':'; + std::cout << length << ':' << a + 3 * b << ':' << length + 20 << '\n'; + } +} |
