From 2e39db661b2fef134f317bd1e1e038f1d3146624 Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Tue, 14 Mar 2017 00:32:16 -0700 Subject: [PATCH 1/2] Comment out a known-problematic assert in zdeflate.cpp (though I haven't actually seen it fail in OST). Later versions of Crypto++ comment out or remove this line, so this seems reasonable to do until I can figure out how to update the whole library --- src/cryptlib/zdeflate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptlib/zdeflate.cpp b/src/cryptlib/zdeflate.cpp index 8a4302a..60d74e3 100644 --- a/src/cryptlib/zdeflate.cpp +++ b/src/cryptlib/zdeflate.cpp @@ -236,7 +236,7 @@ int Deflator::longest_match(IPos cur_match) if (prev_length >= good_match) { chain_length >>= 2; } - assert(strstart <= (unsigned)WINDOW_SIZE-MIN_LOOKAHEAD); + //assert(strstart <= (unsigned)WINDOW_SIZE-MIN_LOOKAHEAD); do { assert(cur_match < strstart); From 062523a60e2a13a12cad1fd031885375c029a920 Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Tue, 14 Mar 2017 01:23:23 -0700 Subject: [PATCH 2/2] Add a working 'make check' target, which runs both the test suite in src/test-harness, and all the twtest unit tests; update unit test binary to return standard success/fail values, to keep make happy --- Makefile.am | 5 +++++ Makefile.in | 5 +++++ src/twtest/test.cpp | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 097fe7c..e72b1ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,3 +11,8 @@ install-data-hook: uninstall-hook: rm -f ${prefix}/sbin/tripwire $(prefix)/sbin/twadmin $(prefix)/sbin/twprint $(prefix)/sbin/siggen rm -Rf $(prefix)/doc + +check: + rm -Rf $(top_srcdir)/src/test-harness/twtest + cd $(top_srcdir)/src/test-harness && ./twtest.pl + $(top_srcdir)/bin/twtest all diff --git a/Makefile.in b/Makefile.in index 4c462b6..5586cce 100644 --- a/Makefile.in +++ b/Makefile.in @@ -808,6 +808,11 @@ uninstall-hook: rm -f ${prefix}/sbin/tripwire $(prefix)/sbin/twadmin $(prefix)/sbin/twprint $(prefix)/sbin/siggen rm -Rf $(prefix)/doc +check: + rm -Rf $(top_srcdir)/src/test-harness/twtest + cd $(top_srcdir)/src/test-harness && ./twtest.pl + $(top_srcdir)/bin/twtest all + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/src/twtest/test.cpp b/src/twtest/test.cpp index c77e7ff..4bdc1df 100644 --- a/src/twtest/test.cpp +++ b/src/twtest/test.cpp @@ -316,11 +316,13 @@ int _tmain(int argc, TCHAR** argv) { cTWUtil::PrintErrorMsg(error); ASSERT(false); + return 1; } catch (...) { TCERR << _T("Unhandled exception caught!"); ASSERT(false); + return 1; } // make sure all the refrence counted objects have been destroyed @@ -329,7 +331,9 @@ int _tmain(int argc, TCHAR** argv) // force user to hit - return 1; + std::cout << std::endl << "Tests completed" << std::endl; + + return 0; }