diff options
author | Cy Schubert <cy@FreeBSD.org> | 2015-07-05 15:42:16 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2015-07-05 15:42:16 +0000 |
commit | 276da39af92f48350aa01091a2b8b3e735217eea (patch) | |
tree | fb96356e3ef85aaa8d1f5939a9decd315a7ca596 /contrib/ntp/sntp/tests | |
parent | 31c98473c1337a238b00342edd7ef85dfb378e24 (diff) | |
parent | 873997f35a991eee09ed91148a0cf332360380da (diff) |
MFV ntp-4.2.8p3 (r284990).
Approved by: roberto, delphij
Security: VuXML: 0d0f3050-1f69-11e5-9ba9-d050996490d0
Security: http://bugs.ntp.org/show_bug.cgi?id=2853
Security: https://www.kb.cert.org/vuls/id/668167
Security: http://support.ntp.org/bin/view/Main/SecurityNotice#June_2015_NTP_Security_Vulnerabi
Notes
Notes:
svn path=/head/; revision=285169
Diffstat (limited to 'contrib/ntp/sntp/tests')
30 files changed, 3579 insertions, 886 deletions
diff --git a/contrib/ntp/sntp/tests/Makefile.am b/contrib/ntp/sntp/tests/Makefile.am index feb914276205..2228aa0e73f2 100644 --- a/contrib/ntp/sntp/tests/Makefile.am +++ b/contrib/ntp/sntp/tests/Makefile.am @@ -1,30 +1,64 @@ NULL = BUILT_SOURCES = +CLEANFILES = kod-output-blank kod-output-single kod-output-multiple debug-output-lfp-dec debug-output-lfp-bin debug-output-pkt +DISTCLEANFILES = kod-output-blank kod-output-single kod-output-multiple +EXTRA_PROGRAMS = -check_PROGRAMS = -if BUILD_SNTP +run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb + +# Use EXTRA_PROGRAMS for test files that are under development but +# not production-ready +#EXTRA_PROGRAMS += test-packetHandling test-packetProcessing + +check_PROGRAMS = \ + test-crypto \ + test-keyFile \ + test-kodDatabase \ + test-kodFile \ + test-networking \ + test-packetHandling \ + test-packetProcessing \ + test-utilities \ + $(NULL) + +if GTEST_AVAILABLE check_PROGRAMS += tests +else +EXTRA_PROGRAMS += tests endif -base_SOURCES = \ - $(srcdir)/../tests_main.cpp \ +#if BUILD_SNTP +#check_PROGRAMS += tests +#endif + +base_SOURCES = \ + ../tests_main.cpp \ $(NULL) tests_SOURCES = \ $(base_SOURCES) \ - crypto.cpp \ - keyFile.cpp \ - kodDatabase.cpp \ - kodFile.cpp \ - networking.cpp \ - packetHandling.cpp \ - packetProcessing.cpp \ - utilities.cpp \ + g_networking.cpp \ + g_packetHandling.cpp \ + g_packetProcessing.cpp \ $(NULL) +# HMS: this test was for the 4.2.6 sntp code. +# g_nameresolution.cpp + +# HMS: Somebody needs to audit the following files to +# make sure all of these tests are now handled by Unity +# +# g_utilities.cpp +# g_kodDatabase.cpp +# g_keyFile.cpp +# g_crypto.cpp +# g_kodFile.cpp + noinst_HEADERS = \ - sntptest.h \ fileHandlingTest.h \ + sntptest.h \ + g_fileHandlingTest.h \ + g_sntptest.h \ $(NULL) dist_check_SCRIPTS = tests-runner @@ -45,7 +79,7 @@ EXTRA_DIST = \ data/kod-test-empty \ $(NULL) -CLEANFILES = \ +CLEANFILES += \ data/kod-output-multiple \ data/kod-output-single \ data/debug-output-pkt \ @@ -54,6 +88,7 @@ CLEANFILES = \ data/debug-output-lfp-bin \ $(NULL) +#split into LDADD and tests_LDADD? LDADD = \ ../libsntp.a \ $(LIBOPTS_LDADD) \ @@ -65,6 +100,12 @@ LDADD = \ $(GTEST_LIBS) \ $(NULL) +unity_tests_LDADD = \ + $(LDADD) \ + $(top_builddir)/unity/libunity.a \ + $(LIBM) \ + $(NULL) + AM_CFLAGS = $(CFLAGS_NTP) AM_CXXFLAGS = $(GTEST_CXXFLAGS) @@ -78,11 +119,164 @@ AM_CPPFLAGS += $(CPPFLAGS_NTP) AM_LDFLAGS = $(LDFLAGS_NTP) +BUILT_SOURCES += \ + $(srcdir)/run-crypto.c \ + $(srcdir)/run-keyFile.c \ + $(srcdir)/run-kodDatabase.c \ + $(srcdir)/run-kodFile.c \ + $(srcdir)/run-networking.c \ + $(srcdir)/run-packetProcessing.c \ + $(srcdir)/run-utilities.c \ + $(srcdir)/run-packetHandling.c \ + $(NULL) + +test_keyFile_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_keyFile_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_kodDatabase_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_kodDatabase_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_kodFile_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_kodFile_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_networking_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_networking_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_utilities_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_utilities_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_crypto_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_crypto_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_packetProcessing_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_packetProcessing_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_packetHandling_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_packetHandling_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_networking_SOURCES = \ + networking.c \ + run-networking.c \ + $(top_builddir)/version.c \ + $(NULL) + +test_packetHandling_SOURCES = \ + packetHandling.c \ + run-packetHandling.c \ + $(top_builddir)/version.c \ + $(NULL) + +test_kodDatabase_SOURCES = \ + kodDatabase.c \ + run-kodDatabase.c \ + $(top_builddir)/version.c \ + $(NULL) + +test_keyFile_SOURCES = \ + keyFile.c \ + run-keyFile.c \ + $(top_builddir)/version.c \ + $(NULL) + +test_kodFile_SOURCES = \ + kodFile.c \ + run-kodFile.c \ + $(top_builddir)/version.c \ + $(NULL) +# ../version.c + +test_packetProcessing_SOURCES = \ + packetProcessing.c \ + run-packetProcessing.c \ + $(NULL) + +test_utilities_SOURCES = \ + utilities.c \ + run-utilities.c \ + $(NULL) + +test_crypto_SOURCES = \ + crypto.c \ + run-crypto.c \ + $(top_builddir)/version.c \ + $(NULL) + + +$(srcdir)/run-kodFile.c: $(srcdir)/kodFile.c $(std_unity_list) + $(run_unity) kodFile.c run-kodFile.c + +$(srcdir)/run-keyFile.c: $(srcdir)/keyFile.c $(std_unity_list) + $(run_unity) keyFile.c run-keyFile.c + +$(srcdir)/run-kodDatabase.c: $(srcdir)/kodDatabase.c $(std_unity_list) + $(run_unity) kodDatabase.c run-kodDatabase.c + +$(srcdir)/run-networking.c: $(srcdir)/networking.c $(std_unity_list) + $(run_unity) networking.c run-networking.c + +$(srcdir)/run-packetProcessing.c: $(srcdir)/packetProcessing.c $(std_unity_list) + $(run_unity) packetProcessing.c run-packetProcessing.c + +$(srcdir)/run-packetHandling.c: $(srcdir)/packetHandling.c $(std_unity_list) + $(run_unity) packetHandling.c run-packetHandling.c + +$(srcdir)/run-utilities.c: $(srcdir)/utilities.c $(std_unity_list) + $(run_unity) utilities.c run-utilities.c + +$(srcdir)/run-crypto.c: $(srcdir)/crypto.c $(std_unity_list) + $(run_unity) crypto.c run-crypto.c + +#$(srcdir)/../version.c: $(srcdir)/../version.c +# gcc -o version.o ../version.c + TESTS = if !NTP_CROSSCOMPILE -TESTS += tests-runner +TESTS += $(check_PROGRAMS) endif +#if !NTP_CROSSCOMPILE +#TESTS += tests-runner +#endif ## ensure ../libsntp.a is built @@ -98,8 +292,8 @@ check-libsntp: ../libsntp.a ## check-libntp.mf - automake fragment ## slightly adapted for deeper directory -BUILT_SOURCES += check-libntp -CLEANFILES += check-libntp +BUILT_SOURCES += check-libntp check-libunity +CLEANFILES += check-libntp check-libunity check-libntp: ../../libntp/libntp.a @echo stamp > $@ @@ -107,5 +301,11 @@ check-libntp: ../../libntp/libntp.a ../../libntp/libntp.a: cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +check-libunity: ../sntp/unity/libunity.a + @echo stamp > $@ + +../sntp/unity/libunity.a: + cd ../unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a + include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/contrib/ntp/sntp/tests/Makefile.in b/contrib/ntp/sntp/tests/Makefile.in index 194af0f7754c..8cc0ba5234db 100644 --- a/contrib/ntp/sntp/tests/Makefile.in +++ b/contrib/ntp/sntp/tests/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,61 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,12 +88,15 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = $(am__EXEEXT_1) -@BUILD_SNTP_TRUE@am__append_1 = tests -@NTP_CROSSCOMPILE_FALSE@am__append_2 = tests-runner -DIST_COMMON = $(dist_check_SCRIPTS) $(noinst_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf +EXTRA_PROGRAMS = $(am__EXEEXT_1) +check_PROGRAMS = test-crypto$(EXEEXT) test-keyFile$(EXEEXT) \ + test-kodDatabase$(EXEEXT) test-kodFile$(EXEEXT) \ + test-networking$(EXEEXT) test-packetHandling$(EXEEXT) \ + test-packetProcessing$(EXEEXT) test-utilities$(EXEEXT) \ + $(am__EXEEXT_2) $(am__EXEEXT_3) +@GTEST_AVAILABLE_TRUE@am__append_1 = tests +@GTEST_AVAILABLE_FALSE@am__append_2 = tests +@NTP_CROSSCOMPILE_FALSE@am__append_3 = $(check_PROGRAMS) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ @@ -62,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/ntp_pkg_config.m4 \ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \ $(top_srcdir)/m4/ntp_sysexits.m4 \ + $(top_srcdir)/m4/ntp_unitytest.m4 \ $(top_srcdir)/m4/ntp_ver_suffix.m4 \ $(top_srcdir)/m4/openldap-thread-check.m4 \ $(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \ @@ -69,61 +127,414 @@ am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(dist_check_SCRIPTS) \ + $(noinst_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = fileHandlingTest.h CONFIG_CLEAN_VPATH_FILES = -@BUILD_SNTP_TRUE@am__EXEEXT_1 = tests$(EXEEXT) +@GTEST_AVAILABLE_FALSE@am__EXEEXT_1 = tests$(EXEEXT) +am__EXEEXT_2 = +@GTEST_AVAILABLE_TRUE@am__EXEEXT_3 = tests$(EXEEXT) am__objects_1 = +am_test_crypto_OBJECTS = test_crypto-crypto.$(OBJEXT) \ + test_crypto-run-crypto.$(OBJEXT) test_crypto-version.$(OBJEXT) \ + $(am__objects_1) +test_crypto_OBJECTS = $(am_test_crypto_OBJECTS) +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = ../libsntp.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(top_builddir)/../libntp/libntp.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) \ + $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +test_crypto_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +test_crypto_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_crypto_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_test_keyFile_OBJECTS = test_keyFile-keyFile.$(OBJEXT) \ + test_keyFile-run-keyFile.$(OBJEXT) \ + test_keyFile-version.$(OBJEXT) $(am__objects_1) +test_keyFile_OBJECTS = $(am_test_keyFile_OBJECTS) +test_keyFile_DEPENDENCIES = $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_1) +test_keyFile_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_keyFile_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_test_kodDatabase_OBJECTS = test_kodDatabase-kodDatabase.$(OBJEXT) \ + test_kodDatabase-run-kodDatabase.$(OBJEXT) \ + test_kodDatabase-version.$(OBJEXT) $(am__objects_1) +test_kodDatabase_OBJECTS = $(am_test_kodDatabase_OBJECTS) +test_kodDatabase_DEPENDENCIES = $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_1) +test_kodDatabase_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_kodDatabase_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +am_test_kodFile_OBJECTS = test_kodFile-kodFile.$(OBJEXT) \ + test_kodFile-run-kodFile.$(OBJEXT) \ + test_kodFile-version.$(OBJEXT) $(am__objects_1) +test_kodFile_OBJECTS = $(am_test_kodFile_OBJECTS) +test_kodFile_DEPENDENCIES = $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_1) +test_kodFile_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_kodFile_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_test_networking_OBJECTS = test_networking-networking.$(OBJEXT) \ + test_networking-run-networking.$(OBJEXT) \ + test_networking-version.$(OBJEXT) $(am__objects_1) +test_networking_OBJECTS = $(am_test_networking_OBJECTS) +test_networking_DEPENDENCIES = $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_1) +test_networking_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_networking_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +am_test_packetHandling_OBJECTS = \ + test_packetHandling-packetHandling.$(OBJEXT) \ + test_packetHandling-run-packetHandling.$(OBJEXT) \ + test_packetHandling-version.$(OBJEXT) $(am__objects_1) +test_packetHandling_OBJECTS = $(am_test_packetHandling_OBJECTS) +test_packetHandling_DEPENDENCIES = $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_1) +test_packetHandling_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_packetHandling_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_test_packetProcessing_OBJECTS = \ + test_packetProcessing-packetProcessing.$(OBJEXT) \ + test_packetProcessing-run-packetProcessing.$(OBJEXT) \ + $(am__objects_1) +test_packetProcessing_OBJECTS = $(am_test_packetProcessing_OBJECTS) +test_packetProcessing_DEPENDENCIES = $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_1) +test_packetProcessing_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_packetProcessing_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_test_utilities_OBJECTS = test_utilities-utilities.$(OBJEXT) \ + test_utilities-run-utilities.$(OBJEXT) $(am__objects_1) +test_utilities_OBJECTS = $(am_test_utilities_OBJECTS) +test_utilities_DEPENDENCIES = $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_1) +test_utilities_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_utilities_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ + $@ am__objects_2 = tests_main.$(OBJEXT) $(am__objects_1) -am_tests_OBJECTS = $(am__objects_2) crypto.$(OBJEXT) keyFile.$(OBJEXT) \ - kodDatabase.$(OBJEXT) kodFile.$(OBJEXT) networking.$(OBJEXT) \ - packetHandling.$(OBJEXT) packetProcessing.$(OBJEXT) \ - utilities.$(OBJEXT) $(am__objects_1) +am_tests_OBJECTS = $(am__objects_2) g_networking.$(OBJEXT) \ + g_packetHandling.$(OBJEXT) g_packetProcessing.$(OBJEXT) \ + $(am__objects_1) tests_OBJECTS = $(am_tests_OBJECTS) tests_LDADD = $(LDADD) -am__DEPENDENCIES_1 = tests_DEPENDENCIES = ../libsntp.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(top_builddir)/../libntp/libntp.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/libevent/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) -AM_V_CXX = $(am__v_CXX_$(V)) -am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY)) -am__v_CXX_0 = @echo " CXX " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CXXLD = $(am__v_CXXLD_$(V)) -am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CXXLD_0 = @echo " CXXLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(tests_SOURCES) -DIST_SOURCES = $(tests_SOURCES) +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +SOURCES = $(test_crypto_SOURCES) $(test_keyFile_SOURCES) \ + $(test_kodDatabase_SOURCES) $(test_kodFile_SOURCES) \ + $(test_networking_SOURCES) $(test_packetHandling_SOURCES) \ + $(test_packetProcessing_SOURCES) $(test_utilities_SOURCES) \ + $(tests_SOURCES) +DIST_SOURCES = $(test_crypto_SOURCES) $(test_keyFile_SOURCES) \ + $(test_kodDatabase_SOURCES) $(test_kodFile_SOURCES) \ + $(test_networking_SOURCES) $(test_packetHandling_SOURCES) \ + $(test_packetProcessing_SOURCES) $(test_utilities_SOURCES) \ + $(tests_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/libevent/build-aux/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) \ + $(top_srcdir)/libevent/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(srcdir)/fileHandlingTest.h.in $(top_srcdir)/depsver.mf \ + $(top_srcdir)/includes.mf \ + $(top_srcdir)/libevent/build-aux/depcomp \ + $(top_srcdir)/libevent/build-aux/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ @@ -269,6 +680,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_RUBY = @PATH_RUBY@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POSIX_SHELL = @POSIX_SHELL@ @@ -357,26 +769,54 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = -BUILT_SOURCES = check-libsntp check-libntp .deps-ver +#if !NTP_CROSSCOMPILE +#TESTS += tests-runner +#endif +BUILT_SOURCES = $(srcdir)/run-crypto.c $(srcdir)/run-keyFile.c \ + $(srcdir)/run-kodDatabase.c $(srcdir)/run-kodFile.c \ + $(srcdir)/run-networking.c $(srcdir)/run-packetProcessing.c \ + $(srcdir)/run-utilities.c $(srcdir)/run-packetHandling.c \ + $(NULL) check-libsntp check-libntp check-libunity .deps-ver +CLEANFILES = kod-output-blank kod-output-single kod-output-multiple \ + debug-output-lfp-dec debug-output-lfp-bin debug-output-pkt \ + data/kod-output-multiple data/kod-output-single \ + data/debug-output-pkt data/debug-output-lfp-dec \ + data/kod-output-blank data/debug-output-lfp-bin $(NULL) \ + check-libsntp check-libntp check-libunity .deps-ver +DISTCLEANFILES = kod-output-blank kod-output-single kod-output-multiple +run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb + +#if BUILD_SNTP +#check_PROGRAMS += tests +#endif base_SOURCES = \ - $(srcdir)/../tests_main.cpp \ + ../tests_main.cpp \ $(NULL) tests_SOURCES = \ $(base_SOURCES) \ - crypto.cpp \ - keyFile.cpp \ - kodDatabase.cpp \ - kodFile.cpp \ - networking.cpp \ - packetHandling.cpp \ - packetProcessing.cpp \ - utilities.cpp \ + g_networking.cpp \ + g_packetHandling.cpp \ + g_packetProcessing.cpp \ $(NULL) + +# HMS: this test was for the 4.2.6 sntp code. +# g_nameresolution.cpp + +# HMS: Somebody needs to audit the following files to +# make sure all of these tests are now handled by Unity +# +# g_utilities.cpp +# g_kodDatabase.cpp +# g_keyFile.cpp +# g_crypto.cpp +# g_kodFile.cpp noinst_HEADERS = \ - sntptest.h \ fileHandlingTest.h \ + sntptest.h \ + g_fileHandlingTest.h \ + g_sntptest.h \ $(NULL) dist_check_SCRIPTS = tests-runner @@ -396,10 +836,8 @@ EXTRA_DIST = \ data/kod-test-empty \ $(NULL) -CLEANFILES = data/kod-output-multiple data/kod-output-single \ - data/debug-output-pkt data/debug-output-lfp-dec \ - data/kod-output-blank data/debug-output-lfp-bin $(NULL) \ - check-libsntp check-libntp .deps-ver + +#split into LDADD and tests_LDADD? LDADD = \ ../libsntp.a \ $(LIBOPTS_LDADD) \ @@ -411,13 +849,133 @@ LDADD = \ $(GTEST_LIBS) \ $(NULL) +unity_tests_LDADD = \ + $(LDADD) \ + $(top_builddir)/unity/libunity.a \ + $(LIBM) \ + $(NULL) + AM_CFLAGS = $(CFLAGS_NTP) AM_CXXFLAGS = $(GTEST_CXXFLAGS) AM_CPPFLAGS = $(SNTP_INCS) -I$(srcdir)/.. -I$(top_srcdir)/../tests \ $(LIBOPTS_CFLAGS) $(CPPFLAGS_LIBEVENT) $(GTEST_CPPFLAGS) \ $(CPPFLAGS_NTP) AM_LDFLAGS = $(LDFLAGS_NTP) -TESTS = $(am__append_2) +test_keyFile_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_keyFile_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_kodDatabase_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_kodDatabase_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_kodFile_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_kodFile_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_networking_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_networking_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_utilities_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_utilities_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_crypto_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_crypto_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_packetProcessing_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_packetProcessing_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_packetHandling_CFLAGS = \ + -I$(top_srcdir)/unity \ + $(NULL) + +test_packetHandling_LDADD = \ + $(unity_tests_LDADD) \ + $(NULL) + +test_networking_SOURCES = \ + networking.c \ + run-networking.c \ + $(top_builddir)/version.c \ + $(NULL) + +test_packetHandling_SOURCES = \ + packetHandling.c \ + run-packetHandling.c \ + $(top_builddir)/version.c \ + $(NULL) + +test_kodDatabase_SOURCES = \ + kodDatabase.c \ + run-kodDatabase.c \ + $(top_builddir)/version.c \ + $(NULL) + +test_keyFile_SOURCES = \ + keyFile.c \ + run-keyFile.c \ + $(top_builddir)/version.c \ + $(NULL) + +test_kodFile_SOURCES = \ + kodFile.c \ + run-kodFile.c \ + $(top_builddir)/version.c \ + $(NULL) + +# ../version.c +test_packetProcessing_SOURCES = \ + packetProcessing.c \ + run-packetProcessing.c \ + $(NULL) + +test_utilities_SOURCES = \ + utilities.c \ + run-utilities.c \ + $(NULL) + +test_crypto_SOURCES = \ + crypto.c \ + run-crypto.c \ + $(top_builddir)/version.c \ + $(NULL) + + +#$(srcdir)/../version.c: $(srcdir)/../version.c +# gcc -o version.o ../version.c +TESTS = $(am__append_3) SNTP_INCS = -I$(top_srcdir)/../include \ -I$(top_srcdir)/../lib/isc/include \ -I$(top_srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ @@ -426,7 +984,7 @@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj +.SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -439,7 +997,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_src echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -448,6 +1005,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -457,6 +1015,8 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +fileHandlingTest.h: $(top_builddir)/config.status $(srcdir)/fileHandlingTest.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ @@ -466,7 +1026,40 @@ clean-checkPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES) + +test-crypto$(EXEEXT): $(test_crypto_OBJECTS) $(test_crypto_DEPENDENCIES) $(EXTRA_test_crypto_DEPENDENCIES) + @rm -f test-crypto$(EXEEXT) + $(AM_V_CCLD)$(test_crypto_LINK) $(test_crypto_OBJECTS) $(test_crypto_LDADD) $(LIBS) + +test-keyFile$(EXEEXT): $(test_keyFile_OBJECTS) $(test_keyFile_DEPENDENCIES) $(EXTRA_test_keyFile_DEPENDENCIES) + @rm -f test-keyFile$(EXEEXT) + $(AM_V_CCLD)$(test_keyFile_LINK) $(test_keyFile_OBJECTS) $(test_keyFile_LDADD) $(LIBS) + +test-kodDatabase$(EXEEXT): $(test_kodDatabase_OBJECTS) $(test_kodDatabase_DEPENDENCIES) $(EXTRA_test_kodDatabase_DEPENDENCIES) + @rm -f test-kodDatabase$(EXEEXT) + $(AM_V_CCLD)$(test_kodDatabase_LINK) $(test_kodDatabase_OBJECTS) $(test_kodDatabase_LDADD) $(LIBS) + +test-kodFile$(EXEEXT): $(test_kodFile_OBJECTS) $(test_kodFile_DEPENDENCIES) $(EXTRA_test_kodFile_DEPENDENCIES) + @rm -f test-kodFile$(EXEEXT) + $(AM_V_CCLD)$(test_kodFile_LINK) $(test_kodFile_OBJECTS) $(test_kodFile_LDADD) $(LIBS) + +test-networking$(EXEEXT): $(test_networking_OBJECTS) $(test_networking_DEPENDENCIES) $(EXTRA_test_networking_DEPENDENCIES) + @rm -f test-networking$(EXEEXT) + $(AM_V_CCLD)$(test_networking_LINK) $(test_networking_OBJECTS) $(test_networking_LDADD) $(LIBS) + +test-packetHandling$(EXEEXT): $(test_packetHandling_OBJECTS) $(test_packetHandling_DEPENDENCIES) $(EXTRA_test_packetHandling_DEPENDENCIES) + @rm -f test-packetHandling$(EXEEXT) + $(AM_V_CCLD)$(test_packetHandling_LINK) $(test_packetHandling_OBJECTS) $(test_packetHandling_LDADD) $(LIBS) + +test-packetProcessing$(EXEEXT): $(test_packetProcessing_OBJECTS) $(test_packetProcessing_DEPENDENCIES) $(EXTRA_test_packetProcessing_DEPENDENCIES) + @rm -f test-packetProcessing$(EXEEXT) + $(AM_V_CCLD)$(test_packetProcessing_LINK) $(test_packetProcessing_OBJECTS) $(test_packetProcessing_LDADD) $(LIBS) + +test-utilities$(EXEEXT): $(test_utilities_OBJECTS) $(test_utilities_DEPENDENCIES) $(EXTRA_test_utilities_DEPENDENCIES) + @rm -f test-utilities$(EXEEXT) + $(AM_V_CCLD)$(test_utilities_LINK) $(test_utilities_OBJECTS) $(test_utilities_LDADD) $(LIBS) + +tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES) $(EXTRA_tests_DEPENDENCIES) @rm -f tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_OBJECTS) $(tests_LDADD) $(LIBS) @@ -476,55 +1069,396 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kodDatabase.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kodFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networking.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packetHandling.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packetProcessing.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_networking.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_packetHandling.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_packetProcessing.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_crypto-crypto.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_crypto-run-crypto.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_crypto-version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_keyFile-keyFile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_keyFile-run-keyFile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_keyFile-version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodDatabase-kodDatabase.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodDatabase-run-kodDatabase.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodDatabase-version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodFile-kodFile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodFile-run-kodFile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodFile-version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_networking-networking.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_networking-run-networking.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_networking-version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetHandling-packetHandling.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetHandling-run-packetHandling.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetHandling-version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetProcessing-packetProcessing.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetProcessing-run-packetProcessing.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utilities-run-utilities.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utilities-utilities.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilities.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +test_crypto-crypto.o: crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -MT test_crypto-crypto.o -MD -MP -MF $(DEPDIR)/test_crypto-crypto.Tpo -c -o test_crypto-crypto.o `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_crypto-crypto.Tpo $(DEPDIR)/test_crypto-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto.c' object='test_crypto-crypto.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -c -o test_crypto-crypto.o `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c + +test_crypto-crypto.obj: crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -MT test_crypto-crypto.obj -MD -MP -MF $(DEPDIR)/test_crypto-crypto.Tpo -c -o test_crypto-crypto.obj `if test -f 'crypto.c'; then $(CYGPATH_W) 'crypto.c'; else $(CYGPATH_W) '$(srcdir)/crypto.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_crypto-crypto.Tpo $(DEPDIR)/test_crypto-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto.c' object='test_crypto-crypto.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -c -o test_crypto-crypto.obj `if test -f 'crypto.c'; then $(CYGPATH_W) 'crypto.c'; else $(CYGPATH_W) '$(srcdir)/crypto.c'; fi` + +test_crypto-run-crypto.o: run-crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -MT test_crypto-run-crypto.o -MD -MP -MF $(DEPDIR)/test_crypto-run-crypto.Tpo -c -o test_crypto-run-crypto.o `test -f 'run-crypto.c' || echo '$(srcdir)/'`run-crypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_crypto-run-crypto.Tpo $(DEPDIR)/test_crypto-run-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-crypto.c' object='test_crypto-run-crypto.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -c -o test_crypto-run-crypto.o `test -f 'run-crypto.c' || echo '$(srcdir)/'`run-crypto.c + +test_crypto-run-crypto.obj: run-crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -MT test_crypto-run-crypto.obj -MD -MP -MF $(DEPDIR)/test_crypto-run-crypto.Tpo -c -o test_crypto-run-crypto.obj `if test -f 'run-crypto.c'; then $(CYGPATH_W) 'run-crypto.c'; else $(CYGPATH_W) '$(srcdir)/run-crypto.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_crypto-run-crypto.Tpo $(DEPDIR)/test_crypto-run-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-crypto.c' object='test_crypto-run-crypto.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -c -o test_crypto-run-crypto.obj `if test -f 'run-crypto.c'; then $(CYGPATH_W) 'run-crypto.c'; else $(CYGPATH_W) '$(srcdir)/run-crypto.c'; fi` + +test_crypto-version.o: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -MT test_crypto-version.o -MD -MP -MF $(DEPDIR)/test_crypto-version.Tpo -c -o test_crypto-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_crypto-version.Tpo $(DEPDIR)/test_crypto-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_crypto-version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -c -o test_crypto-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c + +test_crypto-version.obj: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -MT test_crypto-version.obj -MD -MP -MF $(DEPDIR)/test_crypto-version.Tpo -c -o test_crypto-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_crypto-version.Tpo $(DEPDIR)/test_crypto-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_crypto-version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -c -o test_crypto-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` + +test_keyFile-keyFile.o: keyFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-keyFile.o -MD -MP -MF $(DEPDIR)/test_keyFile-keyFile.Tpo -c -o test_keyFile-keyFile.o `test -f 'keyFile.c' || echo '$(srcdir)/'`keyFile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-keyFile.Tpo $(DEPDIR)/test_keyFile-keyFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyFile.c' object='test_keyFile-keyFile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-keyFile.o `test -f 'keyFile.c' || echo '$(srcdir)/'`keyFile.c + +test_keyFile-keyFile.obj: keyFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-keyFile.obj -MD -MP -MF $(DEPDIR)/test_keyFile-keyFile.Tpo -c -o test_keyFile-keyFile.obj `if test -f 'keyFile.c'; then $(CYGPATH_W) 'keyFile.c'; else $(CYGPATH_W) '$(srcdir)/keyFile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-keyFile.Tpo $(DEPDIR)/test_keyFile-keyFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyFile.c' object='test_keyFile-keyFile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-keyFile.obj `if test -f 'keyFile.c'; then $(CYGPATH_W) 'keyFile.c'; else $(CYGPATH_W) '$(srcdir)/keyFile.c'; fi` + +test_keyFile-run-keyFile.o: run-keyFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-run-keyFile.o -MD -MP -MF $(DEPDIR)/test_keyFile-run-keyFile.Tpo -c -o test_keyFile-run-keyFile.o `test -f 'run-keyFile.c' || echo '$(srcdir)/'`run-keyFile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-run-keyFile.Tpo $(DEPDIR)/test_keyFile-run-keyFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-keyFile.c' object='test_keyFile-run-keyFile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-run-keyFile.o `test -f 'run-keyFile.c' || echo '$(srcdir)/'`run-keyFile.c + +test_keyFile-run-keyFile.obj: run-keyFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-run-keyFile.obj -MD -MP -MF $(DEPDIR)/test_keyFile-run-keyFile.Tpo -c -o test_keyFile-run-keyFile.obj `if test -f 'run-keyFile.c'; then $(CYGPATH_W) 'run-keyFile.c'; else $(CYGPATH_W) '$(srcdir)/run-keyFile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-run-keyFile.Tpo $(DEPDIR)/test_keyFile-run-keyFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-keyFile.c' object='test_keyFile-run-keyFile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-run-keyFile.obj `if test -f 'run-keyFile.c'; then $(CYGPATH_W) 'run-keyFile.c'; else $(CYGPATH_W) '$(srcdir)/run-keyFile.c'; fi` + +test_keyFile-version.o: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-version.o -MD -MP -MF $(DEPDIR)/test_keyFile-version.Tpo -c -o test_keyFile-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-version.Tpo $(DEPDIR)/test_keyFile-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_keyFile-version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c + +test_keyFile-version.obj: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-version.obj -MD -MP -MF $(DEPDIR)/test_keyFile-version.Tpo -c -o test_keyFile-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-version.Tpo $(DEPDIR)/test_keyFile-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_keyFile-version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` + +test_kodDatabase-kodDatabase.o: kodDatabase.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-kodDatabase.o -MD -MP -MF $(DEPDIR)/test_kodDatabase-kodDatabase.Tpo -c -o test_kodDatabase-kodDatabase.o `test -f 'kodDatabase.c' || echo '$(srcdir)/'`kodDatabase.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-kodDatabase.Tpo $(DEPDIR)/test_kodDatabase-kodDatabase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kodDatabase.c' object='test_kodDatabase-kodDatabase.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-kodDatabase.o `test -f 'kodDatabase.c' || echo '$(srcdir)/'`kodDatabase.c + +test_kodDatabase-kodDatabase.obj: kodDatabase.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-kodDatabase.obj -MD -MP -MF $(DEPDIR)/test_kodDatabase-kodDatabase.Tpo -c -o test_kodDatabase-kodDatabase.obj `if test -f 'kodDatabase.c'; then $(CYGPATH_W) 'kodDatabase.c'; else $(CYGPATH_W) '$(srcdir)/kodDatabase.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-kodDatabase.Tpo $(DEPDIR)/test_kodDatabase-kodDatabase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kodDatabase.c' object='test_kodDatabase-kodDatabase.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-kodDatabase.obj `if test -f 'kodDatabase.c'; then $(CYGPATH_W) 'kodDatabase.c'; else $(CYGPATH_W) '$(srcdir)/kodDatabase.c'; fi` + +test_kodDatabase-run-kodDatabase.o: run-kodDatabase.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-run-kodDatabase.o -MD -MP -MF $(DEPDIR)/test_kodDatabase-run-kodDatabase.Tpo -c -o test_kodDatabase-run-kodDatabase.o `test -f 'run-kodDatabase.c' || echo '$(srcdir)/'`run-kodDatabase.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-run-kodDatabase.Tpo $(DEPDIR)/test_kodDatabase-run-kodDatabase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-kodDatabase.c' object='test_kodDatabase-run-kodDatabase.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-run-kodDatabase.o `test -f 'run-kodDatabase.c' || echo '$(srcdir)/'`run-kodDatabase.c + +test_kodDatabase-run-kodDatabase.obj: run-kodDatabase.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-run-kodDatabase.obj -MD -MP -MF $(DEPDIR)/test_kodDatabase-run-kodDatabase.Tpo -c -o test_kodDatabase-run-kodDatabase.obj `if test -f 'run-kodDatabase.c'; then $(CYGPATH_W) 'run-kodDatabase.c'; else $(CYGPATH_W) '$(srcdir)/run-kodDatabase.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-run-kodDatabase.Tpo $(DEPDIR)/test_kodDatabase-run-kodDatabase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-kodDatabase.c' object='test_kodDatabase-run-kodDatabase.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-run-kodDatabase.obj `if test -f 'run-kodDatabase.c'; then $(CYGPATH_W) 'run-kodDatabase.c'; else $(CYGPATH_W) '$(srcdir)/run-kodDatabase.c'; fi` + +test_kodDatabase-version.o: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-version.o -MD -MP -MF $(DEPDIR)/test_kodDatabase-version.Tpo -c -o test_kodDatabase-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-version.Tpo $(DEPDIR)/test_kodDatabase-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_kodDatabase-version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c + +test_kodDatabase-version.obj: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-version.obj -MD -MP -MF $(DEPDIR)/test_kodDatabase-version.Tpo -c -o test_kodDatabase-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-version.Tpo $(DEPDIR)/test_kodDatabase-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_kodDatabase-version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` + +test_kodFile-kodFile.o: kodFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-kodFile.o -MD -MP -MF $(DEPDIR)/test_kodFile-kodFile.Tpo -c -o test_kodFile-kodFile.o `test -f 'kodFile.c' || echo '$(srcdir)/'`kodFile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-kodFile.Tpo $(DEPDIR)/test_kodFile-kodFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kodFile.c' object='test_kodFile-kodFile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-kodFile.o `test -f 'kodFile.c' || echo '$(srcdir)/'`kodFile.c + +test_kodFile-kodFile.obj: kodFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-kodFile.obj -MD -MP -MF $(DEPDIR)/test_kodFile-kodFile.Tpo -c -o test_kodFile-kodFile.obj `if test -f 'kodFile.c'; then $(CYGPATH_W) 'kodFile.c'; else $(CYGPATH_W) '$(srcdir)/kodFile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-kodFile.Tpo $(DEPDIR)/test_kodFile-kodFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kodFile.c' object='test_kodFile-kodFile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-kodFile.obj `if test -f 'kodFile.c'; then $(CYGPATH_W) 'kodFile.c'; else $(CYGPATH_W) '$(srcdir)/kodFile.c'; fi` + +test_kodFile-run-kodFile.o: run-kodFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-run-kodFile.o -MD -MP -MF $(DEPDIR)/test_kodFile-run-kodFile.Tpo -c -o test_kodFile-run-kodFile.o `test -f 'run-kodFile.c' || echo '$(srcdir)/'`run-kodFile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-run-kodFile.Tpo $(DEPDIR)/test_kodFile-run-kodFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-kodFile.c' object='test_kodFile-run-kodFile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-run-kodFile.o `test -f 'run-kodFile.c' || echo '$(srcdir)/'`run-kodFile.c + +test_kodFile-run-kodFile.obj: run-kodFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-run-kodFile.obj -MD -MP -MF $(DEPDIR)/test_kodFile-run-kodFile.Tpo -c -o test_kodFile-run-kodFile.obj `if test -f 'run-kodFile.c'; then $(CYGPATH_W) 'run-kodFile.c'; else $(CYGPATH_W) '$(srcdir)/run-kodFile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-run-kodFile.Tpo $(DEPDIR)/test_kodFile-run-kodFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-kodFile.c' object='test_kodFile-run-kodFile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-run-kodFile.obj `if test -f 'run-kodFile.c'; then $(CYGPATH_W) 'run-kodFile.c'; else $(CYGPATH_W) '$(srcdir)/run-kodFile.c'; fi` + +test_kodFile-version.o: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-version.o -MD -MP -MF $(DEPDIR)/test_kodFile-version.Tpo -c -o test_kodFile-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-version.Tpo $(DEPDIR)/test_kodFile-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_kodFile-version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c + +test_kodFile-version.obj: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-version.obj -MD -MP -MF $(DEPDIR)/test_kodFile-version.Tpo -c -o test_kodFile-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-version.Tpo $(DEPDIR)/test_kodFile-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_kodFile-version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` + +test_networking-networking.o: networking.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-networking.o -MD -MP -MF $(DEPDIR)/test_networking-networking.Tpo -c -o test_networking-networking.o `test -f 'networking.c' || echo '$(srcdir)/'`networking.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-networking.Tpo $(DEPDIR)/test_networking-networking.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='networking.c' object='test_networking-networking.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-networking.o `test -f 'networking.c' || echo '$(srcdir)/'`networking.c + +test_networking-networking.obj: networking.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-networking.obj -MD -MP -MF $(DEPDIR)/test_networking-networking.Tpo -c -o test_networking-networking.obj `if test -f 'networking.c'; then $(CYGPATH_W) 'networking.c'; else $(CYGPATH_W) '$(srcdir)/networking.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-networking.Tpo $(DEPDIR)/test_networking-networking.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='networking.c' object='test_networking-networking.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-networking.obj `if test -f 'networking.c'; then $(CYGPATH_W) 'networking.c'; else $(CYGPATH_W) '$(srcdir)/networking.c'; fi` + +test_networking-run-networking.o: run-networking.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-run-networking.o -MD -MP -MF $(DEPDIR)/test_networking-run-networking.Tpo -c -o test_networking-run-networking.o `test -f 'run-networking.c' || echo '$(srcdir)/'`run-networking.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-run-networking.Tpo $(DEPDIR)/test_networking-run-networking.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-networking.c' object='test_networking-run-networking.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-run-networking.o `test -f 'run-networking.c' || echo '$(srcdir)/'`run-networking.c + +test_networking-run-networking.obj: run-networking.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-run-networking.obj -MD -MP -MF $(DEPDIR)/test_networking-run-networking.Tpo -c -o test_networking-run-networking.obj `if test -f 'run-networking.c'; then $(CYGPATH_W) 'run-networking.c'; else $(CYGPATH_W) '$(srcdir)/run-networking.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-run-networking.Tpo $(DEPDIR)/test_networking-run-networking.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-networking.c' object='test_networking-run-networking.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-run-networking.obj `if test -f 'run-networking.c'; then $(CYGPATH_W) 'run-networking.c'; else $(CYGPATH_W) '$(srcdir)/run-networking.c'; fi` + +test_networking-version.o: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-version.o -MD -MP -MF $(DEPDIR)/test_networking-version.Tpo -c -o test_networking-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-version.Tpo $(DEPDIR)/test_networking-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_networking-version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c + +test_networking-version.obj: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-version.obj -MD -MP -MF $(DEPDIR)/test_networking-version.Tpo -c -o test_networking-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-version.Tpo $(DEPDIR)/test_networking-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_networking-version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` + +test_packetHandling-packetHandling.o: packetHandling.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-packetHandling.o -MD -MP -MF $(DEPDIR)/test_packetHandling-packetHandling.Tpo -c -o test_packetHandling-packetHandling.o `test -f 'packetHandling.c' || echo '$(srcdir)/'`packetHandling.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-packetHandling.Tpo $(DEPDIR)/test_packetHandling-packetHandling.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packetHandling.c' object='test_packetHandling-packetHandling.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-packetHandling.o `test -f 'packetHandling.c' || echo '$(srcdir)/'`packetHandling.c + +test_packetHandling-packetHandling.obj: packetHandling.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-packetHandling.obj -MD -MP -MF $(DEPDIR)/test_packetHandling-packetHandling.Tpo -c -o test_packetHandling-packetHandling.obj `if test -f 'packetHandling.c'; then $(CYGPATH_W) 'packetHandling.c'; else $(CYGPATH_W) '$(srcdir)/packetHandling.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-packetHandling.Tpo $(DEPDIR)/test_packetHandling-packetHandling.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packetHandling.c' object='test_packetHandling-packetHandling.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-packetHandling.obj `if test -f 'packetHandling.c'; then $(CYGPATH_W) 'packetHandling.c'; else $(CYGPATH_W) '$(srcdir)/packetHandling.c'; fi` + +test_packetHandling-run-packetHandling.o: run-packetHandling.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-run-packetHandling.o -MD -MP -MF $(DEPDIR)/test_packetHandling-run-packetHandling.Tpo -c -o test_packetHandling-run-packetHandling.o `test -f 'run-packetHandling.c' || echo '$(srcdir)/'`run-packetHandling.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-run-packetHandling.Tpo $(DEPDIR)/test_packetHandling-run-packetHandling.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-packetHandling.c' object='test_packetHandling-run-packetHandling.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-run-packetHandling.o `test -f 'run-packetHandling.c' || echo '$(srcdir)/'`run-packetHandling.c + +test_packetHandling-run-packetHandling.obj: run-packetHandling.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-run-packetHandling.obj -MD -MP -MF $(DEPDIR)/test_packetHandling-run-packetHandling.Tpo -c -o test_packetHandling-run-packetHandling.obj `if test -f 'run-packetHandling.c'; then $(CYGPATH_W) 'run-packetHandling.c'; else $(CYGPATH_W) '$(srcdir)/run-packetHandling.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-run-packetHandling.Tpo $(DEPDIR)/test_packetHandling-run-packetHandling.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-packetHandling.c' object='test_packetHandling-run-packetHandling.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-run-packetHandling.obj `if test -f 'run-packetHandling.c'; then $(CYGPATH_W) 'run-packetHandling.c'; else $(CYGPATH_W) '$(srcdir)/run-packetHandling.c'; fi` + +test_packetHandling-version.o: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-version.o -MD -MP -MF $(DEPDIR)/test_packetHandling-version.Tpo -c -o test_packetHandling-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-version.Tpo $(DEPDIR)/test_packetHandling-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_packetHandling-version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c + +test_packetHandling-version.obj: $(top_builddir)/version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-version.obj -MD -MP -MF $(DEPDIR)/test_packetHandling-version.Tpo -c -o test_packetHandling-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-version.Tpo $(DEPDIR)/test_packetHandling-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_packetHandling-version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi` + +test_packetProcessing-packetProcessing.o: packetProcessing.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -MT test_packetProcessing-packetProcessing.o -MD -MP -MF $(DEPDIR)/test_packetProcessing-packetProcessing.Tpo -c -o test_packetProcessing-packetProcessing.o `test -f 'packetProcessing.c' || echo '$(srcdir)/'`packetProcessing.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetProcessing-packetProcessing.Tpo $(DEPDIR)/test_packetProcessing-packetProcessing.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packetProcessing.c' object='test_packetProcessing-packetProcessing.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -c -o test_packetProcessing-packetProcessing.o `test -f 'packetProcessing.c' || echo '$(srcdir)/'`packetProcessing.c + +test_packetProcessing-packetProcessing.obj: packetProcessing.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -MT test_packetProcessing-packetProcessing.obj -MD -MP -MF $(DEPDIR)/test_packetProcessing-packetProcessing.Tpo -c -o test_packetProcessing-packetProcessing.obj `if test -f 'packetProcessing.c'; then $(CYGPATH_W) 'packetProcessing.c'; else $(CYGPATH_W) '$(srcdir)/packetProcessing.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetProcessing-packetProcessing.Tpo $(DEPDIR)/test_packetProcessing-packetProcessing.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packetProcessing.c' object='test_packetProcessing-packetProcessing.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -c -o test_packetProcessing-packetProcessing.obj `if test -f 'packetProcessing.c'; then $(CYGPATH_W) 'packetProcessing.c'; else $(CYGPATH_W) '$(srcdir)/packetProcessing.c'; fi` + +test_packetProcessing-run-packetProcessing.o: run-packetProcessing.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -MT test_packetProcessing-run-packetProcessing.o -MD -MP -MF $(DEPDIR)/test_packetProcessing-run-packetProcessing.Tpo -c -o test_packetProcessing-run-packetProcessing.o `test -f 'run-packetProcessing.c' || echo '$(srcdir)/'`run-packetProcessing.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetProcessing-run-packetProcessing.Tpo $(DEPDIR)/test_packetProcessing-run-packetProcessing.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-packetProcessing.c' object='test_packetProcessing-run-packetProcessing.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -c -o test_packetProcessing-run-packetProcessing.o `test -f 'run-packetProcessing.c' || echo '$(srcdir)/'`run-packetProcessing.c + +test_packetProcessing-run-packetProcessing.obj: run-packetProcessing.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -MT test_packetProcessing-run-packetProcessing.obj -MD -MP -MF $(DEPDIR)/test_packetProcessing-run-packetProcessing.Tpo -c -o test_packetProcessing-run-packetProcessing.obj `if test -f 'run-packetProcessing.c'; then $(CYGPATH_W) 'run-packetProcessing.c'; else $(CYGPATH_W) '$(srcdir)/run-packetProcessing.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetProcessing-run-packetProcessing.Tpo $(DEPDIR)/test_packetProcessing-run-packetProcessing.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-packetProcessing.c' object='test_packetProcessing-run-packetProcessing.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -c -o test_packetProcessing-run-packetProcessing.obj `if test -f 'run-packetProcessing.c'; then $(CYGPATH_W) 'run-packetProcessing.c'; else $(CYGPATH_W) '$(srcdir)/run-packetProcessing.c'; fi` + +test_utilities-utilities.o: utilities.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -MT test_utilities-utilities.o -MD -MP -MF $(DEPDIR)/test_utilities-utilities.Tpo -c -o test_utilities-utilities.o `test -f 'utilities.c' || echo '$(srcdir)/'`utilities.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utilities-utilities.Tpo $(DEPDIR)/test_utilities-utilities.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utilities.c' object='test_utilities-utilities.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -c -o test_utilities-utilities.o `test -f 'utilities.c' || echo '$(srcdir)/'`utilities.c + +test_utilities-utilities.obj: utilities.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -MT test_utilities-utilities.obj -MD -MP -MF $(DEPDIR)/test_utilities-utilities.Tpo -c -o test_utilities-utilities.obj `if test -f 'utilities.c'; then $(CYGPATH_W) 'utilities.c'; else $(CYGPATH_W) '$(srcdir)/utilities.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utilities-utilities.Tpo $(DEPDIR)/test_utilities-utilities.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utilities.c' object='test_utilities-utilities.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -c -o test_utilities-utilities.obj `if test -f 'utilities.c'; then $(CYGPATH_W) 'utilities.c'; else $(CYGPATH_W) '$(srcdir)/utilities.c'; fi` + +test_utilities-run-utilities.o: run-utilities.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -MT test_utilities-run-utilities.o -MD -MP -MF $(DEPDIR)/test_utilities-run-utilities.Tpo -c -o test_utilities-run-utilities.o `test -f 'run-utilities.c' || echo '$(srcdir)/'`run-utilities.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utilities-run-utilities.Tpo $(DEPDIR)/test_utilities-run-utilities.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-utilities.c' object='test_utilities-run-utilities.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -c -o test_utilities-run-utilities.o `test -f 'run-utilities.c' || echo '$(srcdir)/'`run-utilities.c + +test_utilities-run-utilities.obj: run-utilities.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -MT test_utilities-run-utilities.obj -MD -MP -MF $(DEPDIR)/test_utilities-run-utilities.Tpo -c -o test_utilities-run-utilities.obj `if test -f 'run-utilities.c'; then $(CYGPATH_W) 'run-utilities.c'; else $(CYGPATH_W) '$(srcdir)/run-utilities.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utilities-run-utilities.Tpo $(DEPDIR)/test_utilities-run-utilities.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-utilities.c' object='test_utilities-run-utilities.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -c -o test_utilities-run-utilities.obj `if test -f 'run-utilities.c'; then $(CYGPATH_W) 'run-utilities.c'; else $(CYGPATH_W) '$(srcdir)/run-utilities.c'; fi` .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< -tests_main.o: $(srcdir)/../tests_main.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.o -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.o `test -f '$(srcdir)/../tests_main.cpp' || echo '$(srcdir)/'`$(srcdir)/../tests_main.cpp +tests_main.o: ../tests_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.o -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.o `test -f '../tests_main.cpp' || echo '$(srcdir)/'`../tests_main.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po -@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(srcdir)/../tests_main.cpp' object='tests_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../tests_main.cpp' object='tests_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.o `test -f '$(srcdir)/../tests_main.cpp' || echo '$(srcdir)/'`$(srcdir)/../tests_main.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.o `test -f '../tests_main.cpp' || echo '$(srcdir)/'`../tests_main.cpp -tests_main.obj: $(srcdir)/../tests_main.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.obj -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.obj `if test -f '$(srcdir)/../tests_main.cpp'; then $(CYGPATH_W) '$(srcdir)/../tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../tests_main.cpp'; fi` +tests_main.obj: ../tests_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.obj -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.obj `if test -f '../tests_main.cpp'; then $(CYGPATH_W) '../tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/../tests_main.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po -@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(srcdir)/../tests_main.cpp' object='tests_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../tests_main.cpp' object='tests_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.obj `if test -f '$(srcdir)/../tests_main.cpp'; then $(CYGPATH_W) '$(srcdir)/../tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../tests_main.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.obj `if test -f '../tests_main.cpp'; then $(CYGPATH_W) '../tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/../tests_main.cpp'; fi` mostlyclean-libtool: -rm -f *.lo @@ -532,26 +1466,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -563,15 +1486,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -580,101 +1499,243 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ else \ - skipped="($$skip tests were not run)"; \ + color_start= color_end=; \ fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ - else \ - echo "$$red$$dashes"; \ - fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ - test "$$failed" -eq 0; \ - else :; fi + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) $(dist_check_SCRIPTS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +test-crypto.log: test-crypto$(EXEEXT) + @p='test-crypto$(EXEEXT)'; \ + b='test-crypto'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-keyFile.log: test-keyFile$(EXEEXT) + @p='test-keyFile$(EXEEXT)'; \ + b='test-keyFile'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-kodDatabase.log: test-kodDatabase$(EXEEXT) + @p='test-kodDatabase$(EXEEXT)'; \ + b='test-kodDatabase'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-kodFile.log: test-kodFile$(EXEEXT) + @p='test-kodFile$(EXEEXT)'; \ + b='test-kodFile'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-networking.log: test-networking$(EXEEXT) + @p='test-networking$(EXEEXT)'; \ + b='test-networking'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-packetHandling.log: test-packetHandling$(EXEEXT) + @p='test-packetHandling$(EXEEXT)'; \ + b='test-packetHandling'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-packetProcessing.log: test-packetProcessing$(EXEEXT) + @p='test-packetProcessing$(EXEEXT)'; \ + b='test-packetProcessing'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-utilities.log: test-utilities$(EXEEXT) + @p='test-utilities$(EXEEXT)'; \ + b='test-utilities'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests.log: tests$(EXEEXT) + @p='tests$(EXEEXT)'; \ + b='tests'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -725,11 +1786,19 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) @@ -737,6 +1806,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -815,9 +1885,9 @@ uninstall-am: .MAKE: all check check-am install install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool ctags \ - distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ @@ -827,8 +1897,34 @@ uninstall-am: installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +$(srcdir)/run-kodFile.c: $(srcdir)/kodFile.c $(std_unity_list) + $(run_unity) kodFile.c run-kodFile.c + +$(srcdir)/run-keyFile.c: $(srcdir)/keyFile.c $(std_unity_list) + $(run_unity) keyFile.c run-keyFile.c + +$(srcdir)/run-kodDatabase.c: $(srcdir)/kodDatabase.c $(std_unity_list) + $(run_unity) kodDatabase.c run-kodDatabase.c +$(srcdir)/run-networking.c: $(srcdir)/networking.c $(std_unity_list) + $(run_unity) networking.c run-networking.c + +$(srcdir)/run-packetProcessing.c: $(srcdir)/packetProcessing.c $(std_unity_list) + $(run_unity) packetProcessing.c run-packetProcessing.c + +$(srcdir)/run-packetHandling.c: $(srcdir)/packetHandling.c $(std_unity_list) + $(run_unity) packetHandling.c run-packetHandling.c + +$(srcdir)/run-utilities.c: $(srcdir)/utilities.c $(std_unity_list) + $(run_unity) utilities.c run-utilities.c + +$(srcdir)/run-crypto.c: $(srcdir)/crypto.c $(std_unity_list) + $(run_unity) crypto.c run-crypto.c check-libsntp: ../libsntp.a @echo stamp > $@ @@ -841,6 +1937,12 @@ check-libntp: ../../libntp/libntp.a ../../libntp/libntp.a: cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a + +check-libunity: ../sntp/unity/libunity.a + @echo stamp > $@ + +../sntp/unity/libunity.a: + cd ../unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ diff --git a/contrib/ntp/sntp/tests/crypto.cpp b/contrib/ntp/sntp/tests/crypto.c index a6f89f5aa842..254469e63a94 100644 --- a/contrib/ntp/sntp/tests/crypto.cpp +++ b/contrib/ntp/sntp/tests/crypto.c @@ -1,16 +1,14 @@ -#include "sntptest.h" +#include "config.h" +#include "unity.h" +#include "ntp_types.h" -extern "C" { +#include "sntptest.h" #include "crypto.h" -}; - -class cryptoTest : public sntptest { -}; #define MD5_LENGTH 16 #define SHA1_LENGTH 20 -TEST_F(cryptoTest, MakeMd5Mac) { +void test_MakeMd5Mac(void) { const char* PKT_DATA = "abcdefgh0123"; const int PKT_LEN = strlen(PKT_DATA); @@ -18,21 +16,22 @@ TEST_F(cryptoTest, MakeMd5Mac) { "\x52\x6c\xb8\x38\xaf\x06\x5a\xfb\x6c\x98\xbb\xc0\x9b\x0a\x7a\x1b"; char actual[MD5_LENGTH]; - key md5; + struct key md5; md5.next = NULL; md5.key_id = 10; md5.key_len = 6; memcpy(&md5.key_seq, "md5seq", md5.key_len); memcpy(&md5.type, "MD5", 4); - EXPECT_EQ(MD5_LENGTH, + TEST_ASSERT_EQUAL(MD5_LENGTH, make_mac((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual)); - EXPECT_TRUE(memcmp(EXPECTED_DIGEST, actual, MD5_LENGTH) == 0); + TEST_ASSERT_TRUE(memcmp(EXPECTED_DIGEST, actual, MD5_LENGTH) == 0); } + +void test_MakeSHA1Mac(void) { #ifdef OPENSSL -TEST_F(cryptoTest, MakeSHA1Mac) { const char* PKT_DATA = "abcdefgh0123"; const int PKT_LEN = strlen(PKT_DATA); const char* EXPECTED_DIGEST = @@ -40,21 +39,24 @@ TEST_F(cryptoTest, MakeSHA1Mac) { "\x63\x85\xb4\xce\xbe\x94\xa0\x97\x16\x1d"; char actual[SHA1_LENGTH]; - key sha1; + struct key sha1; sha1.next = NULL; sha1.key_id = 20; sha1.key_len = 7; memcpy(&sha1.key_seq, "sha1seq", sha1.key_len); memcpy(&sha1.type, "SHA1", 5); - EXPECT_EQ(SHA1_LENGTH, + TEST_ASSERT_EQUAL(SHA1_LENGTH, make_mac((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1, actual)); - EXPECT_TRUE(memcmp(EXPECTED_DIGEST, actual, SHA1_LENGTH) == 0); -} + TEST_ASSERT_TRUE(memcmp(EXPECTED_DIGEST, actual, SHA1_LENGTH) == 0); +#else + TEST_IGNORE_MESSAGE("OpenSSL not found, skipping..."); #endif /* OPENSSL */ +} + -TEST_F(cryptoTest, VerifyCorrectMD5) { +void test_VerifyCorrectMD5(void) { const char* PKT_DATA = "sometestdata" // Data "\0\0\0\0" // Key-ID (unused) @@ -62,18 +64,19 @@ TEST_F(cryptoTest, VerifyCorrectMD5) { "\x2b\x7b\xfe\x4f\xa2\x32\xcf\xac"; const int PKT_LEN = 12; - key md5; + struct key md5; md5.next = NULL; md5.key_id = 0; md5.key_len = 6; memcpy(&md5.key_seq, "md5key", md5.key_len); memcpy(&md5.type, "MD5", 4); - EXPECT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5)); + TEST_ASSERT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5)); } + +void test_VerifySHA1(void) { #ifdef OPENSSL -TEST_F(cryptoTest, VerifySHA1) { const char* PKT_DATA = "sometestdata" // Data "\0\0\0\0" // Key-ID (unused) @@ -81,18 +84,20 @@ TEST_F(cryptoTest, VerifySHA1) { "\x2d\x8a\x7d\x06\x96\xe6\x0c\xbc\xed\xe1"; const int PKT_LEN = 12; - key sha1; + struct key sha1; sha1.next = NULL; sha1.key_id = 0; sha1.key_len = 7; memcpy(&sha1.key_seq, "sha1key", sha1.key_len); memcpy(&sha1.type, "SHA1", 5); - EXPECT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1)); -} + TEST_ASSERT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1)); +#else + TEST_IGNORE_MESSAGE("OpenSSL not found, skipping..."); #endif /* OPENSSL */ +} -TEST_F(cryptoTest, VerifyFailure) { +void test_VerifyFailure(void) { /* We use a copy of the MD5 verification code, but modify * the last bit to make sure verification fails. */ const char* PKT_DATA = @@ -102,28 +107,28 @@ TEST_F(cryptoTest, VerifyFailure) { "\x2b\x7b\xfe\x4f\xa2\x32\xcf\x00"; // Last byte is wrong! const int PKT_LEN = 12; - key md5; + struct key md5; md5.next = NULL; md5.key_id = 0; md5.key_len = 6; memcpy(&md5.key_seq, "md5key", md5.key_len); memcpy(&md5.type, "MD5", 4); - EXPECT_FALSE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5)); + TEST_ASSERT_FALSE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5)); } -TEST_F(cryptoTest, PacketSizeNotMultipleOfFourBytes) { +void test_PacketSizeNotMultipleOfFourBytes(void) { const char* PKT_DATA = "123456"; const int PKT_LEN = 6; char actual[MD5_LENGTH]; - key md5; + struct key md5; md5.next = NULL; md5.key_id = 10; md5.key_len = 6; memcpy(&md5.key_seq, "md5seq", md5.key_len); memcpy(&md5.type, "MD5", 4); - EXPECT_EQ(0, make_mac((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual)); + TEST_ASSERT_EQUAL(0, make_mac((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual)); } diff --git a/contrib/ntp/sntp/tests/fileHandlingTest.h b/contrib/ntp/sntp/tests/fileHandlingTest.h index 502a248b9bd0..38c3fa6391c4 100644 --- a/contrib/ntp/sntp/tests/fileHandlingTest.h +++ b/contrib/ntp/sntp/tests/fileHandlingTest.h @@ -1,64 +1,100 @@ #ifndef FILE_HANDLING_TEST_H #define FILE_HANDLING_TEST_H +#include "stdlib.h" #include "sntptest.h" -#include <fstream> -#include <string> +#include <string.h> +#include <unistd.h> -using std::ifstream; -using std::string; -using std::ios; -class fileHandlingTest : public sntptest { -protected: - enum DirectoryType { - INPUT_DIR = 0, - OUTPUT_DIR = 1 - }; - - std::string CreatePath(const char* filename, DirectoryType argument) { - std::string path; +enum DirectoryType { + INPUT_DIR = 0, + OUTPUT_DIR = 1 +}; - if (m_params.size() >= argument + 1) { - path = m_params[argument]; - } +const char * CreatePath(const char* filename, enum DirectoryType argument) { + + char * path = malloc (sizeof (char) * 256); - if (path[path.size()-1] != DIR_SEP && !path.empty()) { - path.append(1, DIR_SEP); - } - path.append(filename); + /* + if (m_params.size() >= argument + 1) { + path = m_params[argument]; + } - return path; + if (path[path.size()-1] != DIR_SEP && !path.empty()) { + path.append(1, DIR_SEP); } + */ + //strcpy(path,filename); + //path.append(filename); - int GetFileSize(ifstream& file) { - int initial = file.tellg(); + //return path; - file.seekg(0, ios::end); - int length = file.tellg(); - file.seekg(initial); + char cwd[1024]; + if (getcwd(cwd, sizeof(cwd)) != NULL) + printf("Current working dir: %s\n", cwd); + + printf("builddir is <.>\n"); + printf("abs_srcdir is </deacon/backroom/snaps/ntp-stable/sntp/tests>\n"); + strcpy(path,"/deacon/backroom/snaps/ntp-stable/sntp/tests/data/"); - return length; - } + //strcpy(path,""); + strcat(path,filename); + printf("PATH IS : %s\n",path); + return path; +} + +int GetFileSize(FILE *file) { + + fseek(file, 0L, SEEK_END); + int length = ftell(file); + fseek(file, 0L, SEEK_SET); + + //int initial = file.tellg(); + + //file.seekg(0, ios::end); + //int length = file.tellg(); + //file.seekg(initial); - void CompareFileContent(ifstream& expected, ifstream& actual) { - int currentLine = 1; - while (actual.good() && expected.good()) { - string actualLine, expectedLine; - getline(actual, actualLine); - getline(expected, expectedLine); - - EXPECT_EQ(expectedLine, actualLine) << "Comparision failed on line " << currentLine; - currentLine++; + return length; +} + +bool CompareFileContent(FILE* expected, FILE* actual) { + int currentLine = 1; + + char actualLine[1024]; + char expectedLine[1024]; + size_t lenAct = sizeof actualLine; + size_t lenExp = sizeof expectedLine; + + while ( ( (fgets(actualLine, lenAct, actual)) != NULL) + && ( (fgets(expectedLine, lenExp, expected)) != NULL ) + ) { + + //printf("%s",actualLine); + //printf("%s",expectedLine); + + if( strcmp(actualLine,expectedLine) !=0 ){ + printf("Comparision failed on line %d",currentLine); + return FALSE; } - } - void ClearFile(const std::string& filename) { - std::ofstream clear(filename.c_str(), ios::trunc); - ASSERT_TRUE(clear.good()); - clear.close(); + //I removed this and modified the test kodFile.c, because there shouldn't be any ASSERTs in .h files! + //TEST_ASSERT_EQUAL_STRING(actualLine,expectedLine);//EXPECT_EQ(expectedLine, actualLine) << "Comparision failed on line " << currentLine; + currentLine++; } -}; + + return TRUE; +} + +void ClearFile(const char * filename) { + FILE * clear = fopen(filename, "w");//ios::trunc); //similar to truncate, I GUESS???! + + //I removed this because there shouldn't be any ASSERTs in .h files! + //TEST_ASSERT_TRUE(clear != NULL); + fclose(clear); +} + #endif // FILE_HANDLING_TEST_H diff --git a/contrib/ntp/sntp/tests/fileHandlingTest.h.in b/contrib/ntp/sntp/tests/fileHandlingTest.h.in new file mode 100644 index 000000000000..8ff9d34ec3b7 --- /dev/null +++ b/contrib/ntp/sntp/tests/fileHandlingTest.h.in @@ -0,0 +1,100 @@ +#ifndef FILE_HANDLING_TEST_H +#define FILE_HANDLING_TEST_H + +#include "stdlib.h" +#include "sntptest.h" + +#include <string.h> +#include <unistd.h> + + +enum DirectoryType { + INPUT_DIR = 0, + OUTPUT_DIR = 1 +}; + +const char * CreatePath(const char* filename, enum DirectoryType argument) { + + char * path = malloc (sizeof (char) * 256); + + /* + if (m_params.size() >= argument + 1) { + path = m_params[argument]; + } + + if (path[path.size()-1] != DIR_SEP && !path.empty()) { + path.append(1, DIR_SEP); + } + */ + //strcpy(path,filename); + //path.append(filename); + + //return path; + + char cwd[1024]; + if (getcwd(cwd, sizeof(cwd)) != NULL) + printf("Current working dir: %s\n", cwd); + + printf("builddir is <@builddir@>\n"); + printf("abs_srcdir is <@abs_srcdir@>\n"); + strcpy(path,"@abs_srcdir@/data/"); + + //strcpy(path,""); + strcat(path,filename); + printf("PATH IS : %s\n",path); + return path; +} + +int GetFileSize(FILE *file) { + + fseek(file, 0L, SEEK_END); + int length = ftell(file); + fseek(file, 0L, SEEK_SET); + + //int initial = file.tellg(); + + //file.seekg(0, ios::end); + //int length = file.tellg(); + //file.seekg(initial); + + return length; +} + +bool CompareFileContent(FILE* expected, FILE* actual) { + int currentLine = 1; + + char actualLine[1024]; + char expectedLine[1024]; + size_t lenAct = sizeof actualLine; + size_t lenExp = sizeof expectedLine; + + while ( ( (fgets(actualLine, lenAct, actual)) != NULL) + && ( (fgets(expectedLine, lenExp, expected)) != NULL ) + ) { + + //printf("%s",actualLine); + //printf("%s",expectedLine); + + if( strcmp(actualLine,expectedLine) !=0 ){ + printf("Comparision failed on line %d",currentLine); + return FALSE; + } + + //I removed this and modified the test kodFile.c, because there shouldn't be any ASSERTs in .h files! + //TEST_ASSERT_EQUAL_STRING(actualLine,expectedLine);//EXPECT_EQ(expectedLine, actualLine) << "Comparision failed on line " << currentLine; + currentLine++; + } + + return TRUE; +} + +void ClearFile(const char * filename) { + FILE * clear = fopen(filename, "w");//ios::trunc); //similar to truncate, I GUESS???! + + //I removed this because there shouldn't be any ASSERTs in .h files! + //TEST_ASSERT_TRUE(clear != NULL); + fclose(clear); +} + + +#endif // FILE_HANDLING_TEST_H diff --git a/contrib/ntp/sntp/tests/g_fileHandlingTest.h b/contrib/ntp/sntp/tests/g_fileHandlingTest.h new file mode 100644 index 000000000000..7c8a78a146e3 --- /dev/null +++ b/contrib/ntp/sntp/tests/g_fileHandlingTest.h @@ -0,0 +1,64 @@ +#ifndef FILE_HANDLING_TEST_H +#define FILE_HANDLING_TEST_H + +#include "g_sntptest.h" + +#include <fstream> +#include <string> + +using std::ifstream; +using std::string; +using std::ios; + +class fileHandlingTest : public sntptest { +protected: + enum DirectoryType { + INPUT_DIR = 0, + OUTPUT_DIR = 1 + }; + + std::string CreatePath(const char* filename, DirectoryType argument) { + std::string path; + + if (m_params.size() >= argument + 1) { + path = m_params[argument]; + } + + if (path[path.size()-1] != DIR_SEP && !path.empty()) { + path.append(1, DIR_SEP); + } + path.append(filename); + + return path; + } + + int GetFileSize(ifstream& file) { + int initial = file.tellg(); + + file.seekg(0, ios::end); + int length = file.tellg(); + file.seekg(initial); + + return length; + } + + void CompareFileContent(ifstream& expected, ifstream& actual) { + int currentLine = 1; + while (actual.good() && expected.good()) { + string actualLine, expectedLine; + getline(actual, actualLine); + getline(expected, expectedLine); + + EXPECT_EQ(expectedLine, actualLine) << "Comparision failed on line " << currentLine; + currentLine++; + } + } + + void ClearFile(const std::string& filename) { + std::ofstream clear(filename.c_str(), ios::trunc); + ASSERT_TRUE(clear.good()); + clear.close(); + } +}; + +#endif // FILE_HANDLING_TEST_H diff --git a/contrib/ntp/sntp/tests/networking.cpp b/contrib/ntp/sntp/tests/g_networking.cpp index 1d6ad6c44065..d75f4a5cc680 100644 --- a/contrib/ntp/sntp/tests/networking.cpp +++ b/contrib/ntp/sntp/tests/g_networking.cpp @@ -1,4 +1,4 @@ -#include "sntptest.h" +#include "g_sntptest.h" extern "C" { #include "networking.h" diff --git a/contrib/ntp/sntp/tests/packetHandling.cpp b/contrib/ntp/sntp/tests/g_packetHandling.cpp index ef17489bd6b9..bd5b14e0d70c 100644 --- a/contrib/ntp/sntp/tests/packetHandling.cpp +++ b/contrib/ntp/sntp/tests/g_packetHandling.cpp @@ -1,4 +1,4 @@ -#include "sntptest.h" +#include "g_sntptest.h" extern "C" { #include "kod_management.h" diff --git a/contrib/ntp/sntp/tests/packetProcessing.cpp b/contrib/ntp/sntp/tests/g_packetProcessing.cpp index 322b8938ecc2..85659a43dda5 100644 --- a/contrib/ntp/sntp/tests/packetProcessing.cpp +++ b/contrib/ntp/sntp/tests/g_packetProcessing.cpp @@ -1,4 +1,4 @@ -#include "sntptest.h" +#include "g_sntptest.h" extern "C" { #include "networking.h" diff --git a/contrib/ntp/sntp/tests/g_sntptest.h b/contrib/ntp/sntp/tests/g_sntptest.h new file mode 100644 index 000000000000..d5add9cbf465 --- /dev/null +++ b/contrib/ntp/sntp/tests/g_sntptest.h @@ -0,0 +1,35 @@ +#ifndef SNTPTEST_H +#define SNTPTEST_H + +#include "tests_main.h" + +extern "C" { +#include "ntp_stdlib.h" +#include "sntp-opts.h" +}; + +class sntptest : public ntptest { +protected: + sntptest() { + optionSaveState(&sntpOptions); + } + + ~sntptest() { + optionRestore(&sntpOptions); + } + + void ActivateOption(const char* option, const char* argument) { + const int ARGV_SIZE = 4; + + char* opts[ARGV_SIZE]; + + opts[0] = estrdup("sntpopts"); + opts[1] = estrdup(option); + opts[2] = estrdup(argument); + opts[3] = estrdup("127.0.0.1"); + + optionProcess(&sntpOptions, ARGV_SIZE, opts); + } +}; + +#endif // SNTPTEST_H diff --git a/contrib/ntp/sntp/tests/keyFile.c b/contrib/ntp/sntp/tests/keyFile.c new file mode 100644 index 000000000000..3769947c5008 --- /dev/null +++ b/contrib/ntp/sntp/tests/keyFile.c @@ -0,0 +1,140 @@ +#include "config.h" +#include "fileHandlingTest.h" + +#include "ntp_stdlib.h" +#include "ntp_types.h" +#include "crypto.h" + +#include "unity.h" + +//typedef int bool; + + +bool CompareKeys(struct key expected, struct key actual) { + if (expected.key_id != actual.key_id){ + printf("Expected key_id: %d", expected.key_id); + printf(" but was: %d\n", actual.key_id); + return FALSE; + } + if (expected.key_len != actual.key_len){ + printf("Expected key_len: %d", expected.key_len); + printf(" but was: %d\n", actual.key_len); + return FALSE; + } + if (strcmp(expected.type, actual.type) != 0){ + printf("Expected key_type: %s", expected.type); + printf(" but was: %s\n", actual.type); + return FALSE; + + } + if (memcmp(expected.key_seq, actual.key_seq, expected.key_len) != 0){ + printf("Key mismatch!\n"); + return FALSE; + } + return TRUE; +} + +bool CompareKeysAlternative(int key_id, + int key_len, + const char* type, + const char* key_seq, + struct key actual) { + struct key temp; + + temp.key_id = key_id; + temp.key_len = key_len; + strlcpy(temp.type, type, sizeof(temp.type)); + memcpy(temp.key_seq, key_seq, key_len); + + return CompareKeys(temp, actual); +} + + +void test_ReadEmptyKeyFile() { + struct key* keys = NULL; + + TEST_ASSERT_EQUAL(0, auth_init(CreatePath("key-test-empty", INPUT_DIR), &keys)); + + TEST_ASSERT_TRUE(keys == NULL); +} + +void test_ReadASCIIKeys() { + struct key* keys = NULL; + + TEST_ASSERT_EQUAL(2, auth_init(CreatePath("key-test-ascii", INPUT_DIR), &keys)); + + TEST_ASSERT_TRUE(keys != NULL); + + struct key* result = NULL; + get_key(40, &result); + TEST_ASSERT_TRUE(result != NULL); + TEST_ASSERT_TRUE(CompareKeysAlternative(40, 11, "MD5", "asciikeyTwo", *result)); + + result = NULL; + get_key(50, &result); + TEST_ASSERT_TRUE(result != NULL); + TEST_ASSERT_TRUE(CompareKeysAlternative(50, 11, "MD5", "asciikeyOne", *result)); +} + +void test_ReadHexKeys() { + struct key* keys = NULL; + + TEST_ASSERT_EQUAL(3, auth_init(CreatePath("key-test-hex", INPUT_DIR), &keys)); + + TEST_ASSERT_TRUE(keys != NULL); + + struct key* result = NULL; + get_key(10, &result); + TEST_ASSERT_TRUE(result != NULL); + TEST_ASSERT_TRUE(CompareKeysAlternative(10, 13, "MD5", + "\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89", *result)); + + result = NULL; + get_key(20, &result); + TEST_ASSERT_TRUE(result != NULL); + char data1[15]; memset(data1, 0x11, 15); + TEST_ASSERT_TRUE(CompareKeysAlternative(20, 15, "MD5", data1, *result)); + + result = NULL; + get_key(30, &result); + TEST_ASSERT_TRUE(result != NULL); + char data2[13]; memset(data2, 0x01, 13); + TEST_ASSERT_TRUE(CompareKeysAlternative(30, 13, "MD5", data2, *result)); +} + +void test_ReadKeyFileWithComments() { + struct key* keys = NULL; + + TEST_ASSERT_EQUAL(2, auth_init(CreatePath("key-test-comments", INPUT_DIR), &keys)); + + TEST_ASSERT_TRUE(keys != NULL); + + struct key* result = NULL; + get_key(10, &result); + TEST_ASSERT_TRUE(result != NULL); + char data[15]; memset(data, 0x01, 15); + TEST_ASSERT_TRUE(CompareKeysAlternative(10, 15, "MD5", data, *result)); + + result = NULL; + get_key(34, &result); + TEST_ASSERT_TRUE(result != NULL); + TEST_ASSERT_TRUE(CompareKeysAlternative(34, 3, "MD5", "xyz", *result)); +} + +void test_ReadKeyFileWithInvalidHex() { + struct key* keys = NULL; + + TEST_ASSERT_EQUAL(1, auth_init(CreatePath("key-test-invalid-hex", INPUT_DIR), &keys)); + + TEST_ASSERT_TRUE(keys != NULL); + + struct key* result = NULL; + get_key(10, &result); + TEST_ASSERT_TRUE(result != NULL); + char data[15]; memset(data, 0x01, 15); + TEST_ASSERT_TRUE(CompareKeysAlternative(10, 15, "MD5", data, *result)); + + result = NULL; + get_key(30, &result); // Should not exist, and result should remain NULL. + TEST_ASSERT_TRUE(result == NULL); +} diff --git a/contrib/ntp/sntp/tests/keyFile.cpp b/contrib/ntp/sntp/tests/keyFile.cpp deleted file mode 100644 index 3efbe8f8d8f6..000000000000 --- a/contrib/ntp/sntp/tests/keyFile.cpp +++ /dev/null @@ -1,131 +0,0 @@ -#include "fileHandlingTest.h" - -extern "C" { -#include "crypto.h" -}; - -class keyFileTest : public fileHandlingTest { -protected: - ::testing::AssertionResult CompareKeys(key& expected, key& actual) { - if (expected.key_id != actual.key_id) - return ::testing::AssertionFailure() - << "Expected key_id: " << expected.key_id - << " but was: " << actual.key_id; - if (expected.key_len != actual.key_len) - return ::testing::AssertionFailure() - << "Expected key_len: " << expected.key_len - << " but was: " << actual.key_len; - if (strcmp(expected.type, actual.type) != 0) - return ::testing::AssertionFailure() - << "Expected key_type: " << expected.type - << " but was: " << actual.type; - if (memcmp(expected.key_seq, actual.key_seq, expected.key_len) != 0) - return ::testing::AssertionFailure() - << "Key mismatch!"; - return ::testing::AssertionSuccess(); - } - - ::testing::AssertionResult CompareKeys(int key_id, - int key_len, - const char* type, - const char* key_seq, - key& actual) { - key temp; - - temp.key_id = key_id; - temp.key_len = key_len; - strlcpy(temp.type, type, sizeof(temp.type)); - memcpy(temp.key_seq, key_seq, key_len); - - return CompareKeys(temp, actual); - } -}; - -TEST_F(keyFileTest, ReadEmptyKeyFile) { - key* keys = NULL; - - ASSERT_EQ(0, auth_init(CreatePath("key-test-empty", INPUT_DIR).c_str(), &keys)); - - EXPECT_TRUE(keys == NULL); -} - -TEST_F(keyFileTest, ReadASCIIKeys) { - key* keys = NULL; - - ASSERT_EQ(2, auth_init(CreatePath("key-test-ascii", INPUT_DIR).c_str(), &keys)); - - ASSERT_TRUE(keys != NULL); - - key* result = NULL; - get_key(40, &result); - ASSERT_TRUE(result != NULL); - EXPECT_TRUE(CompareKeys(40, 11, "MD5", "asciikeyTwo", *result)); - - result = NULL; - get_key(50, &result); - ASSERT_TRUE(result != NULL); - EXPECT_TRUE(CompareKeys(50, 11, "MD5", "asciikeyOne", *result)); -} - -TEST_F(keyFileTest, ReadHexKeys) { - key* keys = NULL; - - ASSERT_EQ(3, auth_init(CreatePath("key-test-hex", INPUT_DIR).c_str(), &keys)); - - ASSERT_TRUE(keys != NULL); - - key* result = NULL; - get_key(10, &result); - ASSERT_TRUE(result != NULL); - EXPECT_TRUE(CompareKeys(10, 13, "MD5", - "\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89", *result)); - - result = NULL; - get_key(20, &result); - ASSERT_TRUE(result != NULL); - char data1[15]; memset(data1, 0x11, 15); - EXPECT_TRUE(CompareKeys(20, 15, "MD5", data1, *result)); - - result = NULL; - get_key(30, &result); - ASSERT_TRUE(result != NULL); - char data2[13]; memset(data2, 0x01, 13); - EXPECT_TRUE(CompareKeys(30, 13, "MD5", data2, *result)); -} - -TEST_F(keyFileTest, ReadKeyFileWithComments) { - key* keys = NULL; - - ASSERT_EQ(2, auth_init(CreatePath("key-test-comments", INPUT_DIR).c_str(), &keys)); - - ASSERT_TRUE(keys != NULL); - - key* result = NULL; - get_key(10, &result); - ASSERT_TRUE(result != NULL); - char data[15]; memset(data, 0x01, 15); - EXPECT_TRUE(CompareKeys(10, 15, "MD5", data, *result)); - - result = NULL; - get_key(34, &result); - ASSERT_TRUE(result != NULL); - EXPECT_TRUE(CompareKeys(34, 3, "MD5", "xyz", *result)); -} - -TEST_F(keyFileTest, ReadKeyFileWithInvalidHex) { - key* keys = NULL; - - ASSERT_EQ(1, auth_init(CreatePath("key-test-invalid-hex", INPUT_DIR).c_str(), &keys)); - - ASSERT_TRUE(keys != NULL); - - key* result = NULL; - get_key(10, &result); - ASSERT_TRUE(result != NULL); - char data[15]; memset(data, 0x01, 15); - EXPECT_TRUE(CompareKeys(10, 15, "MD5", data, *result)); - - result = NULL; - get_key(30, &result); // Should not exist, and result should remain NULL. - ASSERT_TRUE(result == NULL); -} diff --git a/contrib/ntp/sntp/tests/kodDatabase.c b/contrib/ntp/sntp/tests/kodDatabase.c new file mode 100644 index 000000000000..a6b86d06bf00 --- /dev/null +++ b/contrib/ntp/sntp/tests/kodDatabase.c @@ -0,0 +1,126 @@ +#include "config.h" + +#include "ntp_types.h" +#include "sntptest.h" +#include "ntp_stdlib.h" +#include "sntp-opts.h" + +#include "kod_management.h" + +#include "unity.h" + +void setUp(void) +{ + kod_init_kod_db("/dev/null", TRUE); +} + +void tearDown(void) +{ +} + + +void test_SingleEntryHandling() { + char HOST[] = "192.0.2.5"; + char REASON[] = "DENY"; + + add_entry(HOST, REASON); + + struct kod_entry* result; + + TEST_ASSERT_EQUAL(1, search_entry(HOST, &result)); + TEST_ASSERT_EQUAL_STRING(HOST, result->hostname); + TEST_ASSERT_EQUAL_STRING(REASON, result->type); +} + +void test_MultipleEntryHandling() { + char HOST1[] = "192.0.2.3"; + char REASON1[] = "DENY"; + + char HOST2[] = "192.0.5.5"; + char REASON2[] = "RATE"; + + char HOST3[] = "192.0.10.1"; + char REASON3[] = "DENY"; + + add_entry(HOST1, REASON1); + add_entry(HOST2, REASON2); + add_entry(HOST3, REASON3); + + struct kod_entry* result; + + TEST_ASSERT_EQUAL(1, search_entry(HOST1, &result)); + TEST_ASSERT_EQUAL_STRING(HOST1, result->hostname); + TEST_ASSERT_EQUAL_STRING(REASON1, result->type); + + TEST_ASSERT_EQUAL(1, search_entry(HOST2, &result)); + TEST_ASSERT_EQUAL_STRING(HOST2, result->hostname); + TEST_ASSERT_EQUAL_STRING(REASON2, result->type); + + TEST_ASSERT_EQUAL(1, search_entry(HOST3, &result)); + TEST_ASSERT_EQUAL_STRING(HOST3, result->hostname); + TEST_ASSERT_EQUAL_STRING(REASON3, result->type); + + free(result); +} + +void test_NoMatchInSearch() { + char HOST_ADD[] = "192.0.2.6"; + char HOST_NOTADD[] = "192.0.6.1"; + char REASON[] = "DENY"; + + add_entry(HOST_ADD, REASON); + + struct kod_entry* result; + + TEST_ASSERT_EQUAL(0, search_entry(HOST_NOTADD, &result)); + TEST_ASSERT_TRUE(result == NULL); +} + +void test_AddDuplicate() { + char HOST[] = "192.0.2.3"; + char REASON1[] = "RATE"; + char REASON2[] = "DENY"; + + add_entry(HOST, REASON1); + struct kod_entry* result1; + TEST_ASSERT_EQUAL(1, search_entry(HOST, &result1)); + + /* + * Sleeps for two seconds since we want to ensure that + * the timestamp is updated to a new value. + */ + sleep(2); + + add_entry(HOST, REASON2); + struct kod_entry* result2; + TEST_ASSERT_EQUAL(1, search_entry(HOST, &result2)); + + TEST_ASSERT_FALSE(result1->timestamp == result2->timestamp); + + free(result1); + free(result2); +} + +void test_DeleteEntry() { + char HOST1[] = "192.0.2.1"; + char HOST2[] = "192.0.2.2"; + char HOST3[] = "192.0.2.3"; + char REASON[] = "DENY"; + + add_entry(HOST1, REASON); + add_entry(HOST2, REASON); + add_entry(HOST3, REASON); + + struct kod_entry* result; + + TEST_ASSERT_EQUAL(1, search_entry(HOST2, &result)); + free(result); + + delete_entry(HOST2, REASON); + + TEST_ASSERT_EQUAL(0, search_entry(HOST2, &result)); + + // Ensure that the other entry is still there. + TEST_ASSERT_EQUAL(1, search_entry(HOST1, &result)); + free(result); +} diff --git a/contrib/ntp/sntp/tests/kodDatabase.cpp b/contrib/ntp/sntp/tests/kodDatabase.cpp deleted file mode 100644 index 515f4337a3e4..000000000000 --- a/contrib/ntp/sntp/tests/kodDatabase.cpp +++ /dev/null @@ -1,118 +0,0 @@ -#include "sntptest.h" - -extern "C" { -#include "kod_management.h" -}; - -class kodDatabaseTest : public sntptest { -protected: - virtual void SetUp() { - kod_init_kod_db("/dev/null", TRUE); - } -}; - -TEST_F(kodDatabaseTest, SingleEntryHandling) { - char HOST[] = "192.0.2.5"; - char REASON[] = "DENY"; - - add_entry(HOST, REASON); - - kod_entry* result; - - EXPECT_EQ(1, search_entry(HOST, &result)); - EXPECT_STREQ(HOST, result->hostname); - EXPECT_STREQ(REASON, result->type); -} - -TEST_F(kodDatabaseTest, MultipleEntryHandling) { - char HOST1[] = "192.0.2.3"; - char REASON1[] = "DENY"; - - char HOST2[] = "192.0.5.5"; - char REASON2[] = "RATE"; - - char HOST3[] = "192.0.10.1"; - char REASON3[] = "DENY"; - - add_entry(HOST1, REASON1); - add_entry(HOST2, REASON2); - add_entry(HOST3, REASON3); - - kod_entry* result; - - EXPECT_EQ(1, search_entry(HOST1, &result)); - EXPECT_STREQ(HOST1, result->hostname); - EXPECT_STREQ(REASON1, result->type); - - EXPECT_EQ(1, search_entry(HOST2, &result)); - EXPECT_STREQ(HOST2, result->hostname); - EXPECT_STREQ(REASON2, result->type); - - EXPECT_EQ(1, search_entry(HOST3, &result)); - EXPECT_STREQ(HOST3, result->hostname); - EXPECT_STREQ(REASON3, result->type); - - free(result); -} - -TEST_F(kodDatabaseTest, NoMatchInSearch) { - char HOST_ADD[] = "192.0.2.6"; - char HOST_NOTADD[] = "192.0.6.1"; - char REASON[] = "DENY"; - - add_entry(HOST_ADD, REASON); - - kod_entry* result; - - EXPECT_EQ(0, search_entry(HOST_NOTADD, &result)); - EXPECT_TRUE(result == NULL); -} - -TEST_F(kodDatabaseTest, AddDuplicate) { - char HOST[] = "192.0.2.3"; - char REASON1[] = "RATE"; - char REASON2[] = "DENY"; - - add_entry(HOST, REASON1); - kod_entry* result1; - ASSERT_EQ(1, search_entry(HOST, &result1)); - - /* - * Sleeps for two seconds since we want to ensure that - * the timestamp is updated to a new value. - */ - sleep(2); - - add_entry(HOST, REASON2); - kod_entry* result2; - ASSERT_EQ(1, search_entry(HOST, &result2)); - - EXPECT_NE(result1->timestamp, result2->timestamp); - - free(result1); - free(result2); -} - -TEST_F(kodDatabaseTest, DeleteEntry) { - char HOST1[] = "192.0.2.1"; - char HOST2[] = "192.0.2.2"; - char HOST3[] = "192.0.2.3"; - char REASON[] = "DENY"; - - add_entry(HOST1, REASON); - add_entry(HOST2, REASON); - add_entry(HOST3, REASON); - - kod_entry* result; - - ASSERT_EQ(1, search_entry(HOST2, &result)); - free(result); - - delete_entry(HOST2, REASON); - - EXPECT_EQ(0, search_entry(HOST2, &result)); - - // Ensure that the other entry is still there. - EXPECT_EQ(1, search_entry(HOST1, &result)); - free(result); -} diff --git a/contrib/ntp/sntp/tests/kodFile.c b/contrib/ntp/sntp/tests/kodFile.c new file mode 100644 index 000000000000..7daec212692e --- /dev/null +++ b/contrib/ntp/sntp/tests/kodFile.c @@ -0,0 +1,145 @@ +#include "config.h" +#include "ntp_types.h" +#include "ntp_stdlib.h" // For estrdup() + + +#include "fileHandlingTest.h" + +#include "kod_management.h" + +#include "unity.h" + +/* + * We access some parts of the kod database directly, without + * going through the public interface + */ +extern int kod_db_cnt; +extern struct kod_entry** kod_db; +extern char* kod_db_file; + +void setUp() { + kod_db_cnt = 0; + kod_db = NULL; +} + +void tearDown() { +} + + +void test_ReadEmptyFile() { + kod_init_kod_db(CreatePath("kod-test-empty", INPUT_DIR), TRUE); + + TEST_ASSERT_EQUAL(0, kod_db_cnt); +} + +void test_ReadCorrectFile() { + kod_init_kod_db(CreatePath("kod-test-correct", INPUT_DIR), TRUE); + + TEST_ASSERT_EQUAL(2, kod_db_cnt); + + struct kod_entry* res; + + TEST_ASSERT_EQUAL(1, search_entry("192.0.2.5", &res)); + TEST_ASSERT_EQUAL_STRING("DENY", res->type); + TEST_ASSERT_EQUAL_STRING("192.0.2.5", res->hostname); + TEST_ASSERT_EQUAL(0x12345678, res->timestamp); + + TEST_ASSERT_EQUAL(1, search_entry("192.0.2.100", &res)); + TEST_ASSERT_EQUAL_STRING("RSTR", res->type); + TEST_ASSERT_EQUAL_STRING("192.0.2.100", res->hostname); + TEST_ASSERT_EQUAL(0xfff, res->timestamp); +} + +void test_ReadFileWithBlankLines() { + kod_init_kod_db(CreatePath("kod-test-blanks", INPUT_DIR), TRUE); + + TEST_ASSERT_EQUAL(3, kod_db_cnt); + + struct kod_entry* res; + + TEST_ASSERT_EQUAL(1, search_entry("192.0.2.5", &res)); + TEST_ASSERT_EQUAL_STRING("DENY", res->type); + TEST_ASSERT_EQUAL_STRING("192.0.2.5", res->hostname); + TEST_ASSERT_EQUAL(0x12345678, res->timestamp); + + TEST_ASSERT_EQUAL(1, search_entry("192.0.2.100", &res)); + TEST_ASSERT_EQUAL_STRING("RSTR", res->type); + TEST_ASSERT_EQUAL_STRING("192.0.2.100", res->hostname); + TEST_ASSERT_EQUAL(0xfff, res->timestamp); + + TEST_ASSERT_EQUAL(1, search_entry("example.com", &res)); + TEST_ASSERT_EQUAL_STRING("DENY", res->type); + TEST_ASSERT_EQUAL_STRING("example.com", res->hostname); + TEST_ASSERT_EQUAL(0xabcd, res->timestamp); +} + +void test_WriteEmptyFile() { + //kod_db_file = estrdup(CreatePath("kod-output-blank", OUTPUT_DIR)); //causing issues on psp-at1, replaced + kod_db_file = estrdup("kod-output-blank"); + //printf("kod PATH: %s\n",kod_db_file); + write_kod_db(); + + // Open file and ensure that the filesize is 0 bytes. + FILE * is; + is = fopen(kod_db_file, "rb");//std::ios::binary); + TEST_ASSERT_FALSE(is == NULL );//is.fail()); + + TEST_ASSERT_EQUAL(0, GetFileSize(is)); + + fclose(is); +} + +void test_WriteFileWithSingleEntry() { + //kod_db_file = estrdup(CreatePath("kod-output-single", OUTPUT_DIR)); //causing issues on psp-at1, replaced + kod_db_file = estrdup("kod-output-single"); + //printf("kod PATH: %s\n",kod_db_file); + add_entry("host1", "DENY"); + + // Here we must manipulate the timestamps, so they match the one in + // the expected file. + // + kod_db[0]->timestamp = 1; + + write_kod_db(); + + // Open file and compare sizes. + FILE * actual = fopen(kod_db_file, "rb"); + FILE * expected = fopen(CreatePath("kod-expected-single", INPUT_DIR),"rb"); + TEST_ASSERT_TRUE(actual !=NULL);//TEST_ASSERT_TRUE(actual.good()); + TEST_ASSERT_TRUE(expected !=NULL);//TEST_ASSERT_TRUE(expected.good()); + + TEST_ASSERT_EQUAL(GetFileSize(expected), GetFileSize(actual)); + + TEST_ASSERT_TRUE(CompareFileContent(expected, actual)); +} + +void test_WriteFileWithMultipleEntries() { + //kod_db_file = estrdup(CreatePath("kod-output-multiple", OUTPUT_DIR)); //causing issues on psp-at1, replaced + kod_db_file = estrdup("kod-output-multiple"); + //printf("kod PATH: %s\n",kod_db_file); + add_entry("example.com", "RATE"); + add_entry("192.0.2.1", "DENY"); + add_entry("192.0.2.5", "RSTR"); + + // + // Manipulate timestamps. This is a bit of a hack, ideally these + // tests should not care about the internal representation. + // + kod_db[0]->timestamp = 0xabcd; + kod_db[1]->timestamp = 0xabcd; + kod_db[2]->timestamp = 0xabcd; + + write_kod_db(); + + // Open file and compare sizes and content. + FILE * actual = fopen(kod_db_file, "rb"); + FILE * expected = fopen(CreatePath("kod-expected-multiple", INPUT_DIR),"rb"); + TEST_ASSERT_TRUE(actual !=NULL);//TEST_ASSERT_TRUE(actual.good()); + TEST_ASSERT_TRUE(expected !=NULL);//TEST_ASSERT_TRUE(expected.good()); + + + TEST_ASSERT_EQUAL(GetFileSize(expected), GetFileSize(actual)); + + TEST_ASSERT_TRUE(CompareFileContent(expected, actual)); +} + diff --git a/contrib/ntp/sntp/tests/kodFile.cpp b/contrib/ntp/sntp/tests/kodFile.cpp deleted file mode 100644 index e1775f6374fa..000000000000 --- a/contrib/ntp/sntp/tests/kodFile.cpp +++ /dev/null @@ -1,138 +0,0 @@ -#include "fileHandlingTest.h" - -extern "C" { -#include "kod_management.h" - -#include "ntp_stdlib.h" // For estrdup() -}; - -/* - * We access some parts of the kod database directly, without - * going through the public interface - */ -extern int kod_db_cnt; -extern kod_entry** kod_db; -extern char* kod_db_file; - -class kodFileTest : public fileHandlingTest { -protected: - virtual void SetUp() { - kod_db_cnt = 0; - kod_db = NULL; - } - - virtual void TearDown() { - } -}; - -TEST_F(kodFileTest, ReadEmptyFile) { - kod_init_kod_db(CreatePath("kod-test-empty", INPUT_DIR).c_str(), TRUE); - - EXPECT_EQ(0, kod_db_cnt); -} - -TEST_F(kodFileTest, ReadCorrectFile) { - kod_init_kod_db(CreatePath("kod-test-correct", INPUT_DIR).c_str(), TRUE); - - EXPECT_EQ(2, kod_db_cnt); - - kod_entry* res; - - ASSERT_EQ(1, search_entry("192.0.2.5", &res)); - EXPECT_STREQ("DENY", res->type); - EXPECT_STREQ("192.0.2.5", res->hostname); - EXPECT_EQ(0x12345678, res->timestamp); - - ASSERT_EQ(1, search_entry("192.0.2.100", &res)); - EXPECT_STREQ("RSTR", res->type); - EXPECT_STREQ("192.0.2.100", res->hostname); - EXPECT_EQ(0xfff, res->timestamp); -} - -TEST_F(kodFileTest, ReadFileWithBlankLines) { - kod_init_kod_db(CreatePath("kod-test-blanks", INPUT_DIR).c_str(), TRUE); - - EXPECT_EQ(3, kod_db_cnt); - - kod_entry* res; - - ASSERT_EQ(1, search_entry("192.0.2.5", &res)); - EXPECT_STREQ("DENY", res->type); - EXPECT_STREQ("192.0.2.5", res->hostname); - EXPECT_EQ(0x12345678, res->timestamp); - - ASSERT_EQ(1, search_entry("192.0.2.100", &res)); - EXPECT_STREQ("RSTR", res->type); - EXPECT_STREQ("192.0.2.100", res->hostname); - EXPECT_EQ(0xfff, res->timestamp); - - ASSERT_EQ(1, search_entry("example.com", &res)); - EXPECT_STREQ("DENY", res->type); - EXPECT_STREQ("example.com", res->hostname); - EXPECT_EQ(0xabcd, res->timestamp); -} - -TEST_F(kodFileTest, WriteEmptyFile) { - kod_db_file = estrdup(CreatePath("kod-output-blank", OUTPUT_DIR).c_str()); - - write_kod_db(); - - // Open file and ensure that the filesize is 0 bytes. - std::ifstream is(kod_db_file, std::ios::binary); - ASSERT_FALSE(is.fail()); - - EXPECT_EQ(0, GetFileSize(is)); - - is.close(); -} - -TEST_F(kodFileTest, WriteFileWithSingleEntry) { - kod_db_file = estrdup(CreatePath("kod-output-single", OUTPUT_DIR).c_str()); - - add_entry("host1", "DENY"); - - /* Here we must manipulate the timestamps, so they match the one in - * the expected file. - */ - kod_db[0]->timestamp = 1; - - write_kod_db(); - - // Open file and compare sizes. - ifstream actual(kod_db_file, ios::binary); - ifstream expected(CreatePath("kod-expected-single", INPUT_DIR).c_str()); - ASSERT_TRUE(actual.good()); - ASSERT_TRUE(expected.good()); - - ASSERT_EQ(GetFileSize(expected), GetFileSize(actual)); - - CompareFileContent(expected, actual); -} - -TEST_F(kodFileTest, WriteFileWithMultipleEntries) { - kod_db_file = estrdup(CreatePath("kod-output-multiple", OUTPUT_DIR).c_str()); - - add_entry("example.com", "RATE"); - add_entry("192.0.2.1", "DENY"); - add_entry("192.0.2.5", "RSTR"); - - /* - * Manipulate timestamps. This is a bit of a hack, ideally these - * tests should not care about the internal representation. - */ - kod_db[0]->timestamp = 0xabcd; - kod_db[1]->timestamp = 0xabcd; - kod_db[2]->timestamp = 0xabcd; - - write_kod_db(); - - // Open file and compare sizes and content. - ifstream actual(kod_db_file, ios::binary); - ifstream expected(CreatePath("kod-expected-multiple", INPUT_DIR).c_str()); - ASSERT_TRUE(actual.good()); - ASSERT_TRUE(expected.good()); - - ASSERT_EQ(GetFileSize(expected), GetFileSize(actual)); - - CompareFileContent(expected, actual); -} diff --git a/contrib/ntp/sntp/tests/networking.c b/contrib/ntp/sntp/tests/networking.c new file mode 100644 index 000000000000..e2e37123952e --- /dev/null +++ b/contrib/ntp/sntp/tests/networking.c @@ -0,0 +1,7 @@ +#include "config.h" + +#include "sntptest.h" + +#include "networking.h" + +#include "unity.h" diff --git a/contrib/ntp/sntp/tests/packetHandling.c b/contrib/ntp/sntp/tests/packetHandling.c new file mode 100644 index 000000000000..4cb5a91c9308 --- /dev/null +++ b/contrib/ntp/sntp/tests/packetHandling.c @@ -0,0 +1,274 @@ +#include "config.h" +#include "ntp_debug.h" +#include "ntp_stdlib.h" +#include "ntp_types.h" + +#include "sntptest.h" + +#include "kod_management.h" +#include "main.h" +#include "networking.h" +#include "ntp.h" + +#include "unity.h" + + +int counter = 0; + + +// old code from google test framework, moved to SetUp() for unity +void setUp(void) +{ + init_lib(); +} + + + +int LfpEquality(const l_fp expected, const l_fp actual) { + if (L_ISEQU(&expected, &actual)) { + return TRUE; + } else { + return FALSE; + } +} + +void test_GenerateUnauthenticatedPacket(void) { + struct pkt testpkt; + + struct timeval xmt; + GETTIMEOFDAY(&xmt, NULL); + xmt.tv_sec += JAN_1970; + + TEST_ASSERT_EQUAL(LEN_PKT_NOMAC, + generate_pkt(&testpkt, &xmt, 0, NULL)); + + TEST_ASSERT_EQUAL(LEAP_NOTINSYNC, PKT_LEAP(testpkt.li_vn_mode)); + TEST_ASSERT_EQUAL(NTP_VERSION, PKT_VERSION(testpkt.li_vn_mode)); + TEST_ASSERT_EQUAL(MODE_CLIENT, PKT_MODE(testpkt.li_vn_mode)); + + TEST_ASSERT_EQUAL(STRATUM_UNSPEC, PKT_TO_STRATUM(testpkt.stratum)); + TEST_ASSERT_EQUAL(8, testpkt.ppoll); + + l_fp expected_xmt, actual_xmt; + TVTOTS(&xmt, &expected_xmt); + NTOHL_FP(&testpkt.xmt, &actual_xmt); + TEST_ASSERT_TRUE(LfpEquality(expected_xmt, actual_xmt)); +} + +void test_GenerateAuthenticatedPacket(void) { + struct key testkey; + testkey.next = NULL; + testkey.key_id = 30; + testkey.key_len = 9; + memcpy(testkey.key_seq, "123456789", testkey.key_len); + memcpy(testkey.type, "MD5", 3); + + struct pkt testpkt; + + struct timeval xmt; + GETTIMEOFDAY(&xmt, NULL); + xmt.tv_sec += JAN_1970; + + const int EXPECTED_PKTLEN = LEN_PKT_NOMAC + MAX_MD5_LEN; + + TEST_ASSERT_EQUAL(EXPECTED_PKTLEN, + generate_pkt(&testpkt, &xmt, testkey.key_id, &testkey)); + + TEST_ASSERT_EQUAL(LEAP_NOTINSYNC, PKT_LEAP(testpkt.li_vn_mode)); + TEST_ASSERT_EQUAL(NTP_VERSION, PKT_VERSION(testpkt.li_vn_mode)); + TEST_ASSERT_EQUAL(MODE_CLIENT, PKT_MODE(testpkt.li_vn_mode)); + + TEST_ASSERT_EQUAL(STRATUM_UNSPEC, PKT_TO_STRATUM(testpkt.stratum)); + TEST_ASSERT_EQUAL(8, testpkt.ppoll); + + l_fp expected_xmt, actual_xmt; + TVTOTS(&xmt, &expected_xmt); + NTOHL_FP(&testpkt.xmt, &actual_xmt); + TEST_ASSERT_TRUE(LfpEquality(expected_xmt, actual_xmt)); + + TEST_ASSERT_EQUAL(testkey.key_id, ntohl(testpkt.exten[0])); + + char expected_mac[MAX_MD5_LEN]; + TEST_ASSERT_EQUAL(MAX_MD5_LEN - 4, // Remove the key_id, only keep the mac. + make_mac((char*)&testpkt, LEN_PKT_NOMAC, MAX_MD5_LEN, &testkey, expected_mac)); + TEST_ASSERT_TRUE(memcmp(expected_mac, (char*)&testpkt.exten[1], MAX_MD5_LEN -4) == 0); +} + +void test_OffsetCalculationPositiveOffset(void) { + struct pkt rpkt; + + rpkt.precision = -16; // 0,000015259 + rpkt.rootdelay = HTONS_FP(DTOUFP(0.125)); + rpkt.rootdisp = HTONS_FP(DTOUFP(0.25)); + // Synch Distance: (0.125+0.25)/2.0 == 0.1875 + l_fp reftime; + get_systime(&reftime); + HTONL_FP(&reftime, &rpkt.reftime); + + l_fp tmp; + + // T1 - Originate timestamp + tmp.l_ui = 1000000000UL; + tmp.l_uf = 0UL; + HTONL_FP(&tmp, &rpkt.org); + + // T2 - Receive timestamp + tmp.l_ui = 1000000001UL; + tmp.l_uf = 2147483648UL; + HTONL_FP(&tmp, &rpkt.rec); + + // T3 - Transmit timestamp + tmp.l_ui = 1000000002UL; + tmp.l_uf = 0UL; + HTONL_FP(&tmp, &rpkt.xmt); + + // T4 - Destination timestamp as standard timeval + tmp.l_ui = 1000000001UL; + tmp.l_uf = 0UL; + struct timeval dst; + TSTOTV(&tmp, &dst); + dst.tv_sec -= JAN_1970; + + double offset, precision, synch_distance; + offset_calculation(&rpkt, LEN_PKT_NOMAC, &dst, &offset, &precision, &synch_distance); + + TEST_ASSERT_EQUAL_FLOAT(1.25, offset); + TEST_ASSERT_EQUAL_FLOAT(1. / ULOGTOD(16), precision); + // 1.1250150000000001 ? + TEST_ASSERT_EQUAL_FLOAT(1.125015, synch_distance); +} + +void test_OffsetCalculationNegativeOffset(void) { + struct pkt rpkt; + + rpkt.precision = -1; + rpkt.rootdelay = HTONS_FP(DTOUFP(0.5)); + rpkt.rootdisp = HTONS_FP(DTOUFP(0.5)); + // Synch Distance is (0.5+0.5)/2.0, or 0.5 + l_fp reftime; + get_systime(&reftime); + HTONL_FP(&reftime, &rpkt.reftime); + + l_fp tmp; + + // T1 - Originate timestamp + tmp.l_ui = 1000000001UL; + tmp.l_uf = 0UL; + HTONL_FP(&tmp, &rpkt.org); + + // T2 - Receive timestamp + tmp.l_ui = 1000000000UL; + tmp.l_uf = 2147483648UL; + HTONL_FP(&tmp, &rpkt.rec); + + // T3 - Transmit timestamp + tmp.l_ui = 1000000001UL; + tmp.l_uf = 2147483648UL; + HTONL_FP(&tmp, &rpkt.xmt); + + // T4 - Destination timestamp as standard timeval + tmp.l_ui = 1000000003UL; + tmp.l_uf = 0UL; + struct timeval dst; + TSTOTV(&tmp, &dst); + dst.tv_sec -= JAN_1970; + + double offset, precision, synch_distance; + offset_calculation(&rpkt, LEN_PKT_NOMAC, &dst, &offset, &precision, &synch_distance); + + TEST_ASSERT_EQUAL_FLOAT(-1, offset); + TEST_ASSERT_EQUAL_FLOAT(1. / ULOGTOD(1), precision); + TEST_ASSERT_EQUAL_FLOAT(1.3333483333333334, synch_distance); +} + +void test_HandleUnusableServer(void) { + struct pkt rpkt; + sockaddr_u host; + int rpktl; + + ZERO(rpkt); + ZERO(host); + rpktl = SERVER_UNUSEABLE; + TEST_ASSERT_EQUAL(-1, handle_pkt(rpktl, &rpkt, &host, "")); +} + +void test_HandleUnusablePacket(void) { + struct pkt rpkt; + sockaddr_u host; + int rpktl; + + ZERO(rpkt); + ZERO(host); + rpktl = PACKET_UNUSEABLE; + TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, "")); +} + +void test_HandleServerAuthenticationFailure(void) { + struct pkt rpkt; + sockaddr_u host; + int rpktl; + + ZERO(rpkt); + ZERO(host); + rpktl = SERVER_AUTH_FAIL; + TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, "")); +} + +void test_HandleKodDemobilize(void) { + const char * HOSTNAME = "192.0.2.1"; + const char * REASON = "DENY"; + struct pkt rpkt; + sockaddr_u host; + int rpktl; + struct kod_entry * entry; + + rpktl = KOD_DEMOBILIZE; + ZERO(rpkt); + memcpy(&rpkt.refid, REASON, 4); + ZERO(host); + host.sa4.sin_family = AF_INET; + host.sa4.sin_addr.s_addr = inet_addr(HOSTNAME); + + // Test that the KOD-entry is added to the database. + kod_init_kod_db("/dev/null", TRUE); + + TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, HOSTNAME)); + + TEST_ASSERT_EQUAL(1, search_entry(HOSTNAME, &entry)); + TEST_ASSERT_TRUE(memcmp(REASON, entry->type, 4) == 0); +} + +void test_HandleKodRate(void) { + struct pkt rpkt; + sockaddr_u host; + int rpktl; + + ZERO(rpkt); + ZERO(host); + rpktl = KOD_RATE; + TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, "")); +} + +void test_HandleCorrectPacket(void) { + struct pkt rpkt; + sockaddr_u host; + int rpktl; + l_fp now; + + // We don't want our testing code to actually change the system clock. + TEST_ASSERT_FALSE(ENABLED_OPT(STEP)); + TEST_ASSERT_FALSE(ENABLED_OPT(SLEW)); + + get_systime(&now); + HTONL_FP(&now, &rpkt.reftime); + HTONL_FP(&now, &rpkt.org); + HTONL_FP(&now, &rpkt.rec); + HTONL_FP(&now, &rpkt.xmt); + rpktl = LEN_PKT_NOMAC; + ZERO(host); + AF(&host) = AF_INET; + + TEST_ASSERT_EQUAL(0, handle_pkt(rpktl, &rpkt, &host, "")); +} + +/* packetHandling.c */ diff --git a/contrib/ntp/sntp/tests/packetProcessing.c b/contrib/ntp/sntp/tests/packetProcessing.c new file mode 100644 index 000000000000..27ab72e4d433 --- /dev/null +++ b/contrib/ntp/sntp/tests/packetProcessing.c @@ -0,0 +1,339 @@ +#include "config.h" +#include "sntptest.h" +#include "networking.h" +#include "ntp_stdlib.h" +#include "unity.h" + +const char * Version = "stub unit test Version string"; + +// Hacks into the key database. +extern struct key* key_ptr; +extern int key_cnt; + + +static struct pkt testpkt; +static struct pkt testspkt; +static sockaddr_u testsock; +bool restoreKeyDb; + +void PrepareAuthenticationTest(int key_id, + int key_len, + const char* type, + const void* key_seq) { + char str[25]; + sprintf(str, "%d", key_id); + ActivateOption("-a", str); + + key_cnt = 1; + key_ptr = malloc(sizeof(struct key)); + key_ptr->next = NULL; + key_ptr->key_id = key_id; + key_ptr->key_len = key_len; + memcpy(key_ptr->type, "MD5", 3); + + TEST_ASSERT_TRUE(key_len < sizeof(key_ptr->key_seq)); + + memcpy(key_ptr->key_seq, key_seq, key_ptr->key_len); + restoreKeyDb = true; +} + +void PrepareAuthenticationTestMD5(int key_id, + int key_len, + const void* key_seq) { + PrepareAuthenticationTest(key_id, key_len, "MD5", key_seq); +} + +void setUp() { + + sntptest(); + restoreKeyDb = false; + + /* Initialize the test packet and socket, + * so they contain at least some valid data. */ + testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, NTP_VERSION, + MODE_SERVER); + testpkt.stratum = STRATUM_REFCLOCK; + memcpy(&testpkt.refid, "GPS\0", 4); + + /* Set the origin timestamp of the received packet to the + * same value as the transmit timestamp of the sent packet. */ + l_fp tmp; + tmp.l_ui = 1000UL; + tmp.l_uf = 0UL; + + HTONL_FP(&tmp, &testpkt.org); + HTONL_FP(&tmp, &testspkt.xmt); + +} + +void tearDown() { + + if (restoreKeyDb) { + key_cnt = 0; + free(key_ptr); + key_ptr = NULL; + } + + sntptest_destroy(); //only on the final test!! if counter == 0 etc... + +} + + + +void test_TooShortLength(void) { + TEST_ASSERT_EQUAL(PACKET_UNUSEABLE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1, + MODE_SERVER, &testspkt, "UnitTest")); + TEST_ASSERT_EQUAL(PACKET_UNUSEABLE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1, + MODE_BROADCAST, &testspkt, "UnitTest")); +} + +void test_LengthNotMultipleOfFour(void) { + TEST_ASSERT_EQUAL(PACKET_UNUSEABLE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 6, + MODE_SERVER, &testspkt, "UnitTest")); + TEST_ASSERT_EQUAL(PACKET_UNUSEABLE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 3, + MODE_BROADCAST, &testspkt, "UnitTest")); +} + +void test_TooShortExtensionFieldLength(void) { + /* The lower 16-bits are the length of the extension field. + * This lengths must be multiples of 4 bytes, which gives + * a minimum of 4 byte extension field length. */ + testpkt.exten[7] = htonl(3); // 3 bytes is too short. + + /* We send in a pkt_len of header size + 4 byte extension + * header + 24 byte MAC, this prevents the length error to + * be caught at an earlier stage */ + int pkt_len = LEN_PKT_NOMAC + 4 + 24; + + TEST_ASSERT_EQUAL(PACKET_UNUSEABLE, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_UnauthenticatedPacketReject(void) { + //sntptest(); + // Activate authentication option + ActivateOption("-a", "123"); + TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION)); + + int pkt_len = LEN_PKT_NOMAC; + + // We demand authentication, but no MAC header is present. + TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_CryptoNAKPacketReject(void) { + // Activate authentication option + ActivateOption("-a", "123"); + TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION)); + + int pkt_len = LEN_PKT_NOMAC + 4; // + 4 byte MAC = Crypto-NAK + + TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_AuthenticatedPacketInvalid(void) { + // Activate authentication option + PrepareAuthenticationTestMD5(50, 9, "123456789"); + TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION)); + + // Prepare the packet. + int pkt_len = LEN_PKT_NOMAC; + + testpkt.exten[0] = htonl(50); + int mac_len = make_mac((char*)&testpkt, pkt_len, + MAX_MD5_LEN, key_ptr, + (char*)&testpkt.exten[1]); + + pkt_len += 4 + mac_len; + + // Now, alter the MAC so it becomes invalid. + testpkt.exten[1] += 1; + + TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_AuthenticatedPacketUnknownKey(void) { + // Activate authentication option + PrepareAuthenticationTestMD5(30, 9, "123456789"); + TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION)); + + // Prepare the packet. Observe that the Key-ID expected is 30, + // but the packet has a key id of 50. + int pkt_len = LEN_PKT_NOMAC; + + testpkt.exten[0] = htonl(50); + int mac_len = make_mac((char*)&testpkt, pkt_len, + MAX_MD5_LEN, key_ptr, + (char*)&testpkt.exten[1]); + pkt_len += 4 + mac_len; + + TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_ServerVersionTooOld(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, + NTP_OLDVERSION - 1, + MODE_CLIENT); + TEST_ASSERT_TRUE(PKT_VERSION(testpkt.li_vn_mode) < NTP_OLDVERSION); + + int pkt_len = LEN_PKT_NOMAC; + + TEST_ASSERT_EQUAL(SERVER_UNUSEABLE, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_ServerVersionTooNew(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, + NTP_VERSION + 1, + MODE_CLIENT); + TEST_ASSERT_TRUE(PKT_VERSION(testpkt.li_vn_mode) > NTP_VERSION); + + int pkt_len = LEN_PKT_NOMAC; + + TEST_ASSERT_EQUAL(SERVER_UNUSEABLE, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_NonWantedMode(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, + NTP_VERSION, + MODE_CLIENT); + + // The packet has a mode of MODE_CLIENT, but process_pkt expects MODE_SERVER + + TEST_ASSERT_EQUAL(SERVER_UNUSEABLE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC, + MODE_SERVER, &testspkt, "UnitTest")); +} + +/* Tests bug 1597 */ +void test_KoDRate(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + testpkt.stratum = STRATUM_PKT_UNSPEC; + memcpy(&testpkt.refid, "RATE", 4); + + TEST_ASSERT_EQUAL(KOD_RATE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_KoDDeny(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + testpkt.stratum = STRATUM_PKT_UNSPEC; + memcpy(&testpkt.refid, "DENY", 4); + + TEST_ASSERT_EQUAL(KOD_DEMOBILIZE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_RejectUnsyncedServer(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC, + NTP_VERSION, + MODE_SERVER); + + TEST_ASSERT_EQUAL(SERVER_UNUSEABLE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_RejectWrongResponseServerMode(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + l_fp tmp; + tmp.l_ui = 1000UL; + tmp.l_uf = 0UL; + HTONL_FP(&tmp, &testpkt.org); + + tmp.l_ui = 2000UL; + tmp.l_uf = 0UL; + HTONL_FP(&tmp, &testspkt.xmt); + + TEST_ASSERT_EQUAL(PACKET_UNUSEABLE, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_AcceptNoSentPacketBroadcastMode(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, + NTP_VERSION, + MODE_BROADCAST); + + TEST_ASSERT_EQUAL(LEN_PKT_NOMAC, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC, + MODE_BROADCAST, NULL, "UnitTest")); +} + +void test_CorrectUnauthenticatedPacket(void) { + TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION)); + + TEST_ASSERT_EQUAL(LEN_PKT_NOMAC, + process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC, + MODE_SERVER, &testspkt, "UnitTest")); +} + +void test_CorrectAuthenticatedPacketMD5(void) { + PrepareAuthenticationTestMD5(10, 15, "123456789abcdef"); + TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION)); + + int pkt_len = LEN_PKT_NOMAC; + + // Prepare the packet. + testpkt.exten[0] = htonl(10); + int mac_len = make_mac((char*)&testpkt, pkt_len, + MAX_MD5_LEN, key_ptr, + (char*)&testpkt.exten[1]); + + pkt_len += 4 + mac_len; + + TEST_ASSERT_EQUAL(pkt_len, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); + +} + +void test_CorrectAuthenticatedPacketSHA1(void) { + PrepareAuthenticationTest(20, 15, "SHA1", "abcdefghijklmno"); + TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION)); + + int pkt_len = LEN_PKT_NOMAC; + + // Prepare the packet. + testpkt.exten[0] = htonl(20); + int mac_len = make_mac((char*)&testpkt, pkt_len, + MAX_MAC_LEN, key_ptr, + (char*)&testpkt.exten[1]); + + pkt_len += 4 + mac_len; + + TEST_ASSERT_EQUAL(pkt_len, + process_pkt(&testpkt, &testsock, pkt_len, + MODE_SERVER, &testspkt, "UnitTest")); +} diff --git a/contrib/ntp/sntp/tests/run-crypto.c b/contrib/ntp/sntp/tests/run-crypto.c new file mode 100644 index 000000000000..c5dbaf64dfb5 --- /dev/null +++ b/contrib/ntp/sntp/tests/run-crypto.c @@ -0,0 +1,62 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include <setjmp.h> +#include <stdio.h> + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +void resetTest(void); +extern void test_MakeMd5Mac(void); +extern void test_MakeSHA1Mac(void); +extern void test_VerifyCorrectMD5(void); +extern void test_VerifySHA1(void); +extern void test_VerifyFailure(void); +extern void test_PacketSizeNotMultipleOfFourBytes(void); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "crypto.c"; + UnityBegin("crypto.c"); + RUN_TEST(test_MakeMd5Mac, 11); + RUN_TEST(test_MakeSHA1Mac, 33); + RUN_TEST(test_VerifyCorrectMD5, 59); + RUN_TEST(test_VerifySHA1, 78); + RUN_TEST(test_VerifyFailure, 100); + RUN_TEST(test_PacketSizeNotMultipleOfFourBytes, 120); + + return (UnityEnd()); +} diff --git a/contrib/ntp/sntp/tests/run-keyFile.c b/contrib/ntp/sntp/tests/run-keyFile.c new file mode 100644 index 000000000000..0a6380d33b35 --- /dev/null +++ b/contrib/ntp/sntp/tests/run-keyFile.c @@ -0,0 +1,59 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include <setjmp.h> +#include <stdio.h> + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +extern void test_ReadEmptyKeyFile(); +extern void test_ReadASCIIKeys(); +extern void test_ReadHexKeys(); +extern void test_ReadKeyFileWithComments(); +extern void test_ReadKeyFileWithInvalidHex(); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "keyFile.c"; + UnityBegin("keyFile.c"); + RUN_TEST(test_ReadEmptyKeyFile, 53); + RUN_TEST(test_ReadASCIIKeys, 61); + RUN_TEST(test_ReadHexKeys, 79); + RUN_TEST(test_ReadKeyFileWithComments, 105); + RUN_TEST(test_ReadKeyFileWithInvalidHex, 124); + + return (UnityEnd()); +} diff --git a/contrib/ntp/sntp/tests/run-kodDatabase.c b/contrib/ntp/sntp/tests/run-kodDatabase.c new file mode 100644 index 000000000000..7fc96783e43b --- /dev/null +++ b/contrib/ntp/sntp/tests/run-kodDatabase.c @@ -0,0 +1,59 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include <setjmp.h> +#include <stdio.h> + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +extern void test_SingleEntryHandling(); +extern void test_MultipleEntryHandling(); +extern void test_NoMatchInSearch(); +extern void test_AddDuplicate(); +extern void test_DeleteEntry(); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "kodDatabase.c"; + UnityBegin("kodDatabase.c"); + RUN_TEST(test_SingleEntryHandling, 22); + RUN_TEST(test_MultipleEntryHandling, 35); + RUN_TEST(test_NoMatchInSearch, 66); + RUN_TEST(test_AddDuplicate, 79); + RUN_TEST(test_DeleteEntry, 104); + + return (UnityEnd()); +} diff --git a/contrib/ntp/sntp/tests/run-kodFile.c b/contrib/ntp/sntp/tests/run-kodFile.c new file mode 100644 index 000000000000..9c5896263ee0 --- /dev/null +++ b/contrib/ntp/sntp/tests/run-kodFile.c @@ -0,0 +1,61 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include <setjmp.h> +#include <stdio.h> + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +extern void test_ReadEmptyFile(); +extern void test_ReadCorrectFile(); +extern void test_ReadFileWithBlankLines(); +extern void test_WriteEmptyFile(); +extern void test_WriteFileWithSingleEntry(); +extern void test_WriteFileWithMultipleEntries(); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "kodFile.c"; + UnityBegin("kodFile.c"); + RUN_TEST(test_ReadEmptyFile, 29); + RUN_TEST(test_ReadCorrectFile, 35); + RUN_TEST(test_ReadFileWithBlankLines, 53); + RUN_TEST(test_WriteEmptyFile, 76); + RUN_TEST(test_WriteFileWithSingleEntry, 92); + RUN_TEST(test_WriteFileWithMultipleEntries, 116); + + return (UnityEnd()); +} diff --git a/contrib/ntp/sntp/tests/run-networking.c b/contrib/ntp/sntp/tests/run-networking.c new file mode 100644 index 000000000000..d5e822c719eb --- /dev/null +++ b/contrib/ntp/sntp/tests/run-networking.c @@ -0,0 +1,49 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include <setjmp.h> +#include <stdio.h> + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "networking.c"; + UnityBegin("networking.c"); + + return (UnityEnd()); +} diff --git a/contrib/ntp/sntp/tests/run-packetHandling.c b/contrib/ntp/sntp/tests/run-packetHandling.c new file mode 100644 index 000000000000..69e958e4c15c --- /dev/null +++ b/contrib/ntp/sntp/tests/run-packetHandling.c @@ -0,0 +1,70 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include <setjmp.h> +#include <stdio.h> + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +void resetTest(void); +extern void test_GenerateUnauthenticatedPacket(void); +extern void test_GenerateAuthenticatedPacket(void); +extern void test_OffsetCalculationPositiveOffset(void); +extern void test_OffsetCalculationNegativeOffset(void); +extern void test_HandleUnusableServer(void); +extern void test_HandleUnusablePacket(void); +extern void test_HandleServerAuthenticationFailure(void); +extern void test_HandleKodDemobilize(void); +extern void test_HandleKodRate(void); +extern void test_HandleCorrectPacket(void); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "packetHandling.c"; + UnityBegin("packetHandling.c"); + RUN_TEST(test_GenerateUnauthenticatedPacket, 35); + RUN_TEST(test_GenerateAuthenticatedPacket, 58); + RUN_TEST(test_OffsetCalculationPositiveOffset, 97); + RUN_TEST(test_OffsetCalculationNegativeOffset, 141); + RUN_TEST(test_HandleUnusableServer, 184); + RUN_TEST(test_HandleUnusablePacket, 195); + RUN_TEST(test_HandleServerAuthenticationFailure, 206); + RUN_TEST(test_HandleKodDemobilize, 217); + RUN_TEST(test_HandleKodRate, 241); + RUN_TEST(test_HandleCorrectPacket, 252); + + return (UnityEnd()); +} diff --git a/contrib/ntp/sntp/tests/run-packetProcessing.c b/contrib/ntp/sntp/tests/run-packetProcessing.c new file mode 100644 index 000000000000..f41d5c7eb2f0 --- /dev/null +++ b/contrib/ntp/sntp/tests/run-packetProcessing.c @@ -0,0 +1,86 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include <setjmp.h> +#include <stdio.h> + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +void resetTest(void); +extern void test_TooShortLength(void); +extern void test_LengthNotMultipleOfFour(void); +extern void test_TooShortExtensionFieldLength(void); +extern void test_UnauthenticatedPacketReject(void); +extern void test_CryptoNAKPacketReject(void); +extern void test_AuthenticatedPacketInvalid(void); +extern void test_AuthenticatedPacketUnknownKey(void); +extern void test_ServerVersionTooOld(void); +extern void test_ServerVersionTooNew(void); +extern void test_NonWantedMode(void); +extern void test_KoDRate(void); +extern void test_KoDDeny(void); +extern void test_RejectUnsyncedServer(void); +extern void test_RejectWrongResponseServerMode(void); +extern void test_AcceptNoSentPacketBroadcastMode(void); +extern void test_CorrectUnauthenticatedPacket(void); +extern void test_CorrectAuthenticatedPacketMD5(void); +extern void test_CorrectAuthenticatedPacketSHA1(void); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "packetProcessing.c"; + UnityBegin("packetProcessing.c"); + RUN_TEST(test_TooShortLength, 83); + RUN_TEST(test_LengthNotMultipleOfFour, 92); + RUN_TEST(test_TooShortExtensionFieldLength, 101); + RUN_TEST(test_UnauthenticatedPacketReject, 117); + RUN_TEST(test_CryptoNAKPacketReject, 131); + RUN_TEST(test_AuthenticatedPacketInvalid, 143); + RUN_TEST(test_AuthenticatedPacketUnknownKey, 166); + RUN_TEST(test_ServerVersionTooOld, 186); + RUN_TEST(test_ServerVersionTooNew, 201); + RUN_TEST(test_NonWantedMode, 216); + RUN_TEST(test_KoDRate, 231); + RUN_TEST(test_KoDDeny, 242); + RUN_TEST(test_RejectUnsyncedServer, 253); + RUN_TEST(test_RejectWrongResponseServerMode, 265); + RUN_TEST(test_AcceptNoSentPacketBroadcastMode, 282); + RUN_TEST(test_CorrectUnauthenticatedPacket, 294); + RUN_TEST(test_CorrectAuthenticatedPacketMD5, 302); + RUN_TEST(test_CorrectAuthenticatedPacketSHA1, 322); + + return (UnityEnd()); +} diff --git a/contrib/ntp/sntp/tests/run-utilities.c b/contrib/ntp/sntp/tests/run-utilities.c new file mode 100644 index 000000000000..715bd110c2d4 --- /dev/null +++ b/contrib/ntp/sntp/tests/run-utilities.c @@ -0,0 +1,64 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include <setjmp.h> +#include <stdio.h> + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +void resetTest(void); +extern void test_IPv4Address(); +extern void test_IPv6Address(); +extern void test_SetLiVnMode1(); +extern void test_SetLiVnMode2(); +extern void test_PktOutput(); +extern void test_LfpOutputBinaryFormat(); +extern void test_LfpOutputDecimalFormat(); + + +//=======Test Reset Option===== +void resetTest() +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + Unity.TestFile = "utilities.c"; + UnityBegin("utilities.c"); + RUN_TEST(test_IPv4Address, 68); + RUN_TEST(test_IPv6Address, 78); + RUN_TEST(test_SetLiVnMode1, 98); + RUN_TEST(test_SetLiVnMode2, 111); + RUN_TEST(test_PktOutput, 126); + RUN_TEST(test_LfpOutputBinaryFormat, 146); + RUN_TEST(test_LfpOutputDecimalFormat, 162); + + return (UnityEnd()); +} diff --git a/contrib/ntp/sntp/tests/sntptest.h b/contrib/ntp/sntp/tests/sntptest.h index d5add9cbf465..eff6f6e99dcb 100644 --- a/contrib/ntp/sntp/tests/sntptest.h +++ b/contrib/ntp/sntp/tests/sntptest.h @@ -1,35 +1,31 @@ #ifndef SNTPTEST_H #define SNTPTEST_H -#include "tests_main.h" - -extern "C" { #include "ntp_stdlib.h" #include "sntp-opts.h" -}; - -class sntptest : public ntptest { -protected: - sntptest() { - optionSaveState(&sntpOptions); - } - - ~sntptest() { - optionRestore(&sntpOptions); - } - - void ActivateOption(const char* option, const char* argument) { - const int ARGV_SIZE = 4; - - char* opts[ARGV_SIZE]; - - opts[0] = estrdup("sntpopts"); - opts[1] = estrdup(option); - opts[2] = estrdup(argument); - opts[3] = estrdup("127.0.0.1"); - - optionProcess(&sntpOptions, ARGV_SIZE, opts); - } -}; + + +sntptest() { + optionSaveState(&sntpOptions); +} + +sntptest_destroy() { + optionRestore(&sntpOptions); +} + +void ActivateOption(const char* option, const char* argument) { + + const int ARGV_SIZE = 4; + + char* opts[ARGV_SIZE]; + + opts[0] = estrdup("sntpopts"); + opts[1] = estrdup(option); + opts[2] = estrdup(argument); + opts[3] = estrdup("127.0.0.1"); + + optionProcess(&sntpOptions, ARGV_SIZE, opts); +} + #endif // SNTPTEST_H diff --git a/contrib/ntp/sntp/tests/utilities.c b/contrib/ntp/sntp/tests/utilities.c new file mode 100644 index 000000000000..65be8df9d8e9 --- /dev/null +++ b/contrib/ntp/sntp/tests/utilities.c @@ -0,0 +1,177 @@ +#include "config.h" + +#include "sntptest.h" +#include "fileHandlingTest.h" + +#include "main.h" +#include "utilities.h" +#include "math.h" + +#include "unity.h" + +const char * Version = "stub unit test Version string"; + + + +sockaddr_u CreateSockaddr4(const char* address) { + sockaddr_u s; + s.sa4.sin_family = AF_INET; + s.sa4.sin_addr.s_addr = inet_addr(address); + SET_PORT(&s, 123); + + return s; +} + +struct addrinfo CreateAddrinfo( sockaddr_u* sock) { + struct addrinfo a; + a.ai_family = sock->sa.sa_family; + a.ai_addrlen = SIZEOF_SOCKADDR(a.ai_family); + a.ai_addr = &sock->sa; + return a; +} + + +bool outputFileOpened; +FILE* outputFile; + +//debugUtilitiesTest() : outputFileOpened(false) {} + +void InitDebugTest(const char * filename) { + // Clear the contents of the current file. + // Open the output file + outputFile = fopen(filename, "w+"); + TEST_ASSERT_TRUE(outputFile != NULL); + outputFileOpened = true; +} + +// Closes outputFile, and compare contents. +void FinishDebugTest(const char * expected, + const char * actual) { + if (outputFileOpened) + fclose(outputFile); + + FILE * e = fopen(expected,"rb"); + FILE * a = fopen(actual,"rb"); + TEST_ASSERT_TRUE(e != NULL); + TEST_ASSERT_TRUE(a != NULL); + + CompareFileContent(e, a); +} + + +/* + * These tests are essentially a copy of the tests for socktoa() + * in libntp. If sntp switches to using that functions, these + * tests can be removed. + */ + +void test_IPv4Address() { + const char* ADDR = "192.0.2.10"; + + sockaddr_u input = CreateSockaddr4(ADDR); + struct addrinfo inputA = CreateAddrinfo(&input); + + TEST_ASSERT_EQUAL_STRING(ADDR, ss_to_str(&input)); + TEST_ASSERT_EQUAL_STRING(ADDR, addrinfo_to_str(&inputA)); +} + +void test_IPv6Address() { + const struct in6_addr address = { + 0x20, 0x01, 0x0d, 0xb8, + 0x85, 0xa3, 0x08, 0xd3, + 0x13, 0x19, 0x8a, 0x2e, + 0x03, 0x70, 0x73, 0x34 + }; + const char * expected = "2001:db8:85a3:8d3:1319:8a2e:370:7334"; + sockaddr_u input; + struct addrinfo inputA; + + memset(&input, 0, sizeof(input)); + input.sa6.sin6_family = AF_INET6; + input.sa6.sin6_addr = address; + TEST_ASSERT_EQUAL_STRING(expected, ss_to_str(&input)); + + inputA = CreateAddrinfo(&input); + TEST_ASSERT_EQUAL_STRING(expected, addrinfo_to_str(&inputA)); +} + +void test_SetLiVnMode1() { + struct pkt expected; + expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, + NTP_VERSION, + MODE_SERVER); + + struct pkt actual; + set_li_vn_mode(&actual, LEAP_NOWARNING, NTP_VERSION, + MODE_SERVER); + + TEST_ASSERT_EQUAL(expected.li_vn_mode, actual.li_vn_mode); +} + +void test_SetLiVnMode2() { + struct pkt expected; + expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC, + NTP_OLDVERSION, + MODE_BROADCAST); + + struct pkt actual; + set_li_vn_mode(&actual, LEAP_NOTINSYNC, NTP_OLDVERSION, + MODE_BROADCAST); + + TEST_ASSERT_EQUAL(expected.li_vn_mode, actual.li_vn_mode); +} + +/* Debug utilities tests */ + +void test_PktOutput() { + char * filename = "debug-output-pkt";//CreatePath("debug-output-pkt", OUTPUT_DIR); + InitDebugTest(filename); + + struct pkt testpkt; + memset(&testpkt, 0, sizeof(struct pkt)); + testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, + NTP_VERSION, + MODE_SERVER); + + l_fp test; + test.l_ui = 8; + test.l_uf = 2147483647; // Lots of ones. + HTONL_FP(&test, &testpkt.xmt); + + pkt_output(&testpkt, LEN_PKT_NOMAC, outputFile); + + FinishDebugTest(CreatePath("debug-input-pkt", INPUT_DIR), filename); +} + +void test_LfpOutputBinaryFormat() { + char * filename = "debug-output-lfp-bin";//CreatePath("debug-output-lfp-bin", OUTPUT_DIR); + InitDebugTest(filename); + + l_fp test; + test.l_ui = 63; // 00000000 00000000 00000000 00111111 + test.l_uf = 127; // 00000000 00000000 00000000 01111111 + + l_fp network; + HTONL_FP(&test, &network); + + l_fp_output_bin(&network, outputFile); + + FinishDebugTest(CreatePath("debug-input-lfp-bin", INPUT_DIR), filename); +} + +void test_LfpOutputDecimalFormat() { + char * filename = "debug-output-lfp-dec"; //CreatePath("debug-output-lfp-dec", OUTPUT_DIR); + InitDebugTest(filename); + + l_fp test; + test.l_ui = 6310; // 0x000018A6 + test.l_uf = 308502; // 0x00004B516 + + l_fp network; + HTONL_FP(&test, &network); + + l_fp_output_dec(&network, outputFile); + + FinishDebugTest(CreatePath("debug-input-lfp-dec", INPUT_DIR), filename); +} + diff --git a/contrib/ntp/sntp/tests/utilities.cpp b/contrib/ntp/sntp/tests/utilities.cpp deleted file mode 100644 index 4c8c30535064..000000000000 --- a/contrib/ntp/sntp/tests/utilities.cpp +++ /dev/null @@ -1,176 +0,0 @@ -#include "sntptest.h" -#include "fileHandlingTest.h" - -extern "C" { -#include "main.h" -#include "utilities.h" -const char * Version = "stub unit test Version string"; -}; - -using std::string; - -class utilitiesTest : public sntptest { -protected: - sockaddr_u CreateSockaddr4(const char* address) { - sockaddr_u s; - s.sa4.sin_family = AF_INET; - s.sa4.sin_addr.s_addr = inet_addr(address); - SET_PORT(&s, 123); - - return s; - } - - addrinfo CreateAddrinfo(sockaddr_u* sock) { - addrinfo a; - a.ai_family = sock->sa.sa_family; - a.ai_addrlen = SIZEOF_SOCKADDR(a.ai_family); - a.ai_addr = &sock->sa; - return a; - } -}; - -class debugUtilitiesTest : public fileHandlingTest { -protected: - bool outputFileOpened; - FILE* outputFile; - - debugUtilitiesTest() : outputFileOpened(false) {} - - void InitDebugTest(const string& filename) { - // Clear the contents of the current file. - // Open the output file - outputFile = fopen(filename.c_str(), "w+"); - ASSERT_TRUE(outputFile != NULL); - outputFileOpened = true; - } - - // Closes outputFile, and compare contents. - void FinishDebugTest(const string& expected, - const string& actual) { - if (outputFileOpened) - fclose(outputFile); - - ifstream e(expected.c_str()); - ifstream a(actual.c_str()); - ASSERT_TRUE(e.good()); - ASSERT_TRUE(a.good()); - - CompareFileContent(e, a); - } -}; - -/* - * These tests are essentially a copy of the tests for socktoa() - * in libntp. If sntp switches to using that functions, these - * tests can be removed. - */ - -TEST_F(utilitiesTest, IPv4Address) { - const char* ADDR = "192.0.2.10"; - - sockaddr_u input = CreateSockaddr4(ADDR); - addrinfo inputA = CreateAddrinfo(&input); - - EXPECT_STREQ(ADDR, ss_to_str(&input)); - EXPECT_STREQ(ADDR, addrinfo_to_str(&inputA)); -} - -TEST_F(utilitiesTest, IPv6Address) { - const struct in6_addr address = { - 0x20, 0x01, 0x0d, 0xb8, - 0x85, 0xa3, 0x08, 0xd3, - 0x13, 0x19, 0x8a, 0x2e, - 0x03, 0x70, 0x73, 0x34 - }; - const char * expected = "2001:db8:85a3:8d3:1319:8a2e:370:7334"; - sockaddr_u input; - addrinfo inputA; - - memset(&input, 0, sizeof(input)); - input.sa6.sin6_family = AF_INET6; - input.sa6.sin6_addr = address; - EXPECT_STREQ(expected, ss_to_str(&input)); - - inputA = CreateAddrinfo(&input); - EXPECT_STREQ(expected, addrinfo_to_str(&inputA)); -} - -TEST_F(utilitiesTest, SetLiVnMode1) { - pkt expected; - expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, - NTP_VERSION, - MODE_SERVER); - - pkt actual; - set_li_vn_mode(&actual, LEAP_NOWARNING, NTP_VERSION, - MODE_SERVER); - - EXPECT_EQ(expected.li_vn_mode, actual.li_vn_mode); -} - -TEST_F(utilitiesTest, SetLiVnMode2) { - pkt expected; - expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC, - NTP_OLDVERSION, - MODE_BROADCAST); - - pkt actual; - set_li_vn_mode(&actual, LEAP_NOTINSYNC, NTP_OLDVERSION, - MODE_BROADCAST); - - EXPECT_EQ(expected.li_vn_mode, actual.li_vn_mode); -} - -/* Debug utilities tests */ - -TEST_F(debugUtilitiesTest, PktOutput) { - string filename = CreatePath("debug-output-pkt", OUTPUT_DIR); - InitDebugTest(filename); - - pkt testpkt; - memset(&testpkt, 0, sizeof(pkt)); - testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, - NTP_VERSION, - MODE_SERVER); - - l_fp test; - test.l_ui = 8; - test.l_uf = 2147483647; // Lots of ones. - HTONL_FP(&test, &testpkt.xmt); - - pkt_output(&testpkt, LEN_PKT_NOMAC, outputFile); - - FinishDebugTest(CreatePath("debug-input-pkt", INPUT_DIR), filename); -} - -TEST_F(debugUtilitiesTest, LfpOutputBinaryFormat) { - string filename = CreatePath("debug-output-lfp-bin", OUTPUT_DIR); - InitDebugTest(filename); - - l_fp test; - test.l_ui = 63; // 00000000 00000000 00000000 00111111 - test.l_uf = 127; // 00000000 00000000 00000000 01111111 - - l_fp network; - HTONL_FP(&test, &network); - - l_fp_output_bin(&network, outputFile); - - FinishDebugTest(CreatePath("debug-input-lfp-bin", INPUT_DIR), filename); -} - -TEST_F(debugUtilitiesTest, LfpOutputDecimalFormat) { - string filename = CreatePath("debug-output-lfp-dec", OUTPUT_DIR); - InitDebugTest(filename); - - l_fp test; - test.l_ui = 6310; // 0x000018A6 - test.l_uf = 308502; // 0x00004B516 - - l_fp network; - HTONL_FP(&test, &network); - - l_fp_output_dec(&network, outputFile); - - FinishDebugTest(CreatePath("debug-input-lfp-dec", INPUT_DIR), filename); -} |