~ubuntu-branches/ubuntu/trusty/geis/trusty

« back to all changes in this revision

Viewing changes to testsuite/libgeis/check_error_reporting.c

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2012-07-30 08:51:42 UTC
  • Revision ID: package-import@ubuntu.com-20120730085142-jrc33ygjvt0ob1wl
Tags: upstream-2.2.11
ImportĀ upstreamĀ versionĀ 2.2.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * unit tests for the geis_instance_table module
 
3
 */
 
4
#include <check.h>
 
5
 
 
6
#include "geis/geis.h"
 
7
#include "libgeis/geis_error.h"
 
8
 
 
9
 
 
10
START_TEST(global_error_stack)
 
11
{
 
12
  GeisSize i = 0;
 
13
 
 
14
  geis_error_clear(NULL);
 
15
  geis_error_push(NULL, GEIS_STATUS_SUCCESS);
 
16
 
 
17
  fail_unless(geis_error_count(NULL) == 1, "unexpected error stack size");
 
18
  for (i=0; i < geis_error_count(NULL); ++i)
 
19
  {
 
20
    fail_unless(geis_error_code(NULL, i) == GEIS_STATUS_SUCCESS,
 
21
                "unexpected status code retrieved");
 
22
  }
 
23
}
 
24
END_TEST
 
25
 
 
26
 
 
27
/* boilerplate */
 
28
Suite *
 
29
make_error_reporting_suite()
 
30
{
 
31
  Suite *s = suite_create("geis2-error-reporting");
 
32
 
 
33
  TCase *create = tcase_create("error-reporting");
 
34
  tcase_add_test(create, global_error_stack);
 
35
  suite_add_tcase(s, create);
 
36
 
 
37
  return s;
 
38
}
 
39