Update tests for new check library & osx

This commit is contained in:
Nils O. Selåsdal
2025-06-28 00:56:58 +02:00
parent 9d2ed015f3
commit fb8979d695
29 changed files with 449 additions and 27 deletions
+14
View File
@@ -3,6 +3,7 @@
START_TEST (test_human_bytesz_bytes)
{
char result[128];
char *rc;
@@ -13,9 +14,11 @@ START_TEST (test_human_bytesz_bytes)
rc = uc_human_bytesz_bin(999, result, sizeof result);
fail_if(rc == NULL);
ck_assert_str_eq(result, "999 b");
}
END_TEST
START_TEST (test_human_bytesz_bytes_0)
{
char result[128];
char *rc;
@@ -26,9 +29,11 @@ START_TEST (test_human_bytesz_bytes_0)
rc = uc_human_bytesz_bin(0, result, sizeof result);
fail_if(rc == NULL);
ck_assert_str_eq(result, "0 b");
}
END_TEST
START_TEST (test_human_bytesz_kilobytes)
{
char result[128];
char *rc;
@@ -39,9 +44,11 @@ START_TEST (test_human_bytesz_kilobytes)
rc = uc_human_bytesz_bin(64000, result, sizeof result);
fail_if(rc == NULL);
ck_assert_str_eq(result, "62.50 KiB");
}
END_TEST
START_TEST (test_human_bytesz_megabytes)
{
char result[128];
char *rc;
@@ -52,9 +59,11 @@ START_TEST (test_human_bytesz_megabytes)
rc = uc_human_bytesz_bin(6409000, result, sizeof result);
fail_if(rc == NULL);
ck_assert_str_eq(result, "6.11 MiB");
}
END_TEST
START_TEST (test_human_bytesz_gigabytes)
{
char result[128];
char *rc;
@@ -65,9 +74,11 @@ START_TEST (test_human_bytesz_gigabytes)
rc = uc_human_bytesz_bin(126999400000, result, sizeof result);
fail_if(rc == NULL);
ck_assert_str_eq(result, "118.28 GiB");
}
END_TEST
START_TEST (test_human_bytesz_terrabytes)
{
char result[128];
char *rc;
@@ -78,9 +89,11 @@ START_TEST (test_human_bytesz_terrabytes)
rc = uc_human_bytesz_bin(12453400030000, result, sizeof result);
fail_if(rc == NULL);
ck_assert_str_eq(result, "11.33 TiB");
}
END_TEST
START_TEST (test_human_bytesz_petabytes)
{
char result[128];
char *rc;
@@ -91,6 +104,7 @@ START_TEST (test_human_bytesz_petabytes)
rc = uc_human_bytesz_bin(~0ULL, result, sizeof result);
fail_if(rc == NULL);
ck_assert_str_eq(result, "16384.00 PiB");
}
END_TEST