summaryrefslogtreecommitdiff
path: root/test/testlfsabi.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2011-03-08 22:01:29 +0000
committerStefan Fritsch <sf@apache.org>2011-03-08 22:01:29 +0000
commita735d8ae76cf59cf3b2051bb5d3959a66c072d83 (patch)
tree23b8c1781750759cb4d5ed64186cacc7257060f4 /test/testlfsabi.c
parent75e82fd9cb36d964d80e6dec61656bc27ed2d710 (diff)
downloadapr-a735d8ae76cf59cf3b2051bb5d3959a66c072d83.tar.gz
Add a test that checks that various apr types don't change their size
if an apr consumer specifies -D_FILE_OFFSET_BITS=64 or 32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1079562 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testlfsabi.c')
-rw-r--r--test/testlfsabi.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/testlfsabi.c b/test/testlfsabi.c
new file mode 100644
index 000000000..6fa39bdac
--- /dev/null
+++ b/test/testlfsabi.c
@@ -0,0 +1,60 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "testutil.h"
+#include "testlfsabi.h"
+#include "apr_file_info.h"
+
+/*
+ * Check that various types don't change size depending on
+ * -D_FILE_OFFSET_BITS=64
+ */
+
+extern void get_type_sizes32(int *res);
+extern void get_type_sizes64(int *res);
+
+void get_type_sizes(int *res)
+{
+#include "testlfsabi_include.c"
+}
+
+static void check_type_sizes(abts_case *tc, void *data)
+{
+ int normal[IDX_MAX], bits32[IDX_MAX], bits64[IDX_MAX];
+ get_type_sizes(normal);
+ get_type_sizes32(bits32);
+ get_type_sizes64(bits64);
+ CHECKSIZE(tc, normal, bits32, apr_dev_t);
+ CHECKSIZE(tc, normal, bits64, apr_dev_t);
+ CHECKSIZE(tc, normal, bits32, apr_ino_t);
+ CHECKSIZE(tc, normal, bits64, apr_ino_t);
+ CHECKSIZE(tc, normal, bits32, apr_off_t);
+ CHECKSIZE(tc, normal, bits64, apr_off_t);
+ CHECKSIZE(tc, normal, bits32, apr_socklen_t);
+ CHECKSIZE(tc, normal, bits64, apr_socklen_t);
+ CHECKSIZE(tc, normal, bits32, apr_size_t);
+ CHECKSIZE(tc, normal, bits64, apr_size_t);
+}
+
+abts_suite *testlfsabi(abts_suite *suite)
+{
+ suite = ADD_SUITE(suite)
+
+ abts_run_test(suite, check_type_sizes, NULL);
+
+ return suite;
+}
+