Back to index

opendkim  2.6.6
t-test111.c
Go to the documentation of this file.
00001 /*
00002 **  Copyright (c) 2005-2008 Sendmail, Inc. and its suppliers.
00003 **    All rights reserved.
00004 **
00005 **  Copyright (c) 2009-2011, The OpenDKIM Project.  All rights reserved.
00006 */
00007 
00008 #ifndef lint
00009 static char t_test111_c_id[] = "@(#)$Id: t-test111.c,v 1.3 2010/03/01 18:21:46 cm-msk Exp $";
00010 #endif /* !lint */
00011 
00012 #include "build-config.h"
00013 
00014 /* system includes */
00015 #include <sys/types.h>
00016 #include <assert.h>
00017 #include <string.h>
00018 #include <stdio.h>
00019 
00020 #ifdef USE_GNUTLS
00021 # include <gnutls/gnutls.h>
00022 #endif /* USE_GNUTLS */
00023 
00024 /* libopendkim includes */
00025 #include "../dkim.h"
00026 #include "../dkim-internal.h"
00027 #include "../util.h"
00028 
00029 #define       MAXHEADER     4096
00030 
00031 #define       QP_IN         "root=40example=2E=\r\ncom\n"
00032 #define       QP_OUT        "root@example.com\n"
00033 
00034 /*
00035 **  MAIN -- program mainline
00036 **
00037 **  Parameters:
00038 **     The usual.
00039 **
00040 **  Return value:
00041 **     Exit status.
00042 */
00043 
00044 int
00045 main(int argc, char **argv)
00046 {
00047        int olen;
00048        char buf[BUFRSZ + 1];
00049 
00050        printf("*** quoted-printable decode\n");
00051 
00052        olen = dkim_qp_decode(QP_IN, buf, sizeof buf);
00053        assert(olen == strlen(QP_OUT));
00054        buf[olen] = '\0';
00055        assert(strcmp(QP_OUT, buf) == 0);
00056 
00057        return 0;
00058 }