Test more installed headers for C++ compatibility
authorKen Raeburn <raeburn@mit.edu>
Wed, 31 Oct 2007 06:59:11 +0000 (06:59 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 31 Oct 2007 06:59:11 +0000 (06:59 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20156 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/misc/Makefile.in
src/tests/misc/test_cxx_krb5.cpp
src/tests/misc/test_cxx_rpc.cpp [new file with mode: 0644]

index d05b883a4e9e1b86481614c1829c1a9bbef9cf5d..17bae094f10c83b3be62ab2eecce6e8cd968be4a 100644 (file)
@@ -11,10 +11,11 @@ SRCS=$(srcdir)/test_getpw.c
 
 all:: test_getpw
 
-check:: test_getpw test_cxx_krb5 test_cxx_gss
+check:: test_getpw test_cxx_krb5 test_cxx_gss test_cxx_rpc
        $(RUN_SETUP) $(VALGRIND) ./test_getpw
        $(RUN_SETUP) $(VALGRIND) ./test_cxx_krb5
        $(RUN_SETUP) $(VALGRIND) ./test_cxx_gss
+       $(RUN_SETUP) $(VALGRIND) ./test_cxx_rpc
 
 test_getpw: $(OUTPRE)test_getpw.$(OBJEXT) $(SUPPORT_DEPLIB)
        $(CC_LINK) $(ALL_CFLAGS) -o test_getpw $(OUTPRE)test_getpw.$(OBJEXT) $(SUPPORT_LIB)
@@ -26,9 +27,12 @@ test_cxx_krb5: $(OUTPRE)test_cxx_krb5.$(OBJEXT) $(KRB5_DEPLIB)
        $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_krb5 $(OUTPRE)test_cxx_krb5.$(OBJEXT) $(KRB5_LIB) $(LIBS)
 test_cxx_gss: $(OUTPRE)test_cxx_gss.$(OBJEXT)
        $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_gss $(OUTPRE)test_cxx_gss.$(OBJEXT) $(LIBS)
+test_cxx_rpc: $(OUTPRE)test_cxx_rpc.$(OBJEXT) $(GSSRPC_DEPLIBS)
+       $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_rpc $(OUTPRE)test_cxx_rpc.$(OBJEXT) $(GSSRPC_LIBS) $(LIBS)
 
 test_cxx_krb5.$(OBJEXT): test_cxx_krb5.cpp
 test_cxx_gss.$(OBJEXT): test_cxx_gss.cpp
+test_cxx_rpc.$(OBJEXT): test_cxx_rpc.cpp
 
 install::
 
index 906c21d836e2263630967457be6248452a3cd9d7..33a046f8c0be125c1b267752a9ca0db4d5046740 100644 (file)
@@ -2,6 +2,8 @@
 
 #include <stdio.h>
 #include "krb5.h"
+#include "krb5/locate_plugin.h"
+#include "profile.h"
 
 int main (int argc, char *argv[])
 {
diff --git a/src/tests/misc/test_cxx_rpc.cpp b/src/tests/misc/test_cxx_rpc.cpp
new file mode 100644 (file)
index 0000000..b6ca4d3
--- /dev/null
@@ -0,0 +1,14 @@
+// Test that the krb5.h header is compatible with C++ application code.
+
+#include "gssrpc/rpc.h"
+
+struct sockaddr_in s_in;
+int main (int argc, char *argv[])
+{
+    if (argc == 47 && get_myaddress (&s_in)) {
+       printf("error\n");
+       return 1;
+    }
+    printf("hello, world\n");
+    return 0;
+}