chore: add MIT license headers and author attribution to all source files

This commit is contained in:
2025-03-16 04:49:29 +00:00
parent 5618666314
commit 4822b48406
40 changed files with 742 additions and 367 deletions
+19 -10
View File
@@ -1,3 +1,12 @@
// Written by retoor@molodetz.nl
// This program tests the functionality of converting milliseconds into a readable format using assertions to verify correct output, using
// an assumed custom testing and time conversion library.
// The source code uses the custom includes "rtime.h" for time conversion and "rtest.h" for testing framework functionalities.
// MIT License
#include "rtime.h"
#include "rtest.h"
#include <string.h>
@@ -5,15 +14,15 @@
int main() {
rtest_banner("time");
rtest_banner("Milliseconds tests");
rtest_assert(!strcmp(msecs_str(0), "0Ms"));
rtest_assert(!strcmp(msecs_str(1), "1Ms"));
rtest_assert(!strcmp(msecs_str(12), "12Ms"));
rtest_assert(!strcmp(msecs_str(123), "123Ms"));
rtest_assert(!strcmp(msecs_str(999), "999Ms"));
rtest_assert(strcmp(msecs_str(0), "0Ms") == 0);
rtest_assert(strcmp(msecs_str(1), "1Ms") == 0);
rtest_assert(strcmp(msecs_str(12), "12Ms") == 0);
rtest_assert(strcmp(msecs_str(123), "123Ms") == 0);
rtest_assert(strcmp(msecs_str(999), "999Ms") == 0);
rtest_banner("Second tests");
rtest_assert(!strcmp(msecs_str(1000), "1s"));
rtest_assert(!strcmp(msecs_str(1100), "1.1s"));
rtest_assert(!strcmp(msecs_str(1234), "1.234s"));
rtest_assert(!strcmp(msecs_str(12345), "12.345s"));
return rtest_end("successs");
rtest_assert(strcmp(msecs_str(1000), "1s") == 0);
rtest_assert(strcmp(msecs_str(1100), "1.1s") == 0);
rtest_assert(strcmp(msecs_str(1234), "1.234s") == 0);
rtest_assert(strcmp(msecs_str(12345), "12.345s") == 0);
return rtest_end("success");
}