Tizen 2.0 Release
[external/libgnutls26.git] / tests / init_roundtrip.c
1 /*
2  * Copyright (C) 2004, 2005, 2008, 2009, 2010 Free Software Foundation,
3  * Inc.
4  *
5  * Author: Simon Josefsson
6  *
7  * This file is part of GnuTLS.
8  *
9  * GnuTLS is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * GnuTLS is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with GnuTLS; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27
28 #include <stdio.h>
29
30 #include "utils.h"
31
32 /* See <http://bugs.gentoo.org/272388>. */
33
34 void
35 doit (void)
36 {
37   int res;
38
39   res = gnutls_global_init ();
40   if (res != 0)
41     fail ("gnutls_global_init\n");
42
43   gnutls_global_deinit ();
44
45   res = gnutls_global_init ();
46   if (res != 0)
47     fail ("gnutls_global_init2\n");
48
49   gnutls_global_deinit ();
50
51   if (debug)
52     success ("init-deinit round-trip success\n");
53 }