~jamesodhunt/ubuntu/saucy/upstart/1.9.1

« back to all changes in this revision

Viewing changes to init/tests/test_util.c

  • Committer: James Hunt
  • Date: 2013-06-28 15:57:37 UTC
  • mfrom: (1436.2.1)
  • Revision ID: james.hunt@ubuntu.com-20130628155737-8bskclzrhmjvpm6e
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "test_util.h"
 
2
#include "test_util_common.h"
2
3
#include <nih/logging.h>
3
4
#include <nih/test.h>
4
5
 
5
6
/**
6
 
 * string_check:
7
 
 *
8
 
 * @a: first string,
9
 
 * @b: second string.
10
 
 *
11
 
 * Compare @a and @b either or both of which may be NULL.
12
 
 *
13
 
 * Returns 0 if strings are identical or both NULL, else 1.
14
 
 **/
15
 
int
16
 
string_check (const char *a, const char *b)
17
 
{
18
 
        if (!a && !b)
19
 
                return 0;
20
 
 
21
 
        if (!a || !b)
22
 
                return 1;
23
 
 
24
 
        if (strcmp (a, b))
25
 
                return 1;
26
 
 
27
 
        return 0;
28
 
}
29
 
 
30
 
/**
31
7
 * event_operator_diff:
32
8
 * @a: first Blocked,
33
9
 * @b: second Blocked,