Imported Upstream version 1.20.1
[platform/upstream/krb5.git] / src / ccapi / test / test_ccapi_constants.c
1 #include "test_ccapi_constants.h"
2 #include "test_ccapi_globals.h"
3 #include "test_ccapi_check.h"
4
5 int check_constants(void) {
6         BEGIN_TEST("constants");
7         /* API versions */
8
9         check_int(ccapi_version_2, 2);
10         check_int(ccapi_version_3, 3);
11         check_int(ccapi_version_4, 4);
12         check_int(ccapi_version_5, 5);
13         check_int(ccapi_version_6, 6);
14
15         /* Errors */
16
17         check_int(ccNoError                                       , 0  );        //   0
18         check_int(ccIteratorEnd                                   , 201);    // 201
19         check_int(ccErrBadParam                               , 202);    // 202
20         check_int(ccErrNoMem                                      , 203);    // 203
21         check_int(ccErrInvalidContext             , 204);    // 204
22         check_int(ccErrInvalidCCache              , 205);    // 205
23         check_int(ccErrInvalidString              , 206);    // 206
24         check_int(ccErrInvalidCredentials         , 207);    // 207
25         check_int(ccErrInvalidCCacheIterator      , 208);    // 208
26         check_int(ccErrInvalidCredentialsIterator , 209);    // 209
27         check_int(ccErrInvalidLock                , 210);    // 210
28         check_int(ccErrBadName                    , 211);    // 211
29         check_int(ccErrBadCredentialsVersion      , 212);    // 212
30         check_int(ccErrBadAPIVersion              , 213);    // 213
31         check_int(ccErrContextLocked              , 214);    // 214
32         check_int(ccErrContextUnlocked            , 215);    // 215
33         check_int(ccErrCCacheLocked               , 216);    // 216
34         check_int(ccErrCCacheUnlocked             , 217);    // 217
35         check_int(ccErrBadLockType                , 218);    // 218
36         check_int(ccErrNeverDefault               , 219);    // 219
37         check_int(ccErrCredentialsNotFound        , 220);    // 220
38         check_int(ccErrCCacheNotFound             , 221);    // 221
39         check_int(ccErrContextNotFound            , 222);    // 222
40         check_int(ccErrServerUnavailable          , 223);    // 223
41         check_int(ccErrServerInsecure             , 224);    // 224
42         check_int(ccErrServerCantBecomeUID        , 225);    // 225
43         check_int(ccErrTimeOffsetNotSet           , 226);    // 226
44         check_int(ccErrBadInternalMessage         , 227);    // 227
45         check_int(ccErrNotImplemented             , 228);    // 228
46
47         /* Credentials versions */
48
49         check_int(cc_credentials_v5,    2);
50
51         /* Lock types */
52
53         check_int(cc_lock_read,      0);
54         check_int(cc_lock_write,     1);
55         check_int(cc_lock_upgrade,   2);
56         check_int(cc_lock_downgrade, 3);
57
58     /* Locking Modes */
59
60         check_int(cc_lock_noblock, 0);
61         check_int(cc_lock_block,   1);
62
63         END_TEST_AND_RETURN
64 }