--- Makefile.am.orig 2016-01-22 18:12:28 UTC +++ Makefile.am @@ -197,35 +197,16 @@ endif # TESTAPP if UNIT_TEST TESTS = test/unit_test -check_LTLIBRARIES = test/libmusl_m.la check_PROGRAMS = test/unit_test -test_libmusl_m_la_CFLAGS = $(AM_CFLAGS) -Wno-sign-compare -Wno-unused-variable -Wno-unused-but-set-variable - -test_libmusl_m_la_SOURCES = test/extra/musl-libm/__cos.c \ - test/extra/musl-libm/__rem_pio2.c \ - test/extra/musl-libm/__rem_pio2_large.c \ - test/extra/musl-libm/__sin.c \ - test/extra/musl-libm/cos.c \ - test/extra/musl-libm/fpu_wrapper.c \ - test/extra/musl-libm/libm.h \ - test/extra/musl-libm/mymath.h \ - test/extra/musl-libm/pow.c \ - test/extra/musl-libm/powf.c \ - test/extra/musl-libm/sin.c - test_unit_test_CPPFLAGS = -I$(srcdir)/src/zimg \ -I$(srcdir)/test \ - -I$(srcdir)/test/extra \ - -I$(srcdir)/test/extra/googletest/googletest/include + -I$(srcdir)/test/extra test_unit_test_SOURCES = test/main.cpp \ test/colorspace/colorspace_test.cpp \ test/depth/depth_convert_test.cpp \ test/depth/dither_test.cpp \ - test/extra/sha1/config.h \ - test/extra/sha1/sha1.c \ - test/extra/sha1/sha1.h \ test/graph/audit_buffer.cpp \ test/graph/audit_buffer.h \ test/graph/basic_filter_test.cpp \ @@ -247,7 +228,6 @@ test_unit_test_SOURCES += test/colorspac endif #X86SIMD -test_unit_test_LDADD = test/extra/googletest/googletest/lib/libgtest.la \ - test/libmusl_m.la \ +test_unit_test_LDADD = -lgtest -lmd -lpthread \ libzimg.la endif # UNIT_TEST --- configure.ac.orig 2016-01-22 18:12:28 UTC +++ configure.ac @@ -29,8 +29,6 @@ AS_IF([test "x$enable_unit_test" = "xyes [x86_64], [], [AC_MSG_WARN([Could not determine how to enable IEEE-754 compliance on host. Tests may fail.])] ) - AC_CONFIG_SUBDIRS(test/extra/googletest/googletest) - AC_SUBST([CONFIG_SUBDIRS], [test/extra/googletest/googletest]) ], ) --- test/graph/filter_validator.cpp.orig 2016-01-22 18:12:28 UTC +++ test/graph/filter_validator.cpp @@ -13,7 +13,7 @@ #include "gtest/gtest.h" extern "C" { - #include "sha1/sha1.h" + #include } #include "audit_buffer.h" @@ -35,14 +35,14 @@ void hash_buffer(const AuditBuffer &b auto image_buffer = buf.as_read_buffer(); SHA1_CTX sha_ctx; - SHA1Init(&sha_ctx); + SHA1_Init(&sha_ctx); for (unsigned i = 0; i < height; ++i) { const unsigned char *ptr = zimg::graph::static_buffer_cast(image_buffer[p])[i]; - SHA1Update(&sha_ctx, ptr, width * sizeof(T)); + SHA1_Update(&sha_ctx, ptr, width * sizeof(T)); } - SHA1Final(digest, &sha_ctx); + SHA1_Final(digest, &sha_ctx); } std::string hash_to_str(const unsigned char digest[20]) --- test/main.cpp.orig 2016-01-22 18:12:28 UTC +++ test/main.cpp @@ -3,22 +3,11 @@ #include "common/libm_wrapper.h" #include "gtest/gtest.h" -#include "musl-libm/mymath.h" - -void wrap_libm() -{ - _zimg_sin = mysin; - _zimg_cos = mycos; - _zimg_pow = mypow; - _zimg_powf = mypowf; -} int main(int argc, char **argv) { int ret; - wrap_libm(); - ::testing::InitGoogleTest(&argc, argv); ret = RUN_ALL_TESTS();