Commit cb1b25db cb1b25db901a996ee5901fa02d4dce8aa3b1f70d by Sergey Poznyakoff

Avoid using expr in tests with ulong as its argument.

* configure.ac (MU_ULONG_MAX): Rename to MU_ULONG_MAX_1,
decrease by one accordingly.
* imap4d/tests/IDEF0955.at: Use MU_ULONG_MAX_1 instead of
calling expr.
* imap4d/tests/IDEF0956.at: Likewise.
* imap4d/tests/atlocal.in: Define MU_ULONG_MAX_1.
1 parent f9a486e8
......@@ -643,7 +643,7 @@ AC_CHECK_TYPE(socklen_t, , AC_DEFINE(socklen_t, int, [Define to int if <sys/type
AC_CHECK_TYPE(long long, , AC_DEFINE(LONG_LONG, long, [Define to long if compiler does not support]))
AC_CHECK_TYPE(long double, , AC_DEFINE(LONG_DOUBLE, double, [Define to double if compiler does not support]))
AC_SUBST(MU_ULONG_MAX)
AC_SUBST(MU_ULONG_MAX_1)
AC_RUN_IFELSE([AC_LANG_PROGRAM(
[#include <stdio.h>
#include <stdlib.h>
......@@ -652,13 +652,13 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM(
FILE *f = fopen ("conftest.val", "w");
if (! f)
exit (1);
fprintf(f, "%lu\n", ULONG_MAX);
fprintf(f, "%lu\n", ULONG_MAX-1);
fclose(f);
return 0;]
)],
[MU_ULONG_MAX=`cat conftest.val`],
[MU_ULONG_MAX=0],
[MU_ULONG_MAX=0])
[MU_ULONG_MAX_1=`cat conftest.val`],
[MU_ULONG_MAX_1=0],
[MU_ULONG_MAX_1=0])
AC_STRUCT_TM
AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.tm_gmtoff, struct tm.tm_isdst],
......
......@@ -17,12 +17,12 @@
AT_SETUP([IDEF0955])
AT_CHECK([
limit=`expr $MU_ULONG_MAX - 1`
test $MU_ULONG_MAX_1 -eq 0 && AT_SKIP_TEST
cat > input <<EOT
1 select INBOX
2 FETCH 1:$limit FLAGS
3 UID FETCH 1:$limit FLAGS
2 FETCH 1:$MU_ULONG_MAX_1 FLAGS
3 UID FETCH 1:$MU_ULONG_MAX_1 FLAGS
X LOGOUT
EOT
......
......@@ -17,11 +17,11 @@
AT_SETUP([IDEF0956])
AT_CHECK([
limit=`expr $MU_ULONG_MAX - 1`
test $MU_ULONG_MAX_1 -eq 0 && AT_SKIP_TEST
cat > input <<EOT
1 select INBOX
2 FETCH 1 BODY[[TEXT]]<0.$limit>
2 FETCH 1 BODY[[TEXT]]<0.$MU_ULONG_MAX_1>
X LOGOUT
EOT
......
......@@ -3,7 +3,7 @@
# Copyright (C) 2011-2012 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/imap4d:$top_srcdir:$srcdir:$PATH
MU_ULONG_MAX=@MU_ULONG_MAX@
MU_ULONG_MAX_1=@MU_ULONG_MAX_1@
remove_untagged() {
sed '/^\*/d'
......