summaryrefslogtreecommitdiff
path: root/tests/test-largefile.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-largefile.c')
-rw-r--r--tests/test-largefile.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/test-largefile.c b/tests/test-largefile.c
index 71ee7e942d..ce5d8a0e2e 100644
--- a/tests/test-largefile.c
+++ b/tests/test-largefile.c
@@ -24,24 +24,19 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include "intprops.h"
+
+/* Check the range of off_t.
+ With MSVC, this test succeeds only thanks to the 'sys_types' module. */
+static_assert (TYPE_MAXIMUM (off_t) >> 31 >> 31 != 0);
+
+/* Check the size of the 'struct stat' field 'st_size'.
+ ,With MSVC, this test succeeds only thanks to the 'sys_stat' module. */
+static struct stat st;
+static_assert (sizeof st.st_size == sizeof (off_t));
int
main (void)
{
- int result = 0;
-
- /* Check the size of off_t.
- With MSVC, this test succeeds only thanks to the 'sys_types' module. */
- if (sizeof (off_t) <= 4)
- result |= 1;
-
- /* Check the size of the 'struct stat' field 'st_size'.
- With MSVC, this test succeeds only thanks to the 'sys_stat' module. */
- {
- struct stat st;
- if (sizeof (st.st_size) <= 4)
- result |= 2;
- }
-
- return result;
+ return 0;
}