diff options
author | Hubert Figuière <hub@figuiere.net> | 2017-01-09 19:36:31 -0500 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2017-01-09 19:36:48 -0500 |
commit | f2f285318b37f873b1770511d2efd371b14d8d01 (patch) | |
tree | c57543e95c9d5897f089be5899ad1684ca9defc0 | |
parent | 65ac67f38dd4d918270dce42a5775a17d14089c6 (diff) |
tests: add some test for the Adobe SDK
-rw-r--r-- | exempi/tests/Makefile.am | 15 | ||||
-rw-r--r-- | exempi/tests/test-adobesdk.cpp | 27 |
2 files changed, 39 insertions, 3 deletions
diff --git a/exempi/tests/Makefile.am b/exempi/tests/Makefile.am index 45c68d3..ad7092d 100644 --- a/exempi/tests/Makefile.am +++ b/exempi/tests/Makefile.am @@ -42,10 +42,14 @@ TEST_EXTENSIONS = .sh if WITH_UNIT_TEST check_PROGRAMS = testexempicore testserialise testwritenewprop \ testtiffleak testxmpfiles testxmpfileswrite \ - test3 testinit testfdo18635 testfdo83313 testcpp testwebp + test3 testinit testfdo18635 testfdo83313 testcpp testwebp \ + testadobesdk \ + $(NULL) TESTS = testcore.sh testinit testexempicore testserialise testwritenewprop \ testtiffleak testxmpfiles testxmpfileswrite \ - test3 testfdo18635 testfdo83313 testcpp testwebp + test3 testfdo18635 testfdo83313 testcpp testwebp \ + testadobesdk \ + $(NULL) TESTS_ENVIRONMENT = TEST_DIR=$(srcdir) BOOST_TEST_CATCH_SYSTEM_ERRORS=no VALGRIND="$(VALGRIND)" LOG_COMPILER = $(VALGRIND) endif @@ -59,7 +63,8 @@ EXTRA_DIST = $(check_DATA) $(check_SCRIPTS) CLEANFILES = test.jpg test.webp AM_CXXFLAGS = @BOOST_CPPFLAGS@ -AM_CPPFLAGS = -I$(srcdir)/.. -I$(top_srcdir)/public/include -I$(top_srcdir) +AM_CPPFLAGS = -I$(srcdir)/.. -I$(top_srcdir)/public/include -I$(top_srcdir) \ + -Wall -D@EXEMPI_PLATFORM_DEF@=1 testinit_SOURCES = testinit.cpp utils.cpp testinit_LDADD = ../libexempi.la @BOOST_UNIT_TEST_FRAMEWORK_LIBS@ @@ -108,3 +113,7 @@ testcpp_LDFLAGS = -static @BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS@ testwebp_SOURCES = test-webp.cpp utils.cpp testwebp_LDADD = ../libexempi.la @BOOST_UNIT_TEST_FRAMEWORK_LIBS@ testwebp_LDFLAGS = -static @BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS@ + +testadobesdk_SOURCES = test-adobesdk.cpp +testadobesdk_LDADD = ../libexempi.la @BOOST_UNIT_TEST_FRAMEWORK_LIBS@ +testadobesdk_LDFLAGS = -static @BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS@ diff --git a/exempi/tests/test-adobesdk.cpp b/exempi/tests/test-adobesdk.cpp new file mode 100644 index 0000000..38c214e --- /dev/null +++ b/exempi/tests/test-adobesdk.cpp @@ -0,0 +1,27 @@ +#include <boost/test/minimal.hpp> + +#include "../../XMPCore/source/XMPUtils.hpp" + +using boost::unit_test::test_suite; + +// void test_xmpfiles() +int test_main(int argc, char* argv[]) +{ + + + XMP_Int64 value = XMPUtils::ConvertToInt64("0x123456"); + BOOST_CHECK(value == 0x123456); + + value = XMPUtils::ConvertToInt64("123456"); + BOOST_CHECK(value == 123456); + + bool did_throw = false; + try { + value = XMPUtils::ConvertToInt64("abcdef"); + } catch(const XMP_Error & e) { + did_throw = true; + } + BOOST_CHECK(did_throw); + + return 0; +} |