summaryrefslogtreecommitdiff
path: root/src/tests/ui_elements.c
diff options
context:
space:
mode:
authorphysick <mynameisgennadiy@vk.com>2026-09-06 16:10:24 +0500
committerphysick <mynameisgennadiy@vk.com>2026-09-06 16:10:24 +0500
commit2284646db66fc117246225bd30298ddbef8ed13a (patch)
tree05f3d0ff88932c9f49db00821f12a3a1ee6f2ea8 /src/tests/ui_elements.c
parentc88bb49416aaeb13c3969727a305bc7ed3263963 (diff)
win conditionHEADmaster
Diffstat (limited to 'src/tests/ui_elements.c')
-rw-r--r--src/tests/ui_elements.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/tests/ui_elements.c b/src/tests/ui_elements.c
new file mode 100644
index 0000000..a13492d
--- /dev/null
+++ b/src/tests/ui_elements.c
@@ -0,0 +1,35 @@
+#include "../ui_elements/UI.h"
+#include "test.h"
+#include <stddef.h>
+#include <string.h>
+#include <stdio.h>
+
+char *timerPrintDisplay() {
+ char buf[16];
+
+ size_t time = 0;
+ PrintTime(buf, time);
+ if (strcmp(buf, "00:00")) return reportError("The 00:00 test failed: got: '%s'", buf);
+
+ time = 3;
+ PrintTime(buf, time);
+ if (strcmp(buf, "00:03")) return reportError("The 00:03 test failed: got: '%s'", buf);
+
+ time = 30;
+ PrintTime(buf, time);
+ if (strcmp(buf, "00:30")) return reportError("The 00:30 test failed: got: '%s'", buf);
+
+ time = 60;
+ PrintTime(buf, time);
+ if (strcmp(buf, "01:00")) return reportError("The 01:00 test failed: got: '%s'", buf);
+
+ time = 63;
+ PrintTime(buf, time);
+ if (strcmp(buf, "01:03")) return reportError("The 01:03 test failed: got: '%s'", buf);
+
+ time = 60 * 100;
+ PrintTime(buf, time);
+ if (strcmp(buf, "100:00")) return reportError("The 100:00 test failed: got: '%s'", buf);
+
+ return NULL;
+}