summaryrefslogtreecommitdiffstats
path: root/maildir/maildirkwtest2.c
diff options
context:
space:
mode:
authorSam Varshavchik2022-02-03 23:38:02 -0500
committerSam Varshavchik2022-02-03 23:38:02 -0500
commit7ccf3c9341de9dc5319e7269793c4fcc7ece4eab (patch)
tree6314785eb95176e4ceee3191347db7d9ba982da9 /maildir/maildirkwtest2.c
parentc02c7c70e57ce07f186862826168fae59df224cc (diff)
downloadcourier-libs-7ccf3c9341de9dc5319e7269793c4fcc7ece4eab.tar.bz2
Add additional tests.
Test keyword handling. Fix memory corruption in the maildirkw utilty.
Diffstat (limited to 'maildir/maildirkwtest2.c')
-rw-r--r--maildir/maildirkwtest2.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/maildir/maildirkwtest2.c b/maildir/maildirkwtest2.c
new file mode 100644
index 0000000..9a1dd7d
--- /dev/null
+++ b/maildir/maildirkwtest2.c
@@ -0,0 +1,25 @@
+#define MAILDIRKW_MOCKTIME() \
+ do { \
+ const char *p=getenv("MOCKTIME"); \
+ if (p) \
+ t=atoi(p); \
+ } while (0)
+
+#define MAILDIRKW_MOCKTIME2() \
+ do { \
+ const char *eee=getenv("MOCKTIME"); \
+ \
+ if (eee && strcmp(eee, "1000") == 0 && \
+ strcmp(p, "004") == 0) \
+ { \
+ printf("Faked stale filename\n"); \
+ fflush(stdout); \
+ p=NULL; \
+ \
+ } \
+ } while(0); \
+ \
+ i=NULL; \
+ if (p)
+
+#include "maildirkeywords2.c"