|
@@ -2561,12 +2561,17 @@ test_util_exit_status(void *ptr)
|
|
|
int n;
|
|
|
|
|
|
(void)ptr;
|
|
|
+
|
|
|
+ clear_hex_errno(hex_errno);
|
|
|
+ test_streq("", hex_errno);
|
|
|
|
|
|
clear_hex_errno(hex_errno);
|
|
|
n = format_helper_exit_status(0, 0, hex_errno);
|
|
|
test_streq("0/0\n", hex_errno);
|
|
|
test_eq(n, strlen(hex_errno));
|
|
|
|
|
|
+#if SIZEOF_INT == 4
|
|
|
+
|
|
|
clear_hex_errno(hex_errno);
|
|
|
n = format_helper_exit_status(0, 0x7FFFFFFF, hex_errno);
|
|
|
test_streq("0/7FFFFFFF\n", hex_errno);
|
|
@@ -2577,6 +2582,21 @@ test_util_exit_status(void *ptr)
|
|
|
test_streq("FF/-80000000\n", hex_errno);
|
|
|
test_eq(n, strlen(hex_errno));
|
|
|
test_eq(n, HEX_ERRNO_SIZE);
|
|
|
+
|
|
|
+#elif SIZEOF_INT == 8
|
|
|
+
|
|
|
+ clear_hex_errno(hex_errno);
|
|
|
+ n = format_helper_exit_status(0, 0x7FFFFFFFFFFFFFFF, hex_errno);
|
|
|
+ test_streq("0/7FFFFFFFFFFFFFFF\n", hex_errno);
|
|
|
+ test_eq(n, strlen(hex_errno));
|
|
|
+
|
|
|
+ clear_hex_errno(hex_errno);
|
|
|
+ n = format_helper_exit_status(0xFF, -0x8000000000000000, hex_errno);
|
|
|
+ test_streq("FF/-8000000000000000\n", hex_errno);
|
|
|
+ test_eq(n, strlen(hex_errno));
|
|
|
+ test_eq(n, HEX_ERRNO_SIZE);
|
|
|
+
|
|
|
+#endif
|
|
|
|
|
|
clear_hex_errno(hex_errno);
|
|
|
n = format_helper_exit_status(0x7F, 0, hex_errno);
|
|
@@ -2587,6 +2607,9 @@ test_util_exit_status(void *ptr)
|
|
|
n = format_helper_exit_status(0x08, -0x242, hex_errno);
|
|
|
test_streq("8/-242\n", hex_errno);
|
|
|
test_eq(n, strlen(hex_errno));
|
|
|
+
|
|
|
+ clear_hex_errno(hex_errno);
|
|
|
+ test_streq("", hex_errno);
|
|
|
|
|
|
done:
|
|
|
;
|