aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Koch <kpkoch@mit.edu>2008-02-29 19:08:06 +0000
committerKevin Koch <kpkoch@mit.edu>2008-02-29 19:08:06 +0000
commit55dbf9d7dadf1783665f56b296d7e633afdc6ef1 (patch)
treeefb2c15ed32b5bc24338f1c053767eaea9e7ae61
parentb302584b340be1089e5191b0e9912124bbe65962 (diff)
downloadkrb5-55dbf9d7dadf1783665f56b296d7e633afdc6ef1.zip
krb5-55dbf9d7dadf1783665f56b296d7e633afdc6ef1.tar.gz
krb5-55dbf9d7dadf1783665f56b296d7e633afdc6ef1.tar.bz2
lib/win/Makefile.in: Added
ccutils.c, ccapi_os_ipc.cxx, ccs_reply_proc.c, ccs_os_server.cpp, ccs_reply_proc.c, ccs_win_pipe.c: comment out some debug messages. test/Makefile.in: change which tests are built. test/test_ccapi_context.c: API version 2 is now expected to pass. test/test_ccapi_iterators.c: Add progress indicator for long tests. TargetVersion: 1.7 Component: krb5-libs Ticket: 5594 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20244 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/ccapi/common/win/OldCC/ccutils.c6
-rw-r--r--src/ccapi/lib/win/Makefile.in110
-rw-r--r--src/ccapi/lib/win/ccapi_os_ipc.cxx12
-rw-r--r--src/ccapi/lib/win/ccs_reply_proc.c9
-rw-r--r--src/ccapi/server/win/Makefile.in110
-rw-r--r--src/ccapi/server/win/ccs_os_server.cpp3
-rw-r--r--src/ccapi/server/win/ccs_request_proc.c15
-rw-r--r--src/ccapi/server/win/ccs_win_pipe.c4
-rw-r--r--src/ccapi/test/Makefile.in25
-rw-r--r--src/ccapi/test/test_ccapi_context.c2
-rw-r--r--src/ccapi/test/test_ccapi_iterators.c7
11 files changed, 268 insertions, 35 deletions
diff --git a/src/ccapi/common/win/OldCC/ccutils.c b/src/ccapi/common/win/OldCC/ccutils.c
index d1b39cc..cf881cd 100644
--- a/src/ccapi/common/win/OldCC/ccutils.c
+++ b/src/ccapi/common/win/OldCC/ccutils.c
@@ -102,8 +102,9 @@ HANDLE createThreadEvent(char* uuid, char* suffix) {
event_name = allocEventName(uuid, suffix);
if (!event_name) status = cci_check_error(ccErrNoMem);
}
+#if 0
cci_debug_printf("%s event_name:%s", __FUNCTION__, event_name);
-
+#endif
if (!status) {
hEvent = CreateEvent(psa, FALSE, FALSE, event_name);
if (!hEvent) status = cci_check_error(GetLastError());
@@ -125,8 +126,9 @@ HANDLE openThreadEvent(char* uuid, char* suffix) {
event_name = allocEventName(uuid, suffix);
if (!event_name) status = cci_check_error(ccErrNoMem);
+#if 0
cci_debug_printf("%s event_name:%s", __FUNCTION__, event_name);
-
+#endif
if (!status) {
hEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, event_name);
if (!hEvent) status = cci_check_error(GetLastError());
diff --git a/src/ccapi/lib/win/Makefile.in b/src/ccapi/lib/win/Makefile.in
new file mode 100644
index 0000000..ab958d7
--- /dev/null
+++ b/src/ccapi/lib/win/Makefile.in
@@ -0,0 +1,110 @@
+# makefile: Constructs the Kerberos for Windows CCAPI DLL.
+#
+OBJS = $(OUTPRE)ccapi_ccache.obj \
+ $(OUTPRE)ccapi_ccache_iterator.obj \
+ $(OUTPRE)ccapi_context.obj \
+ $(OUTPRE)ccapi_context_change_time.obj \
+ $(OUTPRE)ccapi_credentials.obj \
+ $(OUTPRE)ccapi_credentials_iterator.obj \
+ $(OUTPRE)ccapi_ipc.obj \
+ $(OUTPRE)ccapi_os_ipc.obj \
+ $(OUTPRE)ccapi_string.obj \
+ $(OUTPRE)cci_array_internal.obj \
+ $(OUTPRE)cci_cred_union.obj \
+ $(OUTPRE)cci_debugging.obj \
+ $(OUTPRE)cci_identifier.obj \
+ $(OUTPRE)cci_message.obj \
+ $(OUTPRE)cci_os_debugging.obj \
+ $(OUTPRE)cci_os_identifier.obj \
+ $(OUTPRE)cci_stream.obj \
+ $(OUTPRE)ccs_reply_proc.obj \
+ $(OUTPRE)ccs_reply_s.obj \
+ $(OUTPRE)ccs_request_c.obj \
+ $(OUTPRE)ccutils.obj \
+ $(OUTPRE)client.obj \
+ $(OUTPRE)dllmain.obj \
+ $(OUTPRE)init.obj \
+ $(OUTPRE)rpc.obj \
+ $(OUTPRE)secure.obj \
+ $(OUTPRE)tls.obj \
+ $(OUTPRE)util.obj \
+ $(OUTPRE)win-utils.obj
+
+##### Options
+# Set NODEBUG if building release instead of debug
+
+#BUILDTOP is krb5/src and is relative to krb5/src/ccapi/lib/win, for making Makefile.
+BUILDTOP=..\..\..\
+CCAPI = $(BUILDTOP)\CCAPI
+CO = $(CCAPI)\common
+COWIN = $(CCAPI)\common\win
+CCUTIL = $(CCAPI)\common\win\OldCC
+LIBDIR = $(CCAPI)\lib
+LIBWIN = $(LIBDIR)\win
+POSIX = $(BUILDTOP)\lib\krb5\posix
+OLDCC = $(LIBWIN)\OldCC
+SRCTMP = $(LIBWIN)\srctmp
+
+!if defined(KRB5_KFW_COMPILE)
+KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
+!endif
+
+# Because all the sources are pulled together into the temp directory SRCTMP,
+# the only includes we need are to directories outside of ccapi.
+LOCALINCLUDES = /I..\$(BUILDTOP) /I..\$(BUILDTOP)\include /I..\$(BUILDTOP)\include\krb5 $(KFWINC) \
+ -I..\$(BUILDTOP)\util\et
+MIDLINCLUDES = /I..\$(BUILDTOP)\include
+
+CPPFLAGS = $(CPPFLAGS) /EHsc -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 \
+-D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS $(cvarsdll)
+
+
+##### Linker
+LINK = link
+LIBS = kernel32.lib ws2_32.lib user32.lib advapi32.lib
+LFLAGS = /nologo $(LOPTS)
+
+all:: Makefile copysrc midl $(OUTPRE)ccapi.dll finish
+
+ccs_request.h ccs_request_c.c ccs_request_s.c : ccs_request.idl ccs_request.acf
+ midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
+ ccs_request.idl
+
+ccs_reply.h ccs_reply_c.c ccs_reply_s.c : ccs_reply.idl ccs_reply.acf
+ midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
+ ccs_reply.idl
+
+copysrc :
+ echo "Copying all sources needed to build ccapi.dll to $(SRCTMP)"
+ if NOT exist $(SRCTMP)\nul mkdir $(SRCTMP)
+ xcopy /D/Y $(CO)\*.* $(SRCTMP)
+ xcopy /D/Y $(COWIN)\*.* $(SRCTMP)
+ xcopy /D/Y $(CCUTIL)\*.* $(SRCTMP)
+ xcopy /D/Y $(LIBDIR)\*.* $(SRCTMP)
+ xcopy /D/Y $(LIBWIN)\*.* $(SRCTMP)
+ xcopy /D/Y $(OLDCC)\*.* $(SRCTMP)
+ cd $(SRCTMP)
+ if NOT exist $(OUTPRE)\nul mkdir $(OUTPRE)
+
+midl : ccs_request.h ccs_reply.h
+
+# Main program:
+$(OUTPRE)ccapi.dll: $(OBJS) ccapi.def
+ $(LINK) $(LFLAGS) -entry:_DllMainCRTStartup@12 -dll /map:$*.map /out:$@ /DEF:ccapi.def $(OBJS) \
+ /implib:ccapi.lib $(dllflags) $(LIBS) $(KFWLIB) $(SCLIB) rpcrt4.lib $(conlibsdll) $(conflags)
+
+finish:
+ echo "Finished in ccapi/lib/win."
+ cd ..
+
+install::
+ echo "Doing nothing for make install"
+
+clean::
+ if exist $(OUTPRE)*.exe del $(OUTPRE)*.exe
+ if exist $(OUTPRE)*.obj del $(OUTPRE)*.obj
+ if exist $(OUTPRE)*.res del $(OUTPRE)*.res
+ if exist $(OUTPRE)*.map del $(OUTPRE)*.map
+ if exist $(OUTPRE)*.pdb del $(OUTPRE)*.pdb
+ if exist *.err del *.err
+ if exist $(SRCTMP) rm -rf $(SRCTMP) \ No newline at end of file
diff --git a/src/ccapi/lib/win/ccapi_os_ipc.cxx b/src/ccapi/lib/win/ccapi_os_ipc.cxx
index 7fc57b3..617598b 100644
--- a/src/ccapi/lib/win/ccapi_os_ipc.cxx
+++ b/src/ccapi/lib/win/ccapi_os_ipc.cxx
@@ -95,8 +95,9 @@ extern "C" cc_int32 cci_os_ipc_thread_init (void) {
if (!err) { // Save in thread local storage
tspdata_setUUID(ptspdata, uuidString);
}
+#if 0
cci_debug_printf("%s UUID:<%s>", __FUNCTION__, tspdata_getUUID(ptspdata));
-
+#endif
// Initialize old CCAPI if necessary:
if (!err) if (!Init:: Initialized()) err = Init:: Initialize( );
if (!err) if (!Client::Initialized()) err = Client::Initialize(0);
@@ -191,9 +192,10 @@ extern "C" cc_int32 cci_os_ipc_msg( cc_int32 in_launch_server,
if (!GetTspData(GetTlsIndex(), &ptspdata)) {return ccErrBadParam;}
uuid = tspdata_getUUID(ptspdata);
lenUUID = 1 + strlen(uuid); /* 1+ includes terminating \0. */
+#if 0
cci_debug_printf("%s calling remote ccs_rpc_request tsp*:0x%X", __FUNCTION__, ptspdata);
cci_debug_printf(" rpcmsg:%d; UUID[%d]:<%s> SST:%ld", in_msg, lenUUID, uuid, sst);
-
+#endif
ccs_rpc_request( /* make call with user message: */
in_msg, /* Message type */
(unsigned char*)&ptspdata, /* Our tspdata* will be sent back to the reply proc. */
@@ -217,9 +219,7 @@ extern "C" cc_int32 cci_os_ipc_msg( cc_int32 in_launch_server,
// Wait for reply handler to set event:
if (!err) {
-// cci_debug_printf(" Waiting for request reply.");
err = cci_check_error(WaitForSingleObject(replyEvent, INFINITE));//(SECONDS_TO_WAIT)*1000));
-// cci_debug_printf(" Request reply received!");
}
if (!err) {
@@ -357,7 +357,9 @@ cc_int32 ccapi_connect(const struct tspdata* tsp) {
ReleaseMutex(hCCAPIv2Mutex);
if (!status) {
+#if 0
cci_debug_printf("%s Waiting for replyEvent.", __FUNCTION__);
+#endif
status = WaitForSingleObject(replyEvent, INFINITE);//(SECONDS_TO_WAIT)*1000);
status = cci_check_error(RpcMgmtIsServerListening(CLIENT_REQUEST_RPC_HANDLE));
cci_debug_printf(" Server %sFOUND!", (status) ? "NOT " : "");
@@ -366,7 +368,5 @@ cc_int32 ccapi_connect(const struct tspdata* tsp) {
cci_debug_printf(" unexpected error while looking for server... (%u)", status);
}
- cci_debug_printf("%s TODO: check connect reply result.", __FUNCTION__);
- cci_debug_printf("%s TODO: merge this connect code with that request code.", __FUNCTION__);
return status;
} \ No newline at end of file
diff --git a/src/ccapi/lib/win/ccs_reply_proc.c b/src/ccapi/lib/win/ccs_reply_proc.c
index 8d17bfc..79f45e4 100644
--- a/src/ccapi/lib/win/ccs_reply_proc.c
+++ b/src/ccapi/lib/win/ccs_reply_proc.c
@@ -49,10 +49,9 @@ void ccs_rpc_request_reply(
struct tspdata* tsp = (struct tspdata*)*p;
cci_stream_t stream;
long status = 0;
-
+#if 0
cci_debug_printf("%s! msg#:%d SST:%ld uuid:%s", __FUNCTION__, rpcmsg, srvStartTime, uuid);
-// cci_debug_printf(" uuid from handle:<%s>", tspdata_getUUID(tsp));
-
+#endif
if (!status) {
status = cci_stream_new (&stream); /* Create a stream for the request data */
}
@@ -79,9 +78,9 @@ void ccs_rpc_connect_reply(
HANDLE hEvent = openThreadEvent(uuid, REPLY_SUFFIX);
DWORD* p = (DWORD*)(tspHandle);
-
+#if 0
cci_debug_printf("%s! msg#:%d SST:%ld uuid:%s", __FUNCTION__, rpcmsg, srvStartTime, uuid);
-
+#endif
SetEvent(hEvent);
CloseHandle(hEvent);
}
diff --git a/src/ccapi/server/win/Makefile.in b/src/ccapi/server/win/Makefile.in
new file mode 100644
index 0000000..ea095a0
--- /dev/null
+++ b/src/ccapi/server/win/Makefile.in
@@ -0,0 +1,110 @@
+# makefile: Constructs the Kerberos for Windows CCAPI server.
+
+#BUILDTOP is krb5/src and is relative to krb5/src/ccapi/server/win, for making Makefile.
+BUILDTOP=..\..\..\
+CCAPI = $(BUILDTOP)\CCAPI
+CO = $(CCAPI)\common
+COWIN = $(CCAPI)\common\win
+CCUTIL = $(CCAPI)\common\win\OldCC
+SRVDIR = $(CCAPI)\server
+SRVWIN = $(SRVDIR)\win
+POSIX = $(BUILDTOP)\lib\krb5\posix
+SRCTMP = $(SRVWIN)\srctmp
+
+!if defined(KRB5_KFW_COMPILE)
+KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
+!endif
+
+OBJS = $(OUTPRE)cci_array_internal.$(OBJEXT) \
+ $(OUTPRE)cci_cred_union.$(OBJEXT) \
+ $(OUTPRE)cci_debugging.$(OBJEXT) \
+ $(OUTPRE)cci_identifier.$(OBJEXT) \
+ $(OUTPRE)cci_message.$(OBJEXT) \
+ $(OUTPRE)cci_os_debugging.$(OBJEXT) \
+ $(OUTPRE)cci_os_identifier.$(OBJEXT) \
+ $(OUTPRE)cci_stream.$(OBJEXT) \
+ $(OUTPRE)ccs_array.$(OBJEXT) \
+ $(OUTPRE)ccs_cache_collection.$(OBJEXT) \
+ $(OUTPRE)ccs_callback.$(OBJEXT) \
+ $(OUTPRE)ccs_ccache.$(OBJEXT) \
+ $(OUTPRE)ccs_ccache_iterator.$(OBJEXT) \
+ $(OUTPRE)ccs_client.$(OBJEXT) \
+ $(OUTPRE)ccs_credentials.$(OBJEXT) \
+ $(OUTPRE)ccs_credentials_iterator.$(OBJEXT) \
+ $(OUTPRE)ccs_list.$(OBJEXT) \
+ $(OUTPRE)ccs_list_internal.$(OBJEXT) \
+ $(OUTPRE)ccs_lock.$(OBJEXT) \
+ $(OUTPRE)ccs_lock_state.$(OBJEXT) \
+ $(OUTPRE)ccs_os_pipe.$(OBJEXT) \
+ $(OUTPRE)ccs_os_server.$(OBJEXT) \
+ $(OUTPRE)ccs_pipe.$(OBJEXT) \
+ $(OUTPRE)ccs_reply_c.$(OBJEXT) \
+ $(OUTPRE)ccs_request_proc.$(OBJEXT) \
+ $(OUTPRE)ccs_server.$(OBJEXT) \
+ $(OUTPRE)ccs_win_pipe.$(OBJEXT) \
+ $(OUTPRE)ccs_request_s.$(OBJEXT) \
+ $(OUTPRE)ccutils.$(OBJEXT) \
+ $(OUTPRE)init.$(OBJEXT) \
+ $(OUTPRE)opts.$(OBJEXT) \
+ $(OUTPRE)secure.$(OBJEXT) \
+ $(OUTPRE)tls.$(OBJEXT) \
+ $(OUTPRE)util.$(OBJEXT) \
+ $(OUTPRE)win-utils.$(OBJEXT) \
+ $(OUTPRE)WorkItem.$(OBJEXT) \
+ $(OUTPRE)WorkQueue.$(OBJEXT)
+
+##### Options
+
+# Because all the sources are pulled together into the temp directory SRCTMP,
+# the only includes we need are to directories outside of ccapi.
+LOCALINCLUDES = /I..\$(BUILDTOP) /I..\$(BUILDTOP)\include /I..\$(BUILDTOP)\include\krb5 $(KFWINC) \
+ -I..\$(BUILDTOP)\util\et /I.
+MIDLI = /I..\$(BUILDTOP)\include
+
+CPPFLAGS = $(CPPFLAGS) /EHsc -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 \
+-D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS
+
+##### Linker
+LINK = link
+LIBS = rpcrt4.lib advapi32.lib ws2_32.lib user32.lib
+LFLAGS = /nologo $(LOPTS)
+
+
+all:: Makefile copysrc midl $(OUTPRE)ccapiserver.exe finish
+
+ccs_request.h ccs_request_c.c ccs_request_s.c : ccs_request.idl ccs_request.acf
+ midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
+ ccs_request.idl
+
+ccs_reply.h ccs_reply_c.c ccs_reply_s.c : ccs_reply.idl ccs_reply.acf
+ midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
+ ccs_reply.idl
+
+copysrc :
+ echo "Copying all sources needed to build ccapiserver.exe to $(SRCTMP)"
+ if NOT exist $(SRCTMP)\nul mkdir $(SRCTMP)
+ xcopy /D/Y $(CO)\*.* $(SRCTMP)
+ xcopy /D/Y $(COWIN)\*.* $(SRCTMP)
+ xcopy /D/Y $(CCUTIL)\*.* $(SRCTMP)
+ xcopy /D/Y $(SRVDIR)\*.* $(SRCTMP)
+ xcopy /D/Y $(SRVWIN)\*.* $(SRCTMP)
+ cd $(SRCTMP)
+ if NOT exist $(OUTPRE)\nul mkdir $(OUTPRE)
+
+midl : ccs_request.h ccs_reply.h
+
+$(OUTPRE)ccapiserver.exe: $(OBJS)
+ $(LINK) $(LFLAGS) /map:$*.map /out:$@ $(OBJS) $(LIBS) $(conlibsdll) $(conflags)
+
+finish :
+ @echo "Finished building ccapiserver.exe"
+ cd
+
+clean::
+ if exist $(OUTPRE)*.exe del $(OUTPRE)*.exe
+ if exist $(OUTPRE)*.obj del $(OUTPRE)*.obj
+ if exist $(OUTPRE)*.res del $(OUTPRE)*.res
+ if exist $(OUTPRE)*.map del $(OUTPRE)*.map
+ if exist $(OUTPRE)*.pdb del $(OUTPRE)*.pdb
+ if exist *.err del *.err
+ if exist $(SRCTMP) rm -rf $(SRCTMP)
diff --git a/src/ccapi/server/win/ccs_os_server.cpp b/src/ccapi/server/win/ccs_os_server.cpp
index 61392e9..a6725b4 100644
--- a/src/ccapi/server/win/ccs_os_server.cpp
+++ b/src/ccapi/server/win/ccs_os_server.cpp
@@ -242,9 +242,10 @@ cc_int32 ccs_os_server_listen_loop (int argc, const char *argv[]) {
if (worklist_remove(&rpcmsg, &pipe, &buf, &serverStartTime)) {
uuid = ccs_win_pipe_getUuid(pipe);
+#if 0
cci_debug_printf("%s: processing WorkItem msg:%ld pipeUUID:<%s> pipeHandle:0x%X SST:%ld",
__FUNCTION__, rpcmsg, uuid, ccs_win_pipe_getHandle(pipe), serverStartTime);
-
+#endif
if (serverStartTime <= getMySST()) {
switch (rpcmsg) {
case CCMSG_CONNECT: {
diff --git a/src/ccapi/server/win/ccs_request_proc.c b/src/ccapi/server/win/ccs_request_proc.c
index a1c082d..e3c741b 100644
--- a/src/ccapi/server/win/ccs_request_proc.c
+++ b/src/ccapi/server/win/ccs_request_proc.c
@@ -46,10 +46,9 @@ void ccs_rpc_request(
cci_stream_t stream;
DWORD* p = (DWORD*)(tspHandle);
WIN_PIPE* pipe = NULL;
-
- cci_debug_printf("%s rpcmsg:%d; UUID:<%s> SST:<%s>",
- __FUNCTION__, rpcmsg, pszUUID, serverStartTime);
-
+#if 0
+ cci_debug_printf("%s rpcmsg:%d; UUID:<%s> SST:<%s>", __FUNCTION__, rpcmsg, pszUUID, serverStartTime);
+#endif
status = (rpcmsg != CCMSG_REQUEST) && (rpcmsg != CCMSG_PING);
if (!status) {
@@ -74,9 +73,9 @@ void ccs_rpc_connect(
DWORD* p = (DWORD*)(tspHandle);
WIN_PIPE* pipe = ccs_win_pipe_new(pszUUID, *p);
-
+#if 0
cci_debug_printf("%s; rpcmsg:%d; UUID: <%s>", __FUNCTION__, rpcmsg, pszUUID);
-
+#endif
worklist_add( rpcmsg,
pipe,
NULL, /* No payload with connect request */
@@ -91,9 +90,9 @@ CC_UINT32 ccs_authenticate(const CC_CHAR* name) {
PDWORD pvalue = 0;
CC_UINT32 result = 0;
DWORD status = 0;
-
+#if 0
cci_debug_printf("%s ( %s )", __FUNCTION__, name);
-
+#endif
hMap = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, (LPSTR)name);
status = !hMap;
diff --git a/src/ccapi/server/win/ccs_win_pipe.c b/src/ccapi/server/win/ccs_win_pipe.c
index 7c61371..4ef807d 100644
--- a/src/ccapi/server/win/ccs_win_pipe.c
+++ b/src/ccapi/server/win/ccs_win_pipe.c
@@ -62,9 +62,9 @@ struct ccs_win_pipe_t* ccs_win_pipe_new (const char* uuid, const HANDLE h) {
out_pipe->uuid = uuidCopy;
out_pipe->clientHandle = h;
}
-
+#if 0
cci_debug_printf("0x%X = %s(%s, 0x%X)", out_pipe, __FUNCTION__, uuid, h);
-
+#endif
return out_pipe;
}
diff --git a/src/ccapi/test/Makefile.in b/src/ccapi/test/Makefile.in
index c5a5ad7..e5238c2 100644
--- a/src/ccapi/test/Makefile.in
+++ b/src/ccapi/test/Makefile.in
@@ -47,9 +47,14 @@ PINGOBJS = $(OUTPRE)ccs_request_c.$(OBJEXT) \
$(OUTPRE)pingtest.$(OBJEXT) \
$(OBJECTS)
-TEST_NAMES = test_constants \
+TESTALLOBJS=$(OUTPRE)main.$(OBJEXT) \
+ $(OBJECTS)
+
+TEST_NAMES = test_cc_ccache_iterator_next \
+ test_constants \
test_cc_initialize \
- test_cc_context_get_version
+ test_cc_context_get_version \
+ test_cc_credentials_iterator_next
MORE_TESTS = test_cc_context_release \
test_cc_context_get_change_time \
@@ -77,9 +82,7 @@ MORE_TESTS = test_cc_context_release \
test_cc_ccache_compare \
test_cc_ccache_get_kdc_time_offset \
test_cc_ccache_set_kdc_time_offset \
- test_cc_ccache_clear_kdc_time_offset \
- test_cc_ccache_iterator_next \
- test_cc_credentials_iterator_next
+ test_cc_ccache_clear_kdc_time_offset
##### Linker
LINK = link
@@ -87,8 +90,8 @@ LIBS = -lkrb5
##DOS##LIBS = advapi32.lib rpcrt4.lib user32.lib ws2_32.lib ccapi.lib
LFLAGS = /nologo $(LOPTS)
-all-mac:: setup-test-dir pingtest stop_here simple_lock_test build-base build-tests link-tests copy-script success-message
-all-windows:: setup-windows build-base $(OUTPRE)pingtest.exe build-tests copy-script success-message
+all-mac:: setup-test-dir pingtest simple_lock_test build-base build-tests link-tests copy-script success-message
+all-windows:: setup-windows build-base $(OUTPRE)pingtest.exe build-tests build-testall copy-script success-message
# compile base files used by all tests
build-base: $(PINGOBJS)
@@ -125,7 +128,7 @@ $(WINH):
copy ..\lib\win\srctmp\$@ .
# This rule assumes that nmake in ..\lib\win\ has already run.
-$(OUTPRE)pingtest.exe: $(OBJECTS)
+$(OUTPRE)pingtest.exe: $(OBJECTS) $(PINGOBJS)
# There doesn't appear to be any way to examine a variable and return a value
# indicating whether a string is present in it. We use a perl script to
# check the LIB variable. If the path to ccapi.lib isn't present, the script
@@ -141,6 +144,12 @@ $(OUTPRE)pingtest.exe: $(OBJECTS)
link-tests: $(TEST_NAMES)
+build-testall: $(TEST_NAMES) $(OBJECTS) $(TESTALLOBJS) testall.exe
+
+testall.exe:
+ $(LINK) $(linkdebug) /map:$(@B)1.map -out:$(*B)1.exe $(conflags) $(TESTALLOBJS) $(LIBS) $(conslibdll)
+
+
simple_lock_test:
$(CC) -o $(TESTDIR)/simple_lock_test simple_lock_test.c $(LIBS)
diff --git a/src/ccapi/test/test_ccapi_context.c b/src/ccapi/test/test_ccapi_context.c
index c3f6d6e..ad437de 100644
--- a/src/ccapi/test/test_ccapi_context.c
+++ b/src/ccapi/test/test_ccapi_context.c
@@ -11,7 +11,7 @@ int check_cc_initialize() {
BEGIN_TEST("cc_initialize");
// try every api_version
- err = check_once_cc_initialize(&context, ccapi_version_2, NULL, NULL, 9, "cc_initialize with ccapi_version_2"); // err == CC_BAD_API_VERSION (9) would be imported by CredentialsCache2.h
+ err = check_once_cc_initialize(&context, ccapi_version_2, NULL, NULL, ccNoError, "cc_initialize with ccapi_version_2"); // err == CC_BAD_API_VERSION (9) would be imported by CredentialsCache2.h
err = check_once_cc_initialize(&context, ccapi_version_3, NULL, NULL, ccNoError, "cc_initialize with ccapi_version_3"); // !err
err = check_once_cc_initialize(&context, ccapi_version_4, NULL, NULL, ccNoError, "cc_initialize with ccapi_version_4"); // "
err = check_once_cc_initialize(&context, ccapi_version_5, NULL, NULL, ccNoError, "cc_initialize with ccapi_version_5"); // "
diff --git a/src/ccapi/test/test_ccapi_iterators.c b/src/ccapi/test/test_ccapi_iterators.c
index e15c7de..42a4f97 100644
--- a/src/ccapi/test/test_ccapi_iterators.c
+++ b/src/ccapi/test/test_ccapi_iterators.c
@@ -2,6 +2,7 @@
#include "test_ccapi_iterators.h"
#include "test_ccapi_check.h"
#include "test_ccapi_util.h"
+#include "cci_debugging.h"
// ---------------------------------------------------------------------------
@@ -55,7 +56,8 @@ int check_cc_ccache_iterator_next() {
}
for(i = 0; !err && (i < 1000); i++)
{
- err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
+ if (i%10 == 0) cci_debug_printf("%s loop: %d", __FUNCTION__, i);
+ err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
if (ccache) {
cc_ccache_release(ccache);
ccache = NULL;
@@ -186,7 +188,8 @@ int check_cc_credentials_iterator_next() {
err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
}
for(i = 0; !err && (i < 1000); i++) {
- new_v5_creds_union(&creds_union, "BAR.ORG");
+ if (i%10 == 0) cci_debug_printf("%s loop: %d", __FUNCTION__, i);
+ new_v5_creds_union(&creds_union, "BAR.ORG");
err = cc_ccache_store_credentials(ccache, &creds_union);
release_v5_creds_union(&creds_union);
}