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

« back to all changes in this revision

Viewing changes to testsuite/geis2/check_event.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 GEIS v2.0 Event Module.
 
3
 */
 
4
#include <check.h>
 
5
 
 
6
#include <geis/geis.h>
 
7
 
 
8
/* Compile-time test to ensure types are defined*/
 
9
START_TEST(geis_event_types)
 
10
{
 
11
  GeisEventType type;
 
12
  type = GEIS_EVENT_DEVICE_AVAILABLE;
 
13
  type = GEIS_EVENT_DEVICE_UNAVAILABLE;
 
14
  type = GEIS_EVENT_CLASS_AVAILABLE;
 
15
  type = GEIS_EVENT_CLASS_CHANGED;
 
16
  type = GEIS_EVENT_CLASS_UNAVAILABLE;
 
17
  type = GEIS_EVENT_GESTURE_BEGIN;
 
18
  type = GEIS_EVENT_GESTURE_UPDATE;
 
19
  type = GEIS_EVENT_GESTURE_END;
 
20
  type = GEIS_EVENT_INIT_COMPLETE;
 
21
  type = GEIS_EVENT_USER_DEFINED;
 
22
  type = GEIS_EVENT_ERROR;
 
23
}
 
24
END_TEST
 
25
 
 
26
/* Compile-and-link-time test to verify required functions exist */
 
27
START_TEST(geis_event_functions)
 
28
{
 
29
  GeisEvent event = NULL;
 
30
  GeisEventType t CK_ATTRIBUTE_UNUSED;
 
31
  GeisSize s CK_ATTRIBUTE_UNUSED;
 
32
  GeisAttr a CK_ATTRIBUTE_UNUSED;
 
33
  GeisAttr n CK_ATTRIBUTE_UNUSED;
 
34
 
 
35
  geis_event_delete(event);
 
36
  t = geis_event_type(event);
 
37
  s = geis_event_attr_count(event);
 
38
  a = geis_event_attr(event, 0);
 
39
  n = geis_event_attr_by_name(event, "none");
 
40
}
 
41
END_TEST
 
42
 
 
43
 
 
44
/* boilerplate */
 
45
Suite *
 
46
geis2_event_suite_new()
 
47
{
 
48
  Suite *s = suite_create("geis2_event");
 
49
 
 
50
  TCase *event = tcase_create("geis2_event");
 
51
  tcase_add_test(event, geis_event_types);
 
52
  suite_add_tcase(s, event);
 
53
 
 
54
  return s;
 
55
}
 
56