summaryrefslogtreecommitdiffstats
path: root/src/ccapi/test/main.c
blob: eb8731c53f971f14bf6699622c719dbc963aba93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <stdio.h>
#include <limits.h>

// #include <Kerberos.h>

#include "test_ccapi_check.h"
#include "test_ccapi_constants.h"
#include "test_ccapi_context.h"
#include "test_ccapi_ccache.h"
#include "test_ccapi_iterators.h"

int main (int argc, const char * argv[]) {
    
	cc_int32 err = ccNoError;
//	cc_ccache_iterator_t cache_iterator = NULL;
//	cc_credentials_iterator_t cred_iterator = NULL;
	
	fprintf(stdout, "Testing CCAPI against CCAPI v3 rev 8 documentation...\n");
	fprintf(stdout, "Warning: this test suite is woefully incomplete and unpolished.\n");
	
	T_CCAPI_INIT;
	
	err = check_constants();
	
	// *** cc_context ***
	err = check_cc_initialize();
	err = check_cc_context_get_version();
	err = check_cc_context_release();
	err = check_cc_context_get_change_time();
	err = check_cc_context_get_default_ccache_name();
	err = check_cc_context_open_ccache();
	err = check_cc_context_open_default_ccache();
	err = check_cc_context_create_ccache();
	err = check_cc_context_create_default_ccache();
	err = check_cc_context_create_new_ccache();
	err = check_cc_context_new_ccache_iterator();
	// err = check_cc_context_lock();
	// err = check_cc_context_unlock();
	err = check_cc_context_compare();
	
	// *** cc_ccache ***
	err = check_cc_ccache_release();
	err = check_cc_ccache_destroy();
	err = check_cc_ccache_set_default();
	err = check_cc_ccache_get_credentials_version();
	err = check_cc_ccache_get_name();
	err = check_cc_ccache_get_principal();
	err = check_cc_ccache_set_principal();
	err = check_cc_ccache_store_credentials();
	err = check_cc_ccache_remove_credentials();
	err = check_cc_ccache_new_credentials_iterator();
	// err = check_cc_ccache_lock();
	// err = check_cc_ccache_unlock();
	err = check_cc_ccache_get_change_time();
	err = check_cc_ccache_get_last_default_time();
	err = check_cc_ccache_move();
	err = check_cc_ccache_compare();
	err = check_cc_ccache_get_kdc_time_offset();
	err = check_cc_ccache_set_kdc_time_offset();
	err = check_cc_ccache_clear_kdc_time_offset();
	
	// *** cc_ccache_iterator ***
	err = check_cc_ccache_iterator_next();
	
	// *** cc_credentials_iterator ***
	err = check_cc_credentials_iterator_next();
	
	fprintf(stdout, "\nFinished testing CCAPI. %d failure%s in total.\n", total_failure_count, (total_failure_count == 1) ? "" : "s");
	
    return err;
}