interplane-mv
INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority.
Brought by drakestapleton
interplane-mv / adapters / aien / fixtures / fix_the_test / test / test_clamp.c
| 1 | #include <stdio.h> |
| 2 | #include "../src/clamp.h" |
| 3 | |
| 4 | static int failures; |
| 5 | |
| 6 | static void check(const char *name, int got, int want) |
| 7 | { |
| 8 | if (got != want) { |
| 9 | printf("FAIL %s: got %d, want %d\n", name, got, want); |
| 10 | failures++; |
| 11 | } else { |
| 12 | printf("ok %s\n", name); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | int main(void) |
| 17 | { |
| 18 | check("inside", clamp(5, 0, 10), 5); |
| 19 | check("below", clamp(-3, 0, 10), 0); |
| 20 | check("above", clamp(42, 0, 10), 10); |
| 21 | check("at_low", clamp(0, 0, 10), 0); |
| 22 | check("at_high", clamp(10, 0, 10), 10); |
| 23 | return failures ? 1 : 0; |
| 24 | } |