1 /*
2 * Copyright (C) 2004 Steve Harris
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any 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 * $Id: controller.c,v 1.2 2004/03/11 19:01:00 theno23 Exp $
15 */
16
17 #include <stdio.h>
18 #include <dssi.h>
19
main()20 int main()
21 {
22 int controller = DSSI_NONE;
23
24 if (DSSI_CONTROLLER_IS_SET(controller)) {
25 printf("DSSI_IS_SET failed %s:%d\n", __FILE__, __LINE__);
26 return 1;
27 }
28
29 controller = DSSI_CC(23);
30 if (!DSSI_IS_CC(controller)) {
31 printf("DSSI_IS_CC failed %s:%d\n", __FILE__, __LINE__);
32 return 1;
33 }
34 if (DSSI_CC_NUMBER(controller) != 23) {
35 printf("DSSI_CC_NUMBER failed (%d != 23) %s:%d\n",
36 DSSI_CC_NUMBER(controller), __FILE__, __LINE__);
37 return 1;
38 }
39
40 controller |= DSSI_NRPN(1069);
41 if (!DSSI_IS_CC(controller)) {
42 printf("DSSI_IS_CC failed %s:%d\n", __FILE__, __LINE__);
43 return 1;
44 }
45 if (DSSI_CC_NUMBER(controller) != 23) {
46 printf("DSSI_CC_NUMBER failed %s:%d\n", __FILE__, __LINE__);
47 return 1;
48 }
49 if (!DSSI_IS_NRPN(controller)) {
50 printf("DSSI_IS_NRPN failed %s:%d\n", __FILE__, __LINE__);
51 return 1;
52 }
53 if (DSSI_NRPN_NUMBER(controller) != 1069) {
54 printf("DSSI_NRPN_NUMBER failed (%d != 1069) %s:%d\n",
55 DSSI_NRPN_NUMBER(controller), __FILE__, __LINE__);
56 return 1;
57 }
58
59 printf("test passed\n");
60
61 return 0;
62 }
63
64 /* vi:set ts=8 sts=4 sw=4: */
65