~ubuntu-branches/ubuntu/quantal/maildir-utils/quantal

« back to all changes in this revision

Viewing changes to app/tests/test-mu-conf.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2010-01-19 20:12:43 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100119201243-d8qmzgxgexhy1bs0
Tags: 0.6~beta1-1
* new upstream release 0.6-beta
  - that merges the several different programs under one binary mu
  - no sqlite storage is used anymore
* debian packaging changes:
  - debian/patches
    . remove all patches
  - remove debian/HOWTO (upstream document) it is completely outdated
  - debian/control:
    . adjust build-dep for gmime-2.4
    . remove build-dep on quilt and sqlite
    . adjust the description to new reality
  - debian/rules:
    . do not try to install doc files that are not present anymore
    . disable quilt adaptions
  - add debian/NEWS that explains that the separate programs are gone

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
** Copyright (C) 2008 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
3
 
**
4
 
** This program is free software; you can redistribute it and/or modify it
5
 
** under the terms of the GNU General Public License as published by the
6
 
** Free Software Foundation; either version 3, or (at your option) any
7
 
** later version.
8
 
**
9
 
** This program is distributed in the hope that it will be useful,
10
 
** but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
** GNU General Public License for more details.
13
 
**
14
 
** You should have received a copy of the GNU General Public License
15
 
** along with this program; if not, write to the Free Software Foundation,
16
 
** Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  
17
 
**  
18
 
*/
19
 
 
20
 
#include <glib.h>
21
 
#include "app/mu-conf.h"
22
 
#include "app/mu-app.h"
23
 
 
24
 
/* make sure creating a maildir succeeds */
25
 
static void
26
 
test_mu_conf (void)
27
 
{
28
 
        MuConf *conf;
29
 
        gboolean b;
30
 
        int     i;
31
 
        char*   s;
32
 
 
33
 
        char *d[] = {"testmu"};
34
 
        char **dummy = (char**)d;
35
 
 
36
 
        i = 1;
37
 
        g_assert (mu_app_init (&i, &dummy, "test-mu-conf"));
38
 
 
39
 
        g_assert ((conf = mu_conf_new ("test.conf", "foo")));
40
 
        
41
 
        /* positive */
42
 
        g_assert (mu_conf_get_bool (conf, "somebool", &b));
43
 
        g_assert (b);
44
 
        
45
 
        g_assert (mu_conf_get_int (conf, "someint", &i));
46
 
        g_assert (i == 42);
47
 
        
48
 
        g_assert (mu_conf_get_string (conf, "somestring", &s));
49
 
        g_assert_cmpstr (s, ==, "hello world");
50
 
        g_free (s);
51
 
        
52
 
        /* negative */
53
 
        g_assert (!mu_conf_get_string (conf, "anotherstring", &s));
54
 
        g_assert (!mu_conf_get_bool (conf, "anotherbool", &b));
55
 
        
56
 
        mu_conf_destroy (conf);
57
 
        mu_app_uninit ();
58
 
}
59
 
 
60
 
int
61
 
main (int argc, char *argv[])
62
 
{
63
 
        g_test_init (&argc, &argv, NULL);
64
 
        g_test_add_func ("/mu/conf", test_mu_conf);
65
 
        
66
 
        return g_test_run ();
67
 
}