diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:46:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:46:17 +0000 |
commit | 85adc697d2ec2a379ce6d721f0419ae5df3abdb6 (patch) | |
tree | 265f329bc4544c6f11a27ac3fd6022f593a10c11 /test | |
parent | Initial commit. (diff) | |
download | mdds-upstream.tar.xz mdds-upstream.zip |
Adding upstream version 2.1.1.upstream/2.1.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test')
214 files changed, 55626 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..b7a72de --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,28 @@ +SUBDIRS = \ + gdb \ + flat_segment_tree \ + include \ + multi_type_vector \ + multi_type_matrix \ + point_quad_tree \ + rtree \ + segment_tree \ + sorted_string_map \ + trie_map + +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = \ + ref-pair-test + +ref_pair_test_SOURCES = \ + ref_pair_test.cpp \ + test_global.cpp + +TESTS = \ + ref-pair-test + +@VALGRIND_CHECK_RULES@ diff --git a/test/Makefile.in b/test/Makefile.in new file mode 100644 index 0000000..237f348 --- /dev/null +++ b/test/Makefile.in @@ -0,0 +1,1104 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = ref-pair-test$(EXEEXT) +TESTS = ref-pair-test$(EXEEXT) +subdir = test +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_ref_pair_test_OBJECTS = ref_pair_test.$(OBJEXT) \ + test_global.$(OBJEXT) +ref_pair_test_OBJECTS = $(am_ref_pair_test_OBJECTS) +ref_pair_test_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/ref_pair_test.Po \ + ./$(DEPDIR)/test_global.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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 = $(ref_pair_test_SOURCES) +DIST_SOURCES = $(ref_pair_test_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + check recheck distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = \ + gdb \ + flat_segment_tree \ + include \ + multi_type_vector \ + multi_type_matrix \ + point_quad_tree \ + rtree \ + segment_tree \ + sorted_string_map \ + trie_map + +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +ref_pair_test_SOURCES = \ + ref_pair_test.cpp \ + test_global.cpp + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + +ref-pair-test$(EXEEXT): $(ref_pair_test_OBJECTS) $(ref_pair_test_DEPENDENCIES) $(EXTRA_ref_pair_test_DEPENDENCIES) + @rm -f ref-pair-test$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(ref_pair_test_OBJECTS) $(ref_pair_test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ref_pair_test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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 $$? +ref-pair-test.log: ref-pair-test$(EXEEXT) + @p='ref-pair-test$(EXEEXT)'; \ + b='ref-pair-test'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f ./$(DEPDIR)/ref_pair_test.Po + -rm -f ./$(DEPDIR)/test_global.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f ./$(DEPDIR)/ref_pair_test.Po + -rm -f ./$(DEPDIR)/test_global.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) check-am install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles check check-TESTS check-am check-valgrind-am \ + check-valgrind-drd-am check-valgrind-drd-local \ + check-valgrind-helgrind-am check-valgrind-helgrind-local \ + check-valgrind-local check-valgrind-memcheck-am \ + check-valgrind-memcheck-local check-valgrind-sgcheck-am \ + check-valgrind-sgcheck-local clean clean-checkPROGRAMS \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic 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 install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/flat_segment_tree/Makefile.am b/test/flat_segment_tree/Makefile.am new file mode 100644 index 0000000..b4927a7 --- /dev/null +++ b/test/flat_segment_tree/Makefile.am @@ -0,0 +1,14 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/flat_segment_tree/Makefile.in b/test/flat_segment_tree/Makefile.in new file mode 100644 index 0000000..23eb042 --- /dev/null +++ b/test/flat_segment_tree/Makefile.in @@ -0,0 +1,990 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/flat_segment_tree +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_main.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/flat_segment_tree/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/flat_segment_tree/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/flat_segment_tree/test_main.cpp b/test/flat_segment_tree/test_main.cpp new file mode 100644 index 0000000..c0f5f66 --- /dev/null +++ b/test/flat_segment_tree/test_main.cpp @@ -0,0 +1,2590 @@ +/************************************************************************* + * + * Copyright (c) 2008-2023 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "mdds/flat_segment_tree.hpp" + +#include <iostream> +#include <string> +#include <vector> +#include <limits> +#include <iterator> +#include <algorithm> +#include <memory> + +using namespace mdds; + +void print_title(const char* msg) +{ + cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl; + cout << " " << msg << endl; + cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl; +} + +void fst_test_leaf_search() +{ + MDDS_TEST_FUNC_SCOPE; + + { + print_title("Simple insert test"); + flat_segment_tree<int, int> int_ranges(0, 100, -1); + for (int i = 0; i < 20; ++i) + { + int start = i * 5; + int end = start + 5; + int_ranges.insert_front(start, end, i); + } + int_ranges.dump_leaf_nodes(); + } + + { + print_title("Merge test 1"); + flat_segment_tree<int, int> merge_test(0, 100, -1); + merge_test.insert_front(10, 20, 5); + merge_test.dump_leaf_nodes(); + merge_test.insert_front(15, 30, 5); + merge_test.dump_leaf_nodes(); + merge_test.insert_front(30, 50, 5); + merge_test.dump_leaf_nodes(); + merge_test.insert_front(8, 11, 5); + merge_test.dump_leaf_nodes(); + merge_test.insert_front(5, 8, 5); + merge_test.dump_leaf_nodes(); + } + + { + print_title("Merge test 2"); + flat_segment_tree<int, int> merge_test(0, 100, -1); + + // This should not change the node configuration. + merge_test.insert_front(10, 90, -1); + merge_test.dump_leaf_nodes(); + + for (int i = 10; i <= 80; i += 10) + merge_test.insert_front(i, i + 10, i); + merge_test.dump_leaf_nodes(); + merge_test.insert_front(10, 90, -1); + merge_test.dump_leaf_nodes(); + + for (int i = 10; i <= 80; i += 10) + merge_test.insert_front(i, i + 10, i); + merge_test.dump_leaf_nodes(); + merge_test.insert_front(8, 92, -1); + merge_test.dump_leaf_nodes(); + + for (int i = 10; i <= 80; i += 10) + merge_test.insert_front(i, i + 10, i); + merge_test.dump_leaf_nodes(); + merge_test.insert_front(12, 88, 25); + merge_test.dump_leaf_nodes(); + } + + { + print_title("Search test"); + flat_segment_tree<int, int> db(0, 100, -1); + for (int i = 0; i < 10; ++i) + { + int key = i * 10; + int val = i * 5; + db.insert_front(key, key + 10, val); + } + db.dump_leaf_nodes(); + for (int i = 0; i <= 100; ++i) + { + int val = 0; + if (db.search(i, val).second) + cout << "key = " << i << "; value = " << val << endl; + else + cout << "key = " << i << "; (value not found)" << endl; + } + for (int i = 0; i <= 100; ++i) + { + int val = 0, start, end; + if (db.search(i, val, &start, &end).second) + cout << "key = " << i << "; value = " << val << "(span: " << start << " - " << end << ")" << endl; + else + cout << "key = " << i << "; (value not found)" << endl; + } + } +} + +void fst_test_leaf_search_2() +{ + MDDS_TEST_FUNC_SCOPE; + + using db_type = mdds::flat_segment_tree<int32_t, std::string>; + db_type db(0, 8, "-"); + db.insert_back(2, 4, "2-4"); + db.insert_back(4, 6, "4-6"); + + db_type::const_iterator it = db.search(-1); // out-of-bound + assert(it == db.end()); + + it = db.search(8); // out-of-bound + assert(it == db.end()); + + struct check + { + int32_t key; + int32_t start; + int32_t end; + std::string value; + }; + + std::vector<check> checks = { + {0, 0, 2, "-"}, {1, 0, 2, "-"}, {2, 2, 4, "2-4"}, {3, 2, 4, "2-4"}, + {4, 4, 6, "4-6"}, {5, 4, 6, "4-6"}, {6, 6, 8, "-"}, {7, 6, 8, "-"}, + }; + + // variant of search() without a position hint + for (const auto& c : checks) + { + it = db.search(c.key); + assert(it != db.end()); + assert(it->first == c.start); + assert(it->second == c.value); + + auto sit = it.to_segment(); + assert(sit->start == c.start); + assert(sit->end == c.end); + assert(sit->value == c.value); + } + + // variant of search() with a position hint + + it = db.search(db.begin(), -1); // out-of-bound + assert(it == db.end()); + + it = db.search(db.begin(), 8); // out-of-bound + assert(it == db.end()); + + it = db.begin(); + for (const auto& c : checks) + { + it = db.search(it, c.key); + assert(it != db.end()); + assert(it->first == c.start); + assert(it->second == c.value); + + auto sit = it.to_segment(); + assert(sit->start == c.start); + assert(sit->end == c.end); + assert(sit->value == c.value); + } +} + +/** + * Test tree construction of flat_segment_tree. + */ +void fst_test_tree_build() +{ + MDDS_TEST_FUNC_SCOPE; + + { + int lower = 0, upper = 100, delta = 10; + flat_segment_tree<int, int> db(lower, upper, 0); + { + stack_printer __stack_printer2__("::fst_test_tree_build insertion"); + for (int i = lower; i < upper; i += delta) + db.insert_front(i, i + delta, i * 2); + } + db.dump_leaf_nodes(); + + { + stack_printer __stack_printer2__("::fst_test_tree_build tree construction"); + db.build_tree(); + db.dump_tree(); + } + } + + { + flat_segment_tree<int, int> db(0, 10, 0); + db.dump_leaf_nodes(); + } +} + +void fst_perf_test_search_leaf() +{ + MDDS_TEST_FUNC_SCOPE; + + int lower = 0, upper = 50000; + flat_segment_tree<int, int> db(lower, upper, 0); + for (int i = upper - 1; i >= lower; --i) + db.insert_front(i, i + 1, i); + + int success = 0, failure = 0; + int val; + for (int i = lower; i < upper; ++i) + { + if (db.search(i, val).second) + ++success; + else + ++failure; + } + fprintf(stdout, "fst_perf_test_search_leaf: success (%d) failure (%d)\n", success, failure); +} + +void fst_perf_test_search_tree() +{ + MDDS_TEST_FUNC_SCOPE; + + int lower = 0, upper = 5000000; + flat_segment_tree<int, int> db(lower, upper, 0); + for (int i = upper - 1; i >= lower; --i) + db.insert_front(i, i + 1, i); + + { + stack_printer sp2("::fst_perf_test_search_tree (build tree)"); + db.build_tree(); + } + + int success = 0, failure = 0; + { + stack_printer sp2("::fst_perf_test_search_tree (search tree)"); + int val; + for (int i = lower; i < upper; ++i) + { + if (db.search_tree(i, val).second) + ++success; + else + ++failure; + } + } + + fprintf(stdout, "fst_perf_test_search: success (%d) failure (%d)\n", success, failure); +} + +void fst_test_tree_search() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<int, int> fst_type; + int lower = 0, upper = 200, delta = 5; + fst_type db(lower, upper, 0); + for (int i = lower; i < upper; i += delta) + db.insert_front(i, i + delta, i); + + db.build_tree(); + db.dump_tree(); + db.dump_leaf_nodes(); + + int val, start, end; + int success = 0, failure = 0; + for (int i = lower - 10; i < upper + 10; ++i) + { + if (db.search_tree(i, val, &start, &end).second) + { + cout << "key = " << i << "; value = " << val << " (" << start << "-" << end << ")" << endl; + ++success; + } + else + { + ++failure; + cout << "key = " << i << " (search failed)" << endl; + } + } + cout << "search: success (" << success << ") failure (" << failure << ")" << endl; + + // Make sure search_tree() returns correct iterator position. + db.clear(); + db.insert_back(5, 10, 2); + db.insert_back(15, 18, 3); + db.insert_back(23, 28, 4); + db.build_tree(); + + typedef std::pair<fst_type::const_iterator, bool> ret_type; + ret_type ret = db.search_tree(0, val, &start, &end); + assert(ret.second); + assert(start == 0 && end == 5 && val == 0); + assert(ret.first == db.begin()); + + ret = db.search_tree(6, val, &start, &end); + assert(ret.second); + assert(start == 5 && end == 10 && val == 2); + fst_type::const_iterator check = db.begin(); + ++check; // 5-10 is the 2nd segment from the top. + assert(ret.first == check); + + ret = db.search_tree(17, val, &start, &end); + assert(ret.second); + assert(start == 15 && end == 18 && val == 3); + std::advance(check, 2); + assert(ret.first == check); + + ret = db.search_tree(55, val, &start, &end); + assert(ret.second); + assert(start == 28 && end == upper && val == 0); + std::advance(check, 3); + assert(ret.first == check); + + ret = db.search_tree(upper + 10, val, &start, &end); + assert(!ret.second); // This search should fail. + assert(ret.first == db.end()); +} + +void fst_test_tree_search_2() +{ + MDDS_TEST_FUNC_SCOPE; + + using db_type = mdds::flat_segment_tree<int32_t, std::string>; + db_type db(0, 8, "-"); + db.insert_back(2, 4, "2-4"); + db.insert_back(4, 6, "4-6"); + + db.build_tree(); + + db_type::const_iterator it = db.search_tree(-1); // out-of-bound + assert(it == db.end()); + + it = db.search_tree(8); // out-of-bound + assert(it == db.end()); + + struct check + { + int32_t key; + int32_t start; + int32_t end; + std::string value; + }; + + std::vector<check> checks = { + {0, 0, 2, "-"}, {1, 0, 2, "-"}, {2, 2, 4, "2-4"}, {3, 2, 4, "2-4"}, + {4, 4, 6, "4-6"}, {5, 4, 6, "4-6"}, {6, 6, 8, "-"}, {7, 6, 8, "-"}, + }; + + // variant of search() without a position hint + for (const auto& c : checks) + { + it = db.search_tree(c.key); + assert(it != db.end()); + assert(it->first == c.start); + assert(it->second == c.value); + + auto sit = it.to_segment(); + assert(sit->start == c.start); + assert(sit->end == c.end); + assert(sit->value == c.value); + } +} + +void test_single_tree_search(const flat_segment_tree<int, int>& db, int key, int val, int start, int end) +{ + int r_val, r_start, r_end; + if (db.search_tree(key, r_val, &r_start, &r_end).second) + assert(r_val == val && r_start == start && r_end == end); + else + assert(!"tree search failed!"); +} + +template<typename key_type, typename value_type> +void build_and_dump(flat_segment_tree<key_type, value_type>& db) +{ + db.build_tree(); + db.dump_tree(); + db.dump_leaf_nodes(); +} + +template<typename key_type, typename value_type> +bool check_leaf_nodes( + const flat_segment_tree<key_type, value_type>& db, const key_type* keys, const value_type* values, size_t key_size) +{ + if (key_size <= 1) + return false; + + std::vector<key_type> key_checks; + key_checks.reserve(key_size); + for (size_t i = 0; i < key_size; ++i) + key_checks.push_back(keys[i]); + + if (!db.verify_keys(key_checks)) + return false; + + std::vector<value_type> value_checks; + value_checks.reserve(key_size - 1); + for (size_t i = 0; i < key_size - 1; ++i) + value_checks.push_back(values[i]); + + if (!db.verify_values(value_checks)) + return false; + + return true; +} + +template<typename key_type, typename value_type> +bool is_iterator_valid( + const typename flat_segment_tree<key_type, value_type>::const_iterator& beg, + const typename flat_segment_tree<key_type, value_type>::const_iterator& end, const key_type* keys, + const value_type* values, size_t key_size) +{ + assert(key_size > 1); + + typedef flat_segment_tree<key_type, value_type> container; + typename container::const_iterator itr; + size_t idx = 0; + for (itr = beg; itr != end; ++itr, ++idx) + { + if (idx >= key_size) + // out-of-bound index + return false; + + // Check the key first. + if (keys[idx] != itr->first) + return false; + + if (idx < key_size - 1) + { + // Check the value only if it's not the last node. The last node + // may have an arbitrary value. + if (values[idx] != itr->second) + return false; + } + } + + // At this point, the iterator should be at the end position. + if (itr != end) + return false; + + // Check the keys and values again but go to the opposite direction. + do + { + --itr; + --idx; + + // key + if (keys[idx] != itr->first) + return false; + + // value + if (idx < key_size - 1) + { + if (values[idx] != itr->second) + return false; + } + } while (itr != beg); + + return true; +} + +template<typename key_type, typename value_type> +bool is_iterator_valid( + const typename flat_segment_tree<key_type, value_type>::const_reverse_iterator& beg, + const typename flat_segment_tree<key_type, value_type>::const_reverse_iterator& end, const key_type* keys, + const value_type* values, size_t key_size) +{ + assert(key_size > 1); + + typedef flat_segment_tree<key_type, value_type> container; + typename container::const_reverse_iterator itr; + size_t idx = key_size - 1; + for (itr = beg; itr != end; ++itr, --idx) + { + if (idx >= key_size) + // out-of-bound index + return false; + + // Check the key first. + if (keys[idx] != itr->first) + return false; + + if (idx < key_size - 1) + { + // Check the value only if it's not the last node. The last node + // may have an arbitrary value. + if (values[idx] != itr->second) + return false; + } + } + + // At this point, the iterator should be at the end position. + if (itr != end) + return false; + + // Check the keys and values again but go to the opposite direction. + do + { + --itr; + ++idx; + + // key + if (keys[idx] != itr->first) + return false; + + // value + if (idx < key_size - 1) + { + if (values[idx] != itr->second) + return false; + } + } while (itr != beg); + + return true; +} + +void fst_test_insert_search_mix() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<int, int> db_type; + db_type db(0, 100, 0); + + build_and_dump(db); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.is_tree_valid()); + test_single_tree_search(db, 0, 0, 0, 100); + test_single_tree_search(db, 99, 0, 0, 100); + + db.insert_front(0, 10, 1); + assert(!db.is_tree_valid()); + build_and_dump(db); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.is_tree_valid()); + test_single_tree_search(db, 0, 1, 0, 10); + test_single_tree_search(db, 5, 1, 0, 10); + test_single_tree_search(db, 9, 1, 0, 10); + test_single_tree_search(db, 10, 0, 10, 100); + + db.insert_front(0, 100, 0); + assert(!db.is_tree_valid()); + build_and_dump(db); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.is_tree_valid()); + test_single_tree_search(db, 0, 0, 0, 100); + test_single_tree_search(db, 99, 0, 0, 100); + + db.insert_front(10, 20, 5); + db.insert_front(30, 40, 5); + assert(!db.is_tree_valid()); + build_and_dump(db); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.is_tree_valid()); + test_single_tree_search(db, 10, 5, 10, 20); + test_single_tree_search(db, 20, 0, 20, 30); + test_single_tree_search(db, 30, 5, 30, 40); + test_single_tree_search(db, 40, 0, 40, 100); + + db.insert_front(18, 22, 6); + assert(!db.is_tree_valid()); + build_and_dump(db); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.is_tree_valid()); + test_single_tree_search(db, 18, 6, 18, 22); + test_single_tree_search(db, 22, 0, 22, 30); + test_single_tree_search(db, 30, 5, 30, 40); + + db.insert_front(19, 30, 5); + assert(!db.is_tree_valid()); + build_and_dump(db); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.is_tree_valid()); + test_single_tree_search(db, 19, 5, 19, 40); + + db.insert_front(-100, 500, 999); + assert(!db.is_tree_valid()); + build_and_dump(db); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.is_tree_valid()); + test_single_tree_search(db, 30, 999, 0, 100); +} + +void fst_test_shift_left() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<int, int> db_type; + db_type db(0, 100, 0); + db.insert_front(20, 40, 5); + db.insert_front(50, 60, 10); + db.insert_front(70, 80, 15); + build_and_dump(db); + + // invalid segment ranges -- these should not modify the state of the + // tree, hence the tree should remain valid. + db.shift_left(5, 0); + assert(db.is_tree_valid()); + + db.shift_left(95, 120); + assert(db.is_tree_valid()); + + db.shift_left(105, 120); + assert(db.is_tree_valid()); + + db.shift_left(-10, -5); + assert(db.is_tree_valid()); + + db.shift_left(-10, 5); + assert(db.is_tree_valid()); + + // shift without removing nodes (including the lower bound). + db.shift_left(0, 5); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + std::vector<int> key_checks; + key_checks.push_back(0); + key_checks.push_back(15); + key_checks.push_back(35); + key_checks.push_back(45); + key_checks.push_back(55); + key_checks.push_back(65); + key_checks.push_back(75); + key_checks.push_back(100); + assert(db.verify_keys(key_checks)); + } + + // shift without removing nodes (not including the lower bound). + db.shift_left(1, 6); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + std::vector<int> key_checks; + key_checks.push_back(0); + key_checks.push_back(10); + key_checks.push_back(30); + key_checks.push_back(40); + key_checks.push_back(50); + key_checks.push_back(60); + key_checks.push_back(70); + key_checks.push_back(100); + assert(db.verify_keys(key_checks)); + } + + // shift without removing nodes (the upper bound of the removed segment + // coincides with a node). + db.shift_left(5, 10); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + std::vector<int> key_checks; + key_checks.push_back(0); + key_checks.push_back(5); + key_checks.push_back(25); + key_checks.push_back(35); + key_checks.push_back(45); + key_checks.push_back(55); + key_checks.push_back(65); + key_checks.push_back(100); + assert(db.verify_keys(key_checks)); + } + + // shift with one overlapping node. + db.shift_left(1, 11); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 1, 15, 25, 35, 45, 55, 100}; + int vals[] = {0, 5, 0, 10, 0, 15, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // shift with two overlapping nodes. + db.shift_left(2, 30); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 1, 2, 7, 17, 27, 100}; + int vals[] = {0, 5, 10, 0, 15, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // shift with both ends at existing nodes, but no nodes in between. + db.shift_left(0, 1); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 1, 6, 16, 26, 100}; + int vals[] = {5, 10, 0, 15, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // shift with both ends at existing nodes, no nodes in between, and + // removing the segment results in two consecutive segments with identical + // value. The segments should get combined into one. + db.shift_left(16, 26); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 1, 6, 100}; + int vals[] = {5, 10, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // insert two new segments for the next test.... + db.insert_front(10, 20, 400); + db.insert_front(30, 40, 400); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 1, 6, 10, 20, 30, 40, 100}; + int vals[] = {5, 10, 0, 400, 0, 400, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // same test as the previous one, but the value of the combined segment + // differs from the value of the rightmost leaf node. + db.shift_left(20, 30); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 1, 6, 10, 30, 100}; + int vals[] = {5, 10, 0, 400, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // remove all. + db.shift_left(0, 100); + assert(!db.is_tree_valid()); + build_and_dump(db); +} + +void fst_test_shift_left_right_edge() +{ + MDDS_TEST_FUNC_SCOPE; + + flat_segment_tree<int, bool> db(0, 100, false); + build_and_dump(db); + + // This should not change the tree state. + db.shift_left(2, 100); + build_and_dump(db); + { + int keys[] = {0, 100}; + bool vals[] = {false}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + db.insert_front(20, 100, true); + build_and_dump(db); + { + int keys[] = {0, 20, 100}; + bool vals[] = {false, true}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // This should insert a new segment at the end with the initial base value. + db.shift_left(80, 100); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 20, 80, 100}; + bool vals[] = {false, true, false}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // This should not modify the tree since the removed segment already has + // the initial base value. + db.shift_left(85, 100); + assert(db.is_tree_valid()); // tree must still be valid. + build_and_dump(db); + { + int keys[] = {0, 20, 80, 100}; + bool vals[] = {false, true, false}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // Insert a new segment at the end with the value 'true' again... + db.insert_front(85, 100, true); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 20, 80, 85, 100}; + bool vals[] = {false, true, false, true}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + db.shift_left(90, 95); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 20, 80, 85, 95, 100}; + bool vals[] = {false, true, false, true, false}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } +} + +void fst_test_shift_left_append_new_segment() +{ + MDDS_TEST_FUNC_SCOPE; + + flat_segment_tree<int, bool> db(0, 100, false); + db.insert_front(0, 100, true); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 100}; + bool vals[] = {true}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + db.shift_left(10, 20); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 90, 100}; + bool vals[] = {true, false}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + db.insert_front(0, 10, true); + db.insert_front(10, 20, false); + db.insert_front(20, 60, true); + db.insert_front(60, 80, false); + db.insert_front(80, 100, true); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 10, 20, 60, 80, 100}; + bool vals[] = {true, false, true, false, true}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + db.shift_left(0, 70); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 10, 30, 100}; + bool vals[] = {false, true, false}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } +} + +void fst_test_shift_right_init0() +{ + MDDS_TEST_FUNC_SCOPE; + + flat_segment_tree<int, int> db(0, 100, 0); + db.insert_front(0, 10, 15); + db.insert_front(10, 20, 1); + db.insert_front(20, 30, 2); + db.insert_front(30, 40, 3); + db.insert_front(40, 50, 4); + db.insert_front(50, 60, 5); + db.insert_front(60, 70, 6); + db.insert_front(70, 80, 7); + db.insert_front(80, 90, 8); + assert(!db.is_tree_valid()); + build_and_dump(db); + + // shifting position is at the lower bound. The leftmost segment has a + // non-zero value which needs to be preserved after the shift by adding a + // new node. + db.shift_right(0, 5, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 100}; + int vals[] = {0, 15, 1, 2, 3, 4, 5, 6, 7, 8, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // shifting position is at the lower bound, and after the shift, the upper + // bound of the last non-zero segment (10) becomes the upper bound of the + // global range. + db.shift_right(0, 5, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}; + int vals[] = {0, 15, 1, 2, 3, 4, 5, 6, 7, 8}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // Shift by some odd number. + db.shift_right(0, 49, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 59, 69, 79, 89, 99, 100}; + int vals[] = {0, 15, 1, 2, 3, 4}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // Shift so that the 2nd node from the right-most node becomes the new + // right-most node. + db.shift_right(0, 11, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 70, 80, 90, 100}; + int vals[] = {0, 15, 1, 2}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // This should remove all segments. + db.shift_right(0, 30, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 100}; + int vals[] = {0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // Insert a few new segments for the next series of tests... + db.insert_front(5, 10, 5); + db.insert_front(20, 30, 5); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 5, 10, 20, 30, 100}; + int vals[] = {0, 5, 0, 5, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // Inserting at a non-node position. This should simply extend that + // segment and shift all the others. + db.shift_right(6, 20, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 5, 30, 40, 50, 100}; + int vals[] = {0, 5, 0, 5, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // Inserting at a node position. + db.shift_right(5, 20, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 25, 50, 60, 70, 100}; + int vals[] = {0, 5, 0, 5, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // Inserting at a non-node position, pushing a node out-of-bound. + db.shift_right(65, 40, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 25, 50, 60, 100}; + int vals[] = {0, 5, 0, 5}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } + + // Inserting at a node position, pushing a node out-of-bound. + db.shift_right(50, 40, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int keys[] = {0, 25, 90, 100}; + int vals[] = {0, 5, 0}; + assert(check_leaf_nodes(db, keys, vals, std::size(keys))); + } +} + +void fst_test_shift_right_init999() +{ + MDDS_TEST_FUNC_SCOPE; + + // Initialize the tree with a default value of 999. + flat_segment_tree<int, int> db(0, 100, 999); + db.insert_front(0, 10, 0); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int k[] = {0, 10, 100}; + int v[] = {0, 999}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + // This should only extend the first segment. + db.shift_right(1, 10, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int k[] = {0, 20, 100}; + int v[] = {0, 999}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + // Inserting at the leftmost node position should create a new segment + // with a default value of 999. + db.shift_right(0, 10, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + int k[] = {0, 10, 30, 100}; + int v[] = {999, 0, 999}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + // Invalid shifts -- these should not invalidate the tree. + db.shift_right(-10, 10, false); + assert(db.is_tree_valid()); + + db.shift_right(100, 10, false); + assert(db.is_tree_valid()); + + db.shift_right(0, 0, false); + assert(db.is_tree_valid()); +} + +void fst_test_shift_right_bool() +{ + MDDS_TEST_FUNC_SCOPE; + + flat_segment_tree<long, bool> db(0, 1048576, false); + db.insert_front(3, 7, true); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + long k[] = {0, 3, 7, 1048576}; + bool v[] = {false, true, false}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.shift_right(1, 1, false); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + long k[] = {0, 4, 8, 1048576}; + bool v[] = {false, true, false}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } +} + +void fst_test_shift_right_skip_start_node() +{ + MDDS_TEST_FUNC_SCOPE; + + flat_segment_tree<long, short> db(0, 1048576, 0); + db.insert_front(3, 7, 5); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + long k[] = {0, 3, 7, 1048576}; + short v[] = {0, 5, 0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.shift_right(3, 2, true); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + long k[] = {0, 3, 9, 1048576}; + short v[] = {0, 5, 0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + // shift_right from the leftmost node should not change its value + db.insert_front(0, 4, 2); + assert(!db.is_tree_valid()); + build_and_dump(db); + { + long k[] = {0, 4, 9, 1048576}; + short v[] = {2, 5, 0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.shift_right(0, 2, true); + build_and_dump(db); + { + long k[] = {0, 6, 11, 1048576}; + short v[] = {2, 5, 0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } +} + +/** + * Right all nodes right so that all existing nodes get pushed out of the + * range. + */ +void fst_test_shift_right_all_nodes() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<unsigned, unsigned> fst_type; + + fst_type db(0, 10, 0); + { + unsigned k[] = {0, 10}; + unsigned v[] = {0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_back(0, 8, 2); + db.dump_leaf_nodes(); + { + unsigned k[] = {0, 8, 10}; + unsigned v[] = {2, 0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + // Shift all nodes out of range. After this, there should be only the + // left and right most nodes left. + db.shift_right(0, 15, false); + db.dump_leaf_nodes(); + { + unsigned k[] = {0, 10}; + unsigned v[] = {0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } +} + +template<typename key_type, typename value_type> +struct leaf_node_functor +{ + void operator()(const std::pair<key_type, value_type>&) const + {} +}; + +void fst_test_const_iterator() +{ + MDDS_TEST_FUNC_SCOPE; + + { + typedef unsigned int key_type; + typedef unsigned short value_type; + unsigned short max_value = std::numeric_limits<value_type>::max(); + typedef flat_segment_tree<key_type, value_type> container_type; + + container_type db(0, 1000, max_value); + + build_and_dump(db); + { + unsigned int k[] = {0, 1000}; + unsigned short v[] = {max_value}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_front(10, 20, 10); + db.insert_front(20, 50, 20); + db.insert_front(100, 300, 55); + build_and_dump(db); + { + unsigned int k[] = {0, 10, 20, 50, 100, 300, 1000}; + unsigned short v[] = {max_value, 10, 20, max_value, 55, max_value}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + fprintf(stdout, "fst_test_const_iterator: leaf nodes valid\n"); + + // Check the forward iterator's integrity. + assert(is_iterator_valid(db.begin(), db.end(), k, v, std::size(k))); + fprintf(stdout, "fst_test_const_iterator: forward iterator valid\n"); + + // Check the reverse iterator's integrity. + assert(is_iterator_valid(db.rbegin(), db.rend(), k, v, std::size(k))); + fprintf(stdout, "fst_test_const_iterator: reverse iterator valid\n"); + } + + // Make sure it works with for_each. + std::for_each(db.begin(), db.end(), leaf_node_functor<key_type, value_type>()); + } + + { + typedef flat_segment_tree<int, bool> container_type; + container_type db(0, 100, true); + db.insert_front(0, 50, false); + + { + cout << "-- forward" << endl; + container_type::const_iterator it = db.begin(), it_end = db.end(); + // 0 -> 50 -> 100 -> end + cout << "key: " << it->first << " value: " << it->second << endl; + assert(it->first == 0); + assert(it->second == false); + ++it; + cout << "key: " << it->first << " value: " << it->second << endl; + assert(it->first == 50); + assert(it->second == true); + ++it; + cout << "key: " << it->first << " value: " << it->second << endl; + assert(it->first == 100); + assert(it != it_end); + ++it; + assert(it == it_end); + } + { + cout << "-- reverse" << endl; + container_type::const_reverse_iterator it = db.rbegin(), it_end = db.rend(); + // 100 -> 50 -> 0 -> end + cout << "key: " << it->first << " value: " << it->second << endl; + assert(it->first == 100); + ++it; + cout << "key: " << it->first << " value: " << it->second << endl; + assert(it->first == 50); + assert(it->second == true); + ++it; + cout << "key: " << it->first << " value: " << it->second << endl; + assert(it->first == 0); + assert(it->second == false); + assert(it != it_end); + ++it; + assert(it == it_end); + } + } +} + +template<typename key_type, typename value_type> +void fst_test_insert_front_back(key_type start_key, key_type end_key, value_type default_value) +{ + MDDS_TEST_FUNC_SCOPE_MSG( + "start-key=" << start_key << "; end-key=" << end_key << "; default-value=" << default_value); + + typedef flat_segment_tree<key_type, value_type> container_type; + typedef typename container_type::const_iterator itr_type; + + value_type val = 0; + + // insert a series of segments from the front. + container_type db_front(start_key, end_key, default_value); + for (key_type i = start_key; i < end_key - 10; ++i) + { + itr_type itr = db_front.insert_front(i, i + 1, val).first; + assert(itr->first == i); + assert(itr->second == val); + if (++val > 10) + val = 0; + } + + // insert the same series of segments from the back. + container_type db_back(start_key, end_key, default_value); + val = 0; + for (key_type i = start_key; i < end_key - 10; ++i) + { + itr_type itr = db_back.insert_back(i, i + 1, val).first; + assert(itr->first == i); + assert(itr->second == val); + if (++val > 10) + val = 0; + } + + // Now, these two must be identical. + if (db_front != db_back) + { + // They are not identical! + db_front.dump_leaf_nodes(); + db_back.dump_leaf_nodes(); + cout << "start_key = " << start_key << " end_key = " << end_key << " default_value = " << default_value + << endl; + assert(!"Contents of the two containers are not identical!"); + } +} + +void fst_perf_test_insert_front_back() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef unsigned long key_type; + typedef int value_type; + typedef flat_segment_tree<key_type, value_type> container_type; + key_type upper_bound = 20000; + { + stack_printer __stack_printer__("::fst_perf_test_insert (front insertion)"); + container_type db(0, upper_bound, 0); + value_type val = 0; + for (key_type i = 0; i < upper_bound; ++i) + { + db.insert_front(i, i + 1, val); + if (++val > 10) + val = 0; + } + } + + { + stack_printer __stack_printer__("::fst_perf_test_insert (back insertion)"); + container_type db(0, upper_bound, 0); + value_type val = 0; + for (key_type i = 0; i < upper_bound; ++i) + { + db.insert_back(i, i + 1, val); + if (++val > 10) + val = 0; + } + } +} + +void fst_test_copy_ctor() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef unsigned long key_type; + typedef int value_type; + typedef flat_segment_tree<key_type, value_type> fst; + + // Test copy construction of node first. + + { + // Original node. + fst::node_ptr node1(new fst::node); + node1->value_leaf.key = 10; + node1->value_leaf.value = 500; + assert(node1->is_leaf); + assert(!node1->parent); + assert(!node1->prev); + assert(!node1->next); + + // Copy it to new node. + fst::node_ptr node2(new fst::node(*node1)); + assert(node2->is_leaf); + assert(!node2->parent); + assert(!node2->prev); + assert(!node2->next); + assert(node2->value_leaf.key == 10); + assert(node2->value_leaf.value == 500); + + // Changing the values of the original should not modify the second node. + node1->value_leaf.key = 35; + node1->value_leaf.value = 200; + assert(node2->value_leaf.key == 10); + assert(node2->value_leaf.value == 500); + } + + { + // Test non-leaf node objects. + fst::nonleaf_node node1; + node1.value_nonleaf.low = 123; + node1.value_nonleaf.high = 789; + + // Test the copying of non-leaf values. + fst::nonleaf_node node2(node1); + assert(!node2.is_leaf); + assert(!node2.parent); + assert(!node2.left); + assert(!node2.right); + assert(node2.value_nonleaf.low == 123); + assert(node2.value_nonleaf.high == 789); + } + + // Now, test the copy construction of the flat_segment_tree. + + // Simple copying by copy construction. + fst db(0, 100, 5); + fst db_copied(db); + assert(db == db_copied); + { + key_type k[] = {0, 100}; + value_type v[] = {5}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + // Inserting the same segment value to both instances. They should still + // be equal. + db.insert_front(5, 10, 0); + db_copied.insert_front(5, 10, 0); + assert(db == db_copied); + { + key_type k[] = {0, 5, 10, 100}; + value_type v[] = {5, 0, 5}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + // Inserting a new segment only to the 2nd instance. They should differ. + db_copied.insert_front(15, 20, 35); + assert(db != db_copied); + { + key_type k[] = {0, 5, 10, 15, 20, 100}; + value_type v[] = {5, 0, 5, 35, 5}; + assert(check_leaf_nodes(db_copied, k, v, std::size(k))); + } + + // Make sure that copying will leave the tree invalid. + assert(!db_copied.is_tree_valid()); + db_copied.build_tree(); + assert(db_copied.is_tree_valid()); + fst db_copied_again(db_copied); + assert(db_copied == db_copied_again); + assert(!db_copied_again.is_tree_valid()); + assert(!db_copied_again.get_root_node()); + + // Make sure we can still perform tree search correctly. + value_type answer = 0; + db_copied_again.build_tree(); + db_copied_again.search_tree(18, answer); + assert(db_copied_again.is_tree_valid()); + assert(answer == 35); +} + +void fst_test_move_ctor() +{ + MDDS_TEST_FUNC_SCOPE; + + { + // initial condition (2 nodes) + using container_type = mdds::flat_segment_tree<int64_t, std::string>; + container_type src(-50, 50, "none"); + + // pointer to the root node should stay the same before and after the move. + auto src_root = src.get_root_node(); + + container_type moved(std::move(src)); + assert(moved.min_key() == -50); + assert(moved.max_key() == 50); + assert(moved.default_value() == "none"); + assert(moved.leaf_size() == 2); + assert(!moved.is_tree_valid()); + assert(moved.get_root_node() == src_root); + + moved.build_tree(); + assert(moved.is_tree_valid()); + + { + // Make sure search_tree() won't access invalid memory + std::string v; + moved.search_tree(0, v); + assert(v == "none"); + } + + src_root = moved.get_root_node(); + + // move again with valid tree + container_type moved2(std::move(moved)); + assert(moved2.min_key() == -50); + assert(moved2.max_key() == 50); + assert(moved2.default_value() == "none"); + assert(moved2.leaf_size() == 2); + assert(moved2.is_tree_valid()); + assert(src_root == moved2.get_root_node()); + + { + // Make sure search_tree() won't access invalid memory + std::string v; + moved2.search_tree(0, v); + assert(v == "none"); + } + } + + { + // 4 nodes + using container_type = mdds::flat_segment_tree<int64_t, std::string>; + container_type src(-50, 50, "none"); + src.insert_back(-10, 10, "middle"); + + // pointer to the root node should stay the same before and after the move. + auto src_root = src.get_root_node(); + + container_type moved(std::move(src)); + assert(moved.min_key() == -50); + assert(moved.max_key() == 50); + assert(moved.default_value() == "none"); + assert(moved.leaf_size() == 4); + assert(!moved.is_tree_valid()); + assert(moved.get_root_node() == src_root); + + moved.build_tree(); + assert(moved.is_tree_valid()); + + { + // Make sure search_tree() won't access invalid memory + std::string v; + moved.search_tree(-40, v); + assert(v == "none"); + + moved.search_tree(0, v); + assert(v == "middle"); + } + + src_root = moved.get_root_node(); + + // move again with valid tree + container_type moved2(std::move(moved)); + assert(moved2.min_key() == -50); + assert(moved2.max_key() == 50); + assert(moved2.default_value() == "none"); + assert(moved2.leaf_size() == 4); + assert(moved2.is_tree_valid()); + assert(src_root == moved2.get_root_node()); + + { + // Make sure search_tree() won't access invalid memory + std::string v; + moved2.search_tree(-40, v); + assert(v == "none"); + + moved2.search_tree(0, v); + assert(v == "middle"); + } + } +} + +void fst_test_equality() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef unsigned long key_type; + typedef int value_type; + typedef flat_segment_tree<key_type, value_type> container_type; + + container_type db1(0, 100, 0); + container_type db2(0, 100, 0); + assert(db1 == db2); + + db1.insert_front(0, 1, 1); + assert(db1 != db2); + + db2.insert_front(0, 1, 1); + assert(db1 == db2); + + // Same node count, but with different value. + db2.insert_front(0, 1, 2); + assert(db1 != db2); + + // Set the value back. + db2.insert_front(0, 1, 1); + assert(db1 == db2); + + db1.insert_front(4, 10, 10); + db1.insert_front(4, 10, 0); + assert(db1 == db2); + + db1.insert_front(20, 40, 5); + db1.insert_front(30, 35, 6); + assert(db1 != db2); + + db2.insert_front(20, 30, 5); + db2.insert_front(30, 35, 6); + db2.insert_front(35, 40, 5); + assert(db1 == db2); +} + +void fst_test_back_insert() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef unsigned int key_type; + typedef unsigned short value_type; + typedef flat_segment_tree<key_type, value_type> container_type; + container_type db(0, 100, 0); + db.insert_back(1, 2, 1); + { + unsigned int k[] = {0, 1, 2, 100}; + unsigned short v[] = {0, 1, 0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_back(3, 4, 2); + { + unsigned int k[] = {0, 1, 2, 3, 4, 100}; + unsigned short v[] = {0, 1, 0, 2, 0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_back(4, 5, 2); + { + unsigned int k[] = {0, 1, 2, 3, 5, 100}; + unsigned short v[] = {0, 1, 0, 2, 0}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_back(90, 120, 10); + { + unsigned int k[] = {0, 1, 2, 3, 5, 90, 100}; + unsigned short v[] = {0, 1, 0, 2, 0, 10}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_back(0, 10, 20); + { + unsigned int k[] = {0, 10, 90, 100}; + unsigned short v[] = {20, 0, 10}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_back(5, 20, 20); + { + unsigned int k[] = {0, 20, 90, 100}; + unsigned short v[] = {20, 0, 10}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_back(15, 30, 5); + { + unsigned int k[] = {0, 15, 30, 90, 100}; + unsigned short v[] = {20, 5, 0, 10}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.insert_back(0, 1, 2); + { + unsigned int k[] = {0, 1, 15, 30, 90, 100}; + unsigned short v[] = {2, 20, 5, 0, 10}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + + db.dump_leaf_nodes(); +} + +template<typename A, typename B> +void print_iterator(typename flat_segment_tree<A, B>::const_iterator& itr) +{ + cout << "iterator: (key=" << itr->first << ",value=" << itr->second << ")" << endl; +} + +void fst_test_insert_iterator() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef long key_type; + typedef short value_type; + typedef flat_segment_tree<key_type, value_type> db_type; + + db_type db(0, 100, 0); + db_type::const_iterator itr; + + itr = db.insert_front(0, 5, 4).first; + assert(itr->first == 0); + assert(itr->second == 4); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(3, 10, 100).first; + assert(itr->first == 3); + assert(itr->second == 100); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(5, 8, 100).first; + assert(itr->first == 3); + assert(itr->second == 100); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(5, 8, 50).first; + assert(itr->first == 5); + assert(itr->second == 50); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(6, 9, 50).first; + assert(itr->first == 5); + assert(itr->second == 50); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(9, 20, 24).first; + assert(itr->first == 9); + assert(itr->second == 24); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(19, 24, 34).first; + assert(itr->first == 19); + assert(itr->second == 34); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(24, 26, 0).first; + assert(itr->first == 24); + assert(itr->second == 0); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(30, 50, 2).first; + assert(itr->first == 30); + assert(itr->second == 2); + print_iterator<key_type, value_type>(itr); + + itr = db.insert_front(120, 140, 34).first; + assert(itr == db.end()); + + itr = db.insert_front(-20, -10, 20).first; + assert(itr == db.end()); +} + +void fst_test_insert_state_changed() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef long key_type; + typedef short value_type; + typedef flat_segment_tree<key_type, value_type> db_type; + typedef std::pair<db_type::const_iterator, bool> ret_type; + + db_type db(0, 1000, 0); + + // Inserting a segment with the default value. This should not change the + // state. + ret_type r = db.insert_front(10, 15, 0); + assert(!r.second); + + // New segment with a different value. + r = db.insert_front(0, 10, 1); + assert(r.second); + + // Inserting the same segment should not change the state. + r = db.insert_front(0, 10, 1); + assert(!r.second); + + r = db.insert_front(0, 1, 1); + assert(!r.second); + + r = db.insert_front(8, 10, 1); + assert(!r.second); + + // This extends the segment, therefore the state should change. + r = db.insert_front(8, 11, 1); + assert(r.second); + + r = db.insert_front(11, 15, 0); + assert(!r.second); + + // This extends the segment. At this point, 0 - 15 should have a value of 1. + r = db.insert_front(11, 15, 1); + assert(r.second); + { + db_type::const_iterator itr = r.first; + assert(itr->first == 0); + assert(itr->second == 1); + ++itr; + assert(itr->first == 15); + } + + r = db.insert_front(2, 4, 1); + assert(!r.second); + + // Different value segment. This should change the state. + r = db.insert_front(2, 4, 0); + assert(r.second); + + // Ditto. + r = db.insert_front(2, 4, 1); + assert(r.second); + + r = db.insert_front(1, 8, 1); + assert(!r.second); + + // Different value segment. + r = db.insert_front(1, 8, 2); + assert(r.second); + + r = db.insert_front(8, 20, 2); + assert(r.second); + + // The 0-1 segment should still have a value of 1. So this won't change + // the state. + r = db.insert_front(0, 1, 1); + assert(!r.second); + + // Partially out-of-bound segment, but this should modify the value of 0-2. + r = db.insert_front(-50, 2, 10); + assert(r.second); + { + db_type::const_iterator itr = r.first; + assert(itr->first == 0); + assert(itr->second == 10); + ++itr; + assert(itr->first == 2); + } + + // Entirely out-of-bound. + r = db.insert_front(-50, -2, 20); + assert(!r.second); + + // Likewise, partially out-of-bound at the higher end. + r = db.insert_front(800, 1200, 20); + assert(r.second); + + // Entirely out-of-bound. + r = db.insert_front(1300, 1400, 25); + assert(!r.second); +} + +void fst_perf_test_insert_position() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<long, bool> db_type; + typedef std::pair<db_type::const_iterator, bool> ret_type; + long upper = 60000; + { + stack_printer __stack_printer__("::fst_perf_test_insert_position (front)"); + // Much smaller upper boundary because front insertion is very slow. + db_type db(0, upper, false); + bool val = false; + for (long i = 0; i < upper; ++i) + { + db.insert_front(i, i + 1, val); + val = !val; + } + } + + { + stack_printer __stack_printer__("::fst_perf_test_insert_position (back)"); + db_type db(0, upper, false); + bool val = false; + for (long i = 0; i < upper; ++i) + { + db.insert_back(i, i + 1, val); + val = !val; + } + } + + { + db_type db(0, upper, false); + { + stack_printer __stack_printer__("::fst_perf_test_insert_position (position)"); + db_type::const_iterator itr = db.begin(); + bool val = false; + for (long i = 0; i < upper; ++i) + { + ret_type ret = db.insert(itr, i, i + 1, val); + val = !val; + itr = ret.first; + } + } + { + stack_printer __stack_printer__("::fst_perf_test_insert_position (position re-insert)"); + db_type::const_iterator itr = db.begin(); + bool val = true; + for (long i = 0; i < upper; ++i) + { + ret_type ret = db.insert(itr, i, i + 1, val); + val = !val; + itr = ret.first; + } + } + } +} + +void fst_perf_test_position_search() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<long, bool> db_type; + typedef std::pair<db_type::const_iterator, bool> ret_type; + long upper = 60000; + db_type db(0, upper, false); + + // Fill the leaf nodes first. + db_type::const_iterator itr = db.begin(); + bool val = false; + for (long i = 0; i < upper; ++i) + { + ret_type ret = db.insert(itr, i, i + 1, val); + val = !val; + itr = ret.first; + } + + { + stack_printer __stack_printer__("::fst_perf_test_position_search (normal)"); + for (long i = 0; i < upper; ++i) + { + bool val2; + ret_type ret = db.search(i, val2); + assert(ret.second); + } + } + + { + stack_printer __stack_printer__("::fst_perf_test_position_search (positioned)"); + itr = db.begin(); + for (long i = 0; i < upper; ++i) + { + bool val2; + ret_type ret = db.search(itr, i, val2); + assert(ret.second); + itr = ret.first; + } + } +} + +template<typename K, typename V> +bool check_pos_search_result( + const flat_segment_tree<K, V>& db, typename flat_segment_tree<K, V>::const_iterator& itr, K key, K start_expected, + K end_expected, V value_expected) +{ + typedef flat_segment_tree<K, V> db_type; + typedef std::pair<typename db_type::const_iterator, bool> ret_type; + + V _val; + K _start = -1, _end = -1; + + ret_type r = db.search(itr, key, _val, &_start, &_end); + + cout << "expected: start=" << start_expected << " end=" << end_expected << " value=" << value_expected << endl; + cout << "observed: start=" << _start << " end=" << _end << " value=" << _val << endl; + + bool result = _start == start_expected && _end == end_expected && _val == value_expected && + r.first->first == start_expected && r.first->second == value_expected; + itr = r.first; + return result; +} + +void fst_test_position_search() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<long, short> db_type; + typedef std::pair<db_type::const_iterator, bool> ret_type; + + db_type db(0, 100, 0); + db.insert_front(10, 20, 1); + db.insert_front(30, 50, 5); + + db_type db2(-10, 10, 1); + + struct + { + long start_range; + long end_range; + short value_expected; + } params[] = {{0, 10, 0}, {10, 20, 1}, {20, 30, 0}, {30, 50, 5}, {50, 100, 0}}; + + size_t n = std::size(params); + + cout << "Testing for searches with various valid and invalid iterators." << endl; + for (size_t i = 0; i < n; ++i) + { + for (long j = params[i].start_range; j < params[i].end_range; ++j) + { + db_type::const_iterator itr; + bool success = false; + + // empty iterator - should fall back to normal search. + success = check_pos_search_result( + db, itr, j, params[i].start_range, params[i].end_range, params[i].value_expected); + assert(success); + + // iterator returned from the previous search. + success = check_pos_search_result( + db, itr, j, params[i].start_range, params[i].end_range, params[i].value_expected); + assert(success); + + // begin iterator. + itr = db.begin(); + success = check_pos_search_result( + db, itr, j, params[i].start_range, params[i].end_range, params[i].value_expected); + assert(success); + + // end iterator. + itr = db.end(); + success = check_pos_search_result( + db, itr, j, params[i].start_range, params[i].end_range, params[i].value_expected); + assert(success); + + // iterator from another container - should fall back to normal search. + itr = db2.begin(); + success = check_pos_search_result( + db, itr, j, params[i].start_range, params[i].end_range, params[i].value_expected); + assert(success); + } + } + + cout << "Testing for continuous searching by re-using the iteraotr from the previous search." << endl; + db_type::const_iterator itr; + short val; + long start = 0, end = 0; + + for (size_t i = 0; i < n; ++i) + { + ret_type r = db.search(itr, end, val, &start, &end); + assert(start == params[i].start_range); + assert(end == params[i].end_range); + assert(val == params[i].value_expected); + assert(r.second); + itr = r.first; + } +} + +void fst_test_min_max_default() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<long, short> db_type; + db_type db(0, 100, 2); + assert(db.min_key() == 0); + assert(db.max_key() == 100); + assert(db.default_value() == 2); +} + +void fst_test_swap() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<long, int> db_type; + db_type db1(0, 200, 20); + db_type db2(20, 40, 0); + db1.insert_back(20, 30, 1); + db1.insert_back(30, 40, 2); + db1.insert_back(40, 50, 3); + db1.build_tree(); + + // Check the content of db1. + { + db_type::key_type k[] = {0, 20, 30, 40, 50, 200}; + db_type::value_type v[] = {20, 1, 2, 3, 20}; + assert(check_leaf_nodes(db1, k, v, std::size(k))); + } + assert(db1.min_key() == 0); + assert(db1.max_key() == 200); + assert(db1.default_value() == 20); + assert(db1.is_tree_valid()); + + db1.swap(db2); + + // Now db2 should inherit the content of db1. + { + db_type::key_type k[] = {0, 20, 30, 40, 50, 200}; + db_type::value_type v[] = {20, 1, 2, 3, 20}; + assert(check_leaf_nodes(db2, k, v, std::size(k))); + } + assert(db2.min_key() == 0); + assert(db2.max_key() == 200); + assert(db2.default_value() == 20); + assert(db2.is_tree_valid()); + + // Tree search should work on db2. + db_type::value_type val = 0; + assert(db2.search_tree(35, val).second); + assert(val == 2); +} + +void fst_test_swap_tree_memory() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<long, int> db_type; + auto db1 = std::make_unique<db_type>(0, 100, 0); + db1->insert_back(10, 40, 999); + db1->build_tree(); + int value = -1; + db1->search_tree(20, value); + assert(value == 999); + + db_type db2(-10, 10, -99); + db2.swap(*db1); + + db1.reset(); + + // Make sure that the tree is valid, and you can still search through the tree. + assert(db2.is_tree_valid()); + value = -1; + db2.search_tree(20, value); + assert(value == 999); +} + +void fst_test_clear() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<long, int> db_type; + db_type db(0, 100, 42); + db.insert_back(0, 10, 0); + db.insert_back(10, 20, 1); + db.insert_back(20, 30, 2); + db.build_tree(); + + { + db_type::key_type k[] = {0, 10, 20, 30, 100}; + db_type::value_type v[] = {0, 1, 2, 42}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + assert(db.min_key() == 0); + assert(db.max_key() == 100); + assert(db.default_value() == 42); + assert(db.is_tree_valid()); + + db.clear(); + + { + db_type::key_type k[] = {0, 100}; + db_type::value_type v[] = {42}; + assert(check_leaf_nodes(db, k, v, std::size(k))); + } + assert(db.min_key() == 0); + assert(db.max_key() == 100); + assert(db.default_value() == 42); + assert(!db.is_tree_valid()); +} + +void fst_test_assignment() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<long, int> db_type; + db_type db1(0, 100, 42); + db1.insert_back(0, 10, 0); + db1.insert_back(10, 20, 1); + db1.insert_back(20, 30, 2); + db1.build_tree(); + + { + db_type::key_type k[] = {0, 10, 20, 30, 100}; + db_type::value_type v[] = {0, 1, 2, 42}; + assert(check_leaf_nodes(db1, k, v, std::size(k))); + } + assert(db1.min_key() == 0); + assert(db1.max_key() == 100); + assert(db1.default_value() == 42); + assert(db1.is_tree_valid()); + + db_type db2(20, 40, 0); + db2.insert_back(20, 30, 8); + db2.build_tree(); + + { + db_type::key_type k[] = {20, 30, 40}; + db_type::value_type v[] = {8, 0}; + assert(check_leaf_nodes(db2, k, v, std::size(k))); + } + assert(db2.min_key() == 20); + assert(db2.max_key() == 40); + assert(db2.default_value() == 0); + assert(db2.is_tree_valid()); + + db_type db3(10, 80, 4); + db3.build_tree(); + + { + db_type::key_type k[] = {10, 80}; + db_type::value_type v[] = {4}; + assert(check_leaf_nodes(db3, k, v, std::size(k))); + } + assert(db3.min_key() == 10); + assert(db3.max_key() == 80); + assert(db3.default_value() == 4); + assert(db3.is_tree_valid()); + + db3 = db2 = db1; + + { + db_type::key_type k[] = {0, 10, 20, 30, 100}; + db_type::value_type v[] = {0, 1, 2, 42}; + assert(check_leaf_nodes(db1, k, v, std::size(k))); + } + assert(db1.min_key() == 0); + assert(db1.max_key() == 100); + assert(db1.default_value() == 42); + assert(db1.is_tree_valid()); + + { + db_type::key_type k[] = {0, 10, 20, 30, 100}; + db_type::value_type v[] = {0, 1, 2, 42}; + assert(check_leaf_nodes(db2, k, v, std::size(k))); + } + assert(db2.min_key() == 0); + assert(db2.max_key() == 100); + assert(db2.default_value() == 42); + assert(!db2.is_tree_valid()); + + { + db_type::key_type k[] = {0, 10, 20, 30, 100}; + db_type::value_type v[] = {0, 1, 2, 42}; + assert(check_leaf_nodes(db3, k, v, std::size(k))); + } + assert(db3.min_key() == 0); + assert(db3.max_key() == 100); + assert(db3.default_value() == 42); + assert(!db3.is_tree_valid()); +} + +void fst_test_move_assignment() +{ + MDDS_TEST_FUNC_SCOPE; + + using container_type = flat_segment_tree<uint32_t, std::string>; + container_type src{0, 100, "base"}; + container_type moved{10, 200, "base2"}; + moved = std::move(src); + + assert(moved.min_key() == 0); + assert(moved.max_key() == 100); + assert(moved.default_value() == "base"); + assert(moved.leaf_size() == 2); + assert(!moved.is_tree_valid()); + + moved.insert_back(10, 25, "10-25"); + moved.build_tree(); + assert(moved.is_tree_valid()); + assert(moved.leaf_size() == 4); + + container_type moved2{30, 450, "base3"}; + moved2 = std::move(moved); + assert(moved2.min_key() == 0); + assert(moved2.max_key() == 100); + assert(moved2.default_value() == "base"); + assert(moved2.leaf_size() == 4); + assert(moved2.is_tree_valid()); + + // Make sure we can perform tree search. + std::string v; + uint32_t key1, key2; + auto res = moved2.search_tree(20, v, &key1, &key2); + assert(res.second); + assert(v == "10-25"); + assert(key1 == 10); + assert(key2 == 25); +} + +void fst_test_non_numeric_value() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<int, std::string> db_type; + db_type db(0, 4, "42"); + db.insert_back(1, 2, "hello world"); + + assert(db.default_value() == "42"); + + std::string result; + db.search(1, result); + + assert(result == "hello world"); + + db_type db2(db); + + assert(db == db2); +} + +void fst_test_insert_out_of_bound() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<int, bool> db_type; + db_type db(0, 10, false); + + // An out-of-bound range, whether it's in part or in its entirety, should + // be handled gracefully without throwing exceptions or causing segfaults. + + // ranges that are entirely out-of-bound. + + auto ret = db.insert_front(-10, -8, false); + assert(!ret.second); + db.insert_back(12, 13, false); + assert(!ret.second); + + db_type::const_iterator pos = db.end(); + + ret = db.insert(pos, -10, -8, false); + assert(!ret.second); + pos = ret.first; + + ret = db.insert(pos, 12, 13, false); + assert(!ret.second); + pos = ret.first; + + // partial overflows. + + ret = db.insert(pos, -2, 2, true); + assert(ret.second); // content modified + pos = ret.first; + + ret = db.insert(pos, 8, 20, true); + assert(ret.second); // content modified + pos = ret.first; +} + +void fst_test_insert_out_of_bound_2() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<int, bool> db_type; + db_type db(0, 256, false); + + // The range is entirely out-of-bound, but the start range equals the + // upper bound of the valid range. + auto ret = db.insert_back(256, 1024, true); + + // Insertion never took place. + assert(ret.first == db.end()); + assert(!ret.second); +} + +void fst_test_segment_iterator() +{ + MDDS_TEST_FUNC_SCOPE; + + typedef flat_segment_tree<int16_t, bool> db_type; + db_type db(0, 100, false); + + db_type::const_segment_iterator it = db.begin_segment(); + db_type::const_segment_iterator ite = db.end_segment(); + + assert(it != ite); + assert(it->start == 0); + assert(it->end == 100); + assert(it->value == false); + + const auto& v = *it; + assert(v.start == 0); + assert(v.end == 100); + assert(v.value == false); + + ++it; + assert(it == ite); + + --it; + assert(it != ite); + assert(it->start == 0); + assert(it->end == 100); + assert(it->value == false); + + db_type::const_segment_iterator it2; // default constructor + it2 = it; // assignment operator + assert(it2 == it); + assert(it2->start == 0); + assert(it2->end == 100); + assert(it2->value == false); + + auto it3(it2); // copy constructor + assert(it3 == it2); + assert(it3->start == 0); + assert(it3->end == 100); + assert(it3->value == false); + + db.insert_back(20, 50, true); // this invalidates the iterators. + + it = db.begin_segment(); + ite = db.end_segment(); + + assert(it->start == 0); + assert(it->end == 20); + assert(it->value == false); + + it2 = it++; // post-increment + + assert(it2->start == 0); + assert(it2->end == 20); + assert(it2->value == false); + + assert(it->start == 20); + assert(it->end == 50); + assert(it->value == true); + + ++it; + assert(it->start == 50); + assert(it->end == 100); + assert(it->value == false); + + ++it; + assert(it == ite); + + it2 = it--; // post-decrement. + assert(it2 == ite); + + it = db.begin_segment(); + auto it_moved{std::move(it)}; // move construction + + assert(it_moved->start == 0); + assert(it_moved->end == 20); + assert(it_moved->value == false); +} + +void fst_test_segment_range() +{ + MDDS_TEST_FUNC_SCOPE; + + using container_type = mdds::flat_segment_tree<int32_t, std::string>; + using node_type = container_type::const_segment_iterator::value_type; + + { + container_type db{0, 100, "-"}; + + const std::vector<node_type> expected = { + {0, 100, "-"}, + }; + + std::cout << "--" << std::endl; + + std::vector<node_type> actual; + for (const node_type& v : db.segment_range()) + { + std::cout << "start=" << v.start << "; end=" << v.end << "; value='" << v.value << "'" << std::endl; + actual.push_back(v); + } + + assert(expected == actual); + } + + { + container_type db{0, 100, "-"}; + db.insert_back(10, 25, "10-25"); + + const std::vector<node_type> expected = { + {0, 10, "-"}, + {10, 25, "10-25"}, + {25, 100, "-"}, + }; + + std::cout << "--" << std::endl; + + std::vector<node_type> actual; + for (const node_type& v : db.segment_range()) + { + std::cout << "start=" << v.start << "; end=" << v.end << "; value='" << v.value << "'" << std::endl; + actual.push_back(v); + } + + assert(expected == actual); + + // Use it with structured binding + std::cout << "--" << std::endl; + actual.clear(); + for (const auto& [start, end, value] : db.segment_range()) + { + std::cout << "start=" << start << "; end=" << end << "; value='" << value << "'" << std::endl; + actual.emplace_back(start, end, value); + } + + assert(expected == actual); + } +} + +class custom_key_type +{ + long value; + +public: + custom_key_type() : value(0) + {} + custom_key_type(const std::string& src) : value(std::stol(src)) + {} + + bool operator==(const custom_key_type& other) const + { + return value == other.value; + } + + bool operator!=(const custom_key_type& other) const + { + return !operator==(other); + } + + bool operator<(const custom_key_type& other) const + { + return value < other.value; + } + + bool operator<=(const custom_key_type& other) const + { + return value <= other.value; + } + +#if 0 // intentionally not implementing these operators + bool operator>(const custom_key_type& other) const + { + return value > other.value; + } + + bool operator>=(const custom_key_type& other) const + { + return value >= other.value; + } +#endif +}; + +void fst_test_custom_key_type() +{ + MDDS_TEST_FUNC_SCOPE; + + using container_type = mdds::flat_segment_tree<custom_key_type, std::string>; + using node_type = container_type::const_segment_iterator::value_type; + + container_type db(custom_key_type{"0"}, custom_key_type{"123"}, "-"); + + db.insert_back(custom_key_type{"10"}, custom_key_type{"45"}, "10-45"); + + const std::vector<node_type> expected = { + {custom_key_type{"0"}, custom_key_type{"10"}, "-"}, + {custom_key_type{"10"}, custom_key_type{"45"}, "10-45"}, + {custom_key_type{"45"}, custom_key_type{"123"}, "-"}, + }; + + std::vector<node_type> actual; + + for (const node_type& v : db.segment_range()) + actual.push_back(v); + + assert(expected == actual); +} + +int main(int argc, char** argv) +{ + try + { + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; + + if (opt.test_func) + { + fst_test_equality(); + fst_test_copy_ctor(); + fst_test_move_ctor(); + fst_test_back_insert(); + { + typedef unsigned int key_type; + typedef unsigned short value_type; + for (value_type i = 0; i <= 100; ++i) + fst_test_insert_front_back<key_type, value_type>(0, 100, i); + } + + { + typedef int key_type; + typedef short value_type; + for (value_type i = 0; i <= 100; ++i) + fst_test_insert_front_back<key_type, value_type>(0, 100, i); + } + + { + typedef long key_type; + typedef unsigned int value_type; + for (value_type i = 0; i <= 100; ++i) + fst_test_insert_front_back<key_type, value_type>(0, 100, i); + } + + fst_test_leaf_search(); + fst_test_leaf_search_2(); + fst_test_tree_build(); + fst_test_tree_search(); + fst_test_tree_search_2(); + fst_test_insert_search_mix(); + fst_test_shift_left(); + fst_test_shift_left_right_edge(); + fst_test_shift_left_append_new_segment(); + fst_test_shift_right_init0(); + fst_test_shift_right_init999(); + fst_test_shift_right_bool(); + fst_test_shift_right_skip_start_node(); + fst_test_shift_right_all_nodes(); + fst_test_const_iterator(); + fst_test_insert_iterator(); + fst_test_insert_state_changed(); + fst_test_position_search(); + fst_test_min_max_default(); + fst_test_swap(); + fst_test_swap_tree_memory(); + fst_test_clear(); + fst_test_assignment(); + fst_test_move_assignment(); + fst_test_non_numeric_value(); + fst_test_insert_out_of_bound(); + fst_test_insert_out_of_bound_2(); + fst_test_segment_iterator(); + fst_test_segment_range(); + fst_test_custom_key_type(); + } + + if (opt.test_perf) + { + fst_perf_test_search_leaf(); + fst_perf_test_search_tree(); + fst_perf_test_insert_front_back(); + fst_perf_test_insert_position(); + fst_perf_test_position_search(); + } + } + catch (const std::exception& e) + { + fprintf(stdout, "Test failed: %s\n", e.what()); + return EXIT_FAILURE; + } + + fprintf(stdout, "Test finished successfully!\n"); + return 0; +} diff --git a/test/gdb/Makefile.am b/test/gdb/Makefile.am new file mode 100644 index 0000000..555e093 --- /dev/null +++ b/test/gdb/Makefile.am @@ -0,0 +1,14 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = src + +AUTOMAKE_OPTIONS = dejagnu + +CLEANFILES = *.log *.sum + +RUNTEST = $(RUNTEST_BIN) +AM_RUNTESTFLAGS = BINFILE=src/test GDB=$(GDB) + +export PYTHONPATH=$(top_srcdir)/misc/gdb + +## vim: set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/test/gdb/Makefile.in b/test/gdb/Makefile.in new file mode 100644 index 0000000..b8df454 --- /dev/null +++ b/test/gdb/Makefile.in @@ -0,0 +1,688 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/gdb +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +DEJATOOL = $(PACKAGE) +RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = src +AUTOMAKE_OPTIONS = dejagnu +CLEANFILES = *.log *.sum +RUNTEST = $(RUNTEST_BIN) +AM_RUNTESTFLAGS = BINFILE=src/test GDB=$(GDB) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/gdb/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/gdb/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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-DEJAGNU: site.exp + srcdir='$(srcdir)'; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ + if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \ + exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \ + if $(RUNTEST) $(RUNTESTDEFAULTFLAGS) $(AM_RUNTESTFLAGS) $(RUNTESTFLAGS); \ + then :; else exit_status=1; fi; \ + done; \ + else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\ + fi; \ + exit $$exit_status +site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) + @echo 'Making a new site.exp file ...' + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir "$(srcdir)"' >>site.tmp + @echo "set objdir \"`pwd`\"" >>site.tmp + @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ + echo "## Begin content included from file $$f. Do not modify. ##" \ + && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ + && echo "## End content included from file $$f. ##" \ + || exit 1; \ + done >> site.tmp + @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp + @if test -f site.exp; then \ + sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \ + fi + @-rm -f site.bak + @test ! -f site.exp || mv site.exp site.bak + @mv site.tmp site.exp + +distclean-DEJAGNU: + -rm -f site.exp site.bak + -l='$(DEJATOOL)'; for tool in $$l; do \ + rm -f $$tool.sum $$tool.log; \ + done +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-DEJAGNU distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) check-am install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-DEJAGNU check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-DEJAGNU distclean-generic 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 install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +export PYTHONPATH=$(top_srcdir)/misc/gdb + +# 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/test/gdb/src/Makefile.am b/test/gdb/src/Makefile.am new file mode 100644 index 0000000..5088c6e --- /dev/null +++ b/test/gdb/src/Makefile.am @@ -0,0 +1,16 @@ +CXXFLAGS += -O0 -ggdb2 + +check_PROGRAMS = test + +test_CPPFLAGS = -I$(top_srcdir)/include + +test_SOURCES = \ + flat_segment_tree.cpp \ + multi_type_matrix.cpp \ + multi_type_vector.cpp \ + point_quad_tree.cpp \ + rtree.cpp \ + segment_tree.cpp \ + sorted_string_map.cpp \ + test.cpp \ + trie_map.cpp diff --git a/test/gdb/src/Makefile.in b/test/gdb/src/Makefile.in new file mode 100644 index 0000000..84cc213 --- /dev/null +++ b/test/gdb/src/Makefile.in @@ -0,0 +1,764 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test$(EXEEXT) +subdir = test/gdb/src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_test_OBJECTS = test-flat_segment_tree.$(OBJEXT) \ + test-multi_type_matrix.$(OBJEXT) \ + test-multi_type_vector.$(OBJEXT) \ + test-point_quad_tree.$(OBJEXT) test-rtree.$(OBJEXT) \ + test-segment_tree.$(OBJEXT) test-sorted_string_map.$(OBJEXT) \ + test-test.$(OBJEXT) test-trie_map.$(OBJEXT) +test_OBJECTS = $(am_test_OBJECTS) +test_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/test-flat_segment_tree.Po \ + ./$(DEPDIR)/test-multi_type_matrix.Po \ + ./$(DEPDIR)/test-multi_type_vector.Po \ + ./$(DEPDIR)/test-point_quad_tree.Po ./$(DEPDIR)/test-rtree.Po \ + ./$(DEPDIR)/test-segment_tree.Po \ + ./$(DEPDIR)/test-sorted_string_map.Po ./$(DEPDIR)/test-test.Po \ + ./$(DEPDIR)/test-trie_map.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_SOURCES) +DIST_SOURCES = $(test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ -O0 -ggdb2 +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +test_CPPFLAGS = -I$(top_srcdir)/include +test_SOURCES = \ + flat_segment_tree.cpp \ + multi_type_matrix.cpp \ + multi_type_vector.cpp \ + point_quad_tree.cpp \ + rtree.cpp \ + segment_tree.cpp \ + sorted_string_map.cpp \ + test.cpp \ + trie_map.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/gdb/src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/gdb/src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + +test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) + @rm -f test$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-flat_segment_tree.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-multi_type_matrix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-multi_type_vector.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-point_quad_tree.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rtree.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-segment_tree.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sorted_string_map.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-trie_map.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test-flat_segment_tree.o: flat_segment_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-flat_segment_tree.o -MD -MP -MF $(DEPDIR)/test-flat_segment_tree.Tpo -c -o test-flat_segment_tree.o `test -f 'flat_segment_tree.cpp' || echo '$(srcdir)/'`flat_segment_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-flat_segment_tree.Tpo $(DEPDIR)/test-flat_segment_tree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='flat_segment_tree.cpp' object='test-flat_segment_tree.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-flat_segment_tree.o `test -f 'flat_segment_tree.cpp' || echo '$(srcdir)/'`flat_segment_tree.cpp + +test-flat_segment_tree.obj: flat_segment_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-flat_segment_tree.obj -MD -MP -MF $(DEPDIR)/test-flat_segment_tree.Tpo -c -o test-flat_segment_tree.obj `if test -f 'flat_segment_tree.cpp'; then $(CYGPATH_W) 'flat_segment_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/flat_segment_tree.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-flat_segment_tree.Tpo $(DEPDIR)/test-flat_segment_tree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='flat_segment_tree.cpp' object='test-flat_segment_tree.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-flat_segment_tree.obj `if test -f 'flat_segment_tree.cpp'; then $(CYGPATH_W) 'flat_segment_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/flat_segment_tree.cpp'; fi` + +test-multi_type_matrix.o: multi_type_matrix.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-multi_type_matrix.o -MD -MP -MF $(DEPDIR)/test-multi_type_matrix.Tpo -c -o test-multi_type_matrix.o `test -f 'multi_type_matrix.cpp' || echo '$(srcdir)/'`multi_type_matrix.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-multi_type_matrix.Tpo $(DEPDIR)/test-multi_type_matrix.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='multi_type_matrix.cpp' object='test-multi_type_matrix.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-multi_type_matrix.o `test -f 'multi_type_matrix.cpp' || echo '$(srcdir)/'`multi_type_matrix.cpp + +test-multi_type_matrix.obj: multi_type_matrix.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-multi_type_matrix.obj -MD -MP -MF $(DEPDIR)/test-multi_type_matrix.Tpo -c -o test-multi_type_matrix.obj `if test -f 'multi_type_matrix.cpp'; then $(CYGPATH_W) 'multi_type_matrix.cpp'; else $(CYGPATH_W) '$(srcdir)/multi_type_matrix.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-multi_type_matrix.Tpo $(DEPDIR)/test-multi_type_matrix.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='multi_type_matrix.cpp' object='test-multi_type_matrix.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-multi_type_matrix.obj `if test -f 'multi_type_matrix.cpp'; then $(CYGPATH_W) 'multi_type_matrix.cpp'; else $(CYGPATH_W) '$(srcdir)/multi_type_matrix.cpp'; fi` + +test-multi_type_vector.o: multi_type_vector.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-multi_type_vector.o -MD -MP -MF $(DEPDIR)/test-multi_type_vector.Tpo -c -o test-multi_type_vector.o `test -f 'multi_type_vector.cpp' || echo '$(srcdir)/'`multi_type_vector.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-multi_type_vector.Tpo $(DEPDIR)/test-multi_type_vector.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='multi_type_vector.cpp' object='test-multi_type_vector.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-multi_type_vector.o `test -f 'multi_type_vector.cpp' || echo '$(srcdir)/'`multi_type_vector.cpp + +test-multi_type_vector.obj: multi_type_vector.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-multi_type_vector.obj -MD -MP -MF $(DEPDIR)/test-multi_type_vector.Tpo -c -o test-multi_type_vector.obj `if test -f 'multi_type_vector.cpp'; then $(CYGPATH_W) 'multi_type_vector.cpp'; else $(CYGPATH_W) '$(srcdir)/multi_type_vector.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-multi_type_vector.Tpo $(DEPDIR)/test-multi_type_vector.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='multi_type_vector.cpp' object='test-multi_type_vector.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-multi_type_vector.obj `if test -f 'multi_type_vector.cpp'; then $(CYGPATH_W) 'multi_type_vector.cpp'; else $(CYGPATH_W) '$(srcdir)/multi_type_vector.cpp'; fi` + +test-point_quad_tree.o: point_quad_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-point_quad_tree.o -MD -MP -MF $(DEPDIR)/test-point_quad_tree.Tpo -c -o test-point_quad_tree.o `test -f 'point_quad_tree.cpp' || echo '$(srcdir)/'`point_quad_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-point_quad_tree.Tpo $(DEPDIR)/test-point_quad_tree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='point_quad_tree.cpp' object='test-point_quad_tree.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-point_quad_tree.o `test -f 'point_quad_tree.cpp' || echo '$(srcdir)/'`point_quad_tree.cpp + +test-point_quad_tree.obj: point_quad_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-point_quad_tree.obj -MD -MP -MF $(DEPDIR)/test-point_quad_tree.Tpo -c -o test-point_quad_tree.obj `if test -f 'point_quad_tree.cpp'; then $(CYGPATH_W) 'point_quad_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/point_quad_tree.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-point_quad_tree.Tpo $(DEPDIR)/test-point_quad_tree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='point_quad_tree.cpp' object='test-point_quad_tree.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-point_quad_tree.obj `if test -f 'point_quad_tree.cpp'; then $(CYGPATH_W) 'point_quad_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/point_quad_tree.cpp'; fi` + +test-rtree.o: rtree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-rtree.o -MD -MP -MF $(DEPDIR)/test-rtree.Tpo -c -o test-rtree.o `test -f 'rtree.cpp' || echo '$(srcdir)/'`rtree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-rtree.Tpo $(DEPDIR)/test-rtree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='rtree.cpp' object='test-rtree.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-rtree.o `test -f 'rtree.cpp' || echo '$(srcdir)/'`rtree.cpp + +test-rtree.obj: rtree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-rtree.obj -MD -MP -MF $(DEPDIR)/test-rtree.Tpo -c -o test-rtree.obj `if test -f 'rtree.cpp'; then $(CYGPATH_W) 'rtree.cpp'; else $(CYGPATH_W) '$(srcdir)/rtree.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-rtree.Tpo $(DEPDIR)/test-rtree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='rtree.cpp' object='test-rtree.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-rtree.obj `if test -f 'rtree.cpp'; then $(CYGPATH_W) 'rtree.cpp'; else $(CYGPATH_W) '$(srcdir)/rtree.cpp'; fi` + +test-segment_tree.o: segment_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-segment_tree.o -MD -MP -MF $(DEPDIR)/test-segment_tree.Tpo -c -o test-segment_tree.o `test -f 'segment_tree.cpp' || echo '$(srcdir)/'`segment_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-segment_tree.Tpo $(DEPDIR)/test-segment_tree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='segment_tree.cpp' object='test-segment_tree.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-segment_tree.o `test -f 'segment_tree.cpp' || echo '$(srcdir)/'`segment_tree.cpp + +test-segment_tree.obj: segment_tree.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-segment_tree.obj -MD -MP -MF $(DEPDIR)/test-segment_tree.Tpo -c -o test-segment_tree.obj `if test -f 'segment_tree.cpp'; then $(CYGPATH_W) 'segment_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/segment_tree.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-segment_tree.Tpo $(DEPDIR)/test-segment_tree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='segment_tree.cpp' object='test-segment_tree.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-segment_tree.obj `if test -f 'segment_tree.cpp'; then $(CYGPATH_W) 'segment_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/segment_tree.cpp'; fi` + +test-sorted_string_map.o: sorted_string_map.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-sorted_string_map.o -MD -MP -MF $(DEPDIR)/test-sorted_string_map.Tpo -c -o test-sorted_string_map.o `test -f 'sorted_string_map.cpp' || echo '$(srcdir)/'`sorted_string_map.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-sorted_string_map.Tpo $(DEPDIR)/test-sorted_string_map.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sorted_string_map.cpp' object='test-sorted_string_map.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-sorted_string_map.o `test -f 'sorted_string_map.cpp' || echo '$(srcdir)/'`sorted_string_map.cpp + +test-sorted_string_map.obj: sorted_string_map.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-sorted_string_map.obj -MD -MP -MF $(DEPDIR)/test-sorted_string_map.Tpo -c -o test-sorted_string_map.obj `if test -f 'sorted_string_map.cpp'; then $(CYGPATH_W) 'sorted_string_map.cpp'; else $(CYGPATH_W) '$(srcdir)/sorted_string_map.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-sorted_string_map.Tpo $(DEPDIR)/test-sorted_string_map.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sorted_string_map.cpp' object='test-sorted_string_map.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-sorted_string_map.obj `if test -f 'sorted_string_map.cpp'; then $(CYGPATH_W) 'sorted_string_map.cpp'; else $(CYGPATH_W) '$(srcdir)/sorted_string_map.cpp'; fi` + +test-test.o: test.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-test.o -MD -MP -MF $(DEPDIR)/test-test.Tpo -c -o test-test.o `test -f 'test.cpp' || echo '$(srcdir)/'`test.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-test.Tpo $(DEPDIR)/test-test.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test.cpp' object='test-test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-test.o `test -f 'test.cpp' || echo '$(srcdir)/'`test.cpp + +test-test.obj: test.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-test.obj -MD -MP -MF $(DEPDIR)/test-test.Tpo -c -o test-test.obj `if test -f 'test.cpp'; then $(CYGPATH_W) 'test.cpp'; else $(CYGPATH_W) '$(srcdir)/test.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-test.Tpo $(DEPDIR)/test-test.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test.cpp' object='test-test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-test.obj `if test -f 'test.cpp'; then $(CYGPATH_W) 'test.cpp'; else $(CYGPATH_W) '$(srcdir)/test.cpp'; fi` + +test-trie_map.o: trie_map.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-trie_map.o -MD -MP -MF $(DEPDIR)/test-trie_map.Tpo -c -o test-trie_map.o `test -f 'trie_map.cpp' || echo '$(srcdir)/'`trie_map.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-trie_map.Tpo $(DEPDIR)/test-trie_map.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='trie_map.cpp' object='test-trie_map.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-trie_map.o `test -f 'trie_map.cpp' || echo '$(srcdir)/'`trie_map.cpp + +test-trie_map.obj: trie_map.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-trie_map.obj -MD -MP -MF $(DEPDIR)/test-trie_map.Tpo -c -o test-trie_map.obj `if test -f 'trie_map.cpp'; then $(CYGPATH_W) 'trie_map.cpp'; else $(CYGPATH_W) '$(srcdir)/trie_map.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-trie_map.Tpo $(DEPDIR)/test-trie_map.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='trie_map.cpp' object='test-trie_map.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-trie_map.obj `if test -f 'trie_map.cpp'; then $(CYGPATH_W) 'trie_map.cpp'; else $(CYGPATH_W) '$(srcdir)/trie_map.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/test-flat_segment_tree.Po + -rm -f ./$(DEPDIR)/test-multi_type_matrix.Po + -rm -f ./$(DEPDIR)/test-multi_type_vector.Po + -rm -f ./$(DEPDIR)/test-point_quad_tree.Po + -rm -f ./$(DEPDIR)/test-rtree.Po + -rm -f ./$(DEPDIR)/test-segment_tree.Po + -rm -f ./$(DEPDIR)/test-sorted_string_map.Po + -rm -f ./$(DEPDIR)/test-test.Po + -rm -f ./$(DEPDIR)/test-trie_map.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/test-flat_segment_tree.Po + -rm -f ./$(DEPDIR)/test-multi_type_matrix.Po + -rm -f ./$(DEPDIR)/test-multi_type_vector.Po + -rm -f ./$(DEPDIR)/test-point_quad_tree.Po + -rm -f ./$(DEPDIR)/test-rtree.Po + -rm -f ./$(DEPDIR)/test-segment_tree.Po + -rm -f ./$(DEPDIR)/test-sorted_string_map.Po + -rm -f ./$(DEPDIR)/test-test.Po + -rm -f ./$(DEPDIR)/test-trie_map.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ + check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/gdb/src/flat_segment_tree.cpp b/test/gdb/src/flat_segment_tree.cpp new file mode 100644 index 0000000..be4817e --- /dev/null +++ b/test/gdb/src/flat_segment_tree.cpp @@ -0,0 +1,52 @@ +/* Test code for mdds::flat_segment_tree. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <string> + +#include <mdds/flat_segment_tree.hpp> + +void stop(); + +using std::string; + +using mdds::flat_segment_tree; + +void test_flat_segment_tree() +{ + flat_segment_tree<int, int> default_fst(0, 100, 42); + + flat_segment_tree<int, int> fst_int(0, 100, 42); + fst_int.insert_back(0, 20, 1); + fst_int.insert_back(40, 60, 0); + + flat_segment_tree<int, string> fst_string(10, 50, "42"); + fst_string.insert_back(20, 30, "My hovercraft is full of eels"); + + flat_segment_tree<int, int>::const_iterator fst_iter_singular; + auto fst_iter1 = fst_int.begin(); + auto fst_iter2 = fst_iter1; + ++fst_iter2; + + flat_segment_tree<int, int>::const_segment_iterator fst_seg_iter_singular; + auto fst_seg_iter1 = fst_int.begin_segment(); + auto fst_seg_iter2 = fst_seg_iter1; + ++fst_seg_iter2; + + stop(); +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/gdb/src/multi_type_matrix.cpp b/test/gdb/src/multi_type_matrix.cpp new file mode 100644 index 0000000..2f0a4df --- /dev/null +++ b/test/gdb/src/multi_type_matrix.cpp @@ -0,0 +1,41 @@ +/* Test code for mdds::multi_type_matrix. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <mdds/multi_type_matrix.hpp> + +void stop(); + +using mdds::multi_type_matrix; + +void test_multi_type_matrix() +{ + typedef mdds::multi_type_matrix<mdds::mtm::std_string_traits> mtm_type; + + mtm_type empty_mtm; + + mtm_type mtm(4, 2); + mtm.set(1, 0, 1); + mtm.set(2, 0, 2); + mtm.set(3, 0, std::string("a")); + mtm.set(0, 1, std::string("b")); + mtm.set(1, 1, true); + mtm.set(3, 1, 0.5); + + stop(); +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/gdb/src/multi_type_vector.cpp b/test/gdb/src/multi_type_vector.cpp new file mode 100644 index 0000000..fc24b7b --- /dev/null +++ b/test/gdb/src/multi_type_vector.cpp @@ -0,0 +1,73 @@ +/* Test code for mdds::multi_type_vector. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <string> + +#include <mdds/multi_type_vector.hpp> + +void stop(); + +using mdds::multi_type_vector; + +void test_multi_type_vector() +{ + typedef mdds::multi_type_vector<mdds::mtv::standard_element_blocks_traits> mtv_type; + + mtv_type empty_mtv; + + mtv_type mtv_int; + mtv_int.push_back<int>(1); + mtv_int.push_back<int>(2); + mtv_int.push_back<int>(3); + mtv_int.push_back<int>(4); + + mtv_type mtv_string; + mtv_string.push_back<std::string>("ab"); + mtv_string.push_back<std::string>("c"); + + mtv_type mtv_int_string(mtv_int); + mtv_int_string.push_back<std::string>("ab"); + mtv_int_string.push_back<std::string>("c"); + mtv_int_string.push_back<int>(7); + mtv_int_string.push_back<int>(8); + + mtv_type mtv_default(2); + + auto mtv_iter_begin = mtv_int_string.begin(); + auto mtv_iter_next = ++mtv_int_string.begin(); + auto mtv_iter_end = mtv_int_string.end(); + (void)mtv_iter_begin; + (void)mtv_iter_next; + (void)mtv_iter_end; + + auto mtv_iter_cbegin = mtv_int_string.cbegin(); + auto mtv_iter_cend = mtv_int_string.cend(); + (void)mtv_iter_cbegin; + (void)mtv_iter_cend; + + auto mtv_iter_rbegin = mtv_int_string.rbegin(); + auto mtv_iter_rend = mtv_int_string.rend(); + (void)mtv_iter_rbegin; + (void)mtv_iter_rend; + + auto mtv_iter_default = mtv_default.begin(); + (void)mtv_iter_default; + + stop(); +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/gdb/src/point_quad_tree.cpp b/test/gdb/src/point_quad_tree.cpp new file mode 100644 index 0000000..1d5497e --- /dev/null +++ b/test/gdb/src/point_quad_tree.cpp @@ -0,0 +1,49 @@ +/* Test code for mdds::point_quad_tree. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <mdds/point_quad_tree.hpp> + +void stop(); + +using mdds::point_quad_tree; + +void test_point_quad_tree() +{ + point_quad_tree<int, int> empty_pqt; + + point_quad_tree<int, int> pqt_int; + pqt_int.insert(10, 20, 1); + pqt_int.insert(15, 8, 2); + pqt_int.insert(25, 12, 3); + pqt_int.insert(15, 12, 4); + + point_quad_tree<unsigned, std::string> pqt_string; + pqt_string.insert(25, 32, "a"); + pqt_string.insert(5, 45, "b"); + pqt_string.insert(52, 10, "c"); + pqt_string.insert(80, 5, "d"); + pqt_string.insert(40, 50, "e"); + pqt_string.insert(10, 10, "f"); + + auto pqt_search_empty = pqt_int.search_region(0, 2, 3, 4); + auto pqt_search_one = pqt_int.search_region(0, 15, 10, 25); + auto pqt_search_more = pqt_int.search_region(0, 10, 15, 25); + + stop(); +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/gdb/src/rtree.cpp b/test/gdb/src/rtree.cpp new file mode 100644 index 0000000..431c944 --- /dev/null +++ b/test/gdb/src/rtree.cpp @@ -0,0 +1,49 @@ +/* Test code for mdds::rtree. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <string> + +#include <mdds/rtree.hpp> + +void stop(); + +using mdds::rtree; + +void test_rtree() +{ + using tree_type = rtree<int, std::string>; + + tree_type empty_tree; + + tree_type tree; + tree.insert({{0, 1}, {2, 4}}, "a"); + tree.insert({{-3, 3}, {5, 8}}, "bc"); + tree.insert({{-2, 1}, {3, 6}}, "d"); + + auto search_empty = tree.search({{0, 0}, {0, 0}}, tree_type::search_type::match); + auto search_one = tree.search({{0, 1}, {2, 4}}, tree_type::search_type::match); + auto search_more = tree.search({{0, 0}, {1, 5}}, tree_type::search_type::overlap); + + auto iter_begin = search_one.begin(); + auto iter_end = search_one.end(); + (void)iter_begin; + (void)iter_end; + + stop(); +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/gdb/src/segment_tree.cpp b/test/gdb/src/segment_tree.cpp new file mode 100644 index 0000000..7d45e10 --- /dev/null +++ b/test/gdb/src/segment_tree.cpp @@ -0,0 +1,49 @@ +/* Test code for mdds::segment_tree. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <string> + +#include <mdds/segment_tree.hpp> + +void stop(); + +using std::string; + +using mdds::segment_tree; + +void test_segment_tree() +{ + segment_tree<int, int> empty_st; + + segment_tree<int, int> st_int; + st_int.insert(0, 10, 1); + st_int.insert(5, 20, 2); + st_int.insert(40, 50, 3); + st_int.insert(-10, 20, 0); + + segment_tree<int, string> st_string; + st_string.insert(20, 30, "My hovercraft is full of eels"); + + st_int.build_tree(); + auto search_none = st_int.search(25); + auto search_one = st_int.search(42); + auto search_more = st_int.search(8); + + stop(); +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/gdb/src/sorted_string_map.cpp b/test/gdb/src/sorted_string_map.cpp new file mode 100644 index 0000000..8fa3b67 --- /dev/null +++ b/test/gdb/src/sorted_string_map.cpp @@ -0,0 +1,41 @@ +/* Test code for mdds::sorted_string_map. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <mdds/global.hpp> +#include <mdds/sorted_string_map.hpp> + +void stop(); + +using mdds::sorted_string_map; + +void test_sorted_string_map() +{ + sorted_string_map<int> empty_ssmap(nullptr, 0, 0); + + sorted_string_map<int>::entry entries[] = { + {MDDS_ASCII("aaaa"), 1}, + {MDDS_ASCII("bbb"), 2}, + {MDDS_ASCII("cc"), 3}, + {MDDS_ASCII("d"), 4}, + }; + size_t entry_count = sizeof(entries) / sizeof(entries[0]); + sorted_string_map<int> ssmap_int(entries, entry_count, 0); + + stop(); +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/gdb/src/test.cpp b/test/gdb/src/test.cpp new file mode 100644 index 0000000..83dd269 --- /dev/null +++ b/test/gdb/src/test.cpp @@ -0,0 +1,49 @@ +/* Test suite for gdb pretty printers. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +// forward decls. of tests +void test_flat_segment_tree(); +void test_multi_type_matrix(); +void test_multi_type_vector(); +void test_point_quad_tree(); +void test_rtree(); +void test_segment_tree(); +void test_sorted_string_map(); +void test_trie_map(); + +void stop() +{} + +int main() +try +{ + test_flat_segment_tree(); + test_multi_type_matrix(); + test_multi_type_vector(); + test_point_quad_tree(); + test_rtree(); + test_segment_tree(); + test_sorted_string_map(); + test_trie_map(); + return 0; +} +catch (...) +{ + return -1; +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/gdb/src/trie_map.cpp b/test/gdb/src/trie_map.cpp new file mode 100644 index 0000000..4029edc --- /dev/null +++ b/test/gdb/src/trie_map.cpp @@ -0,0 +1,83 @@ +/* Test code for mdds::trie_map. + + This file is part of mdds. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <mdds/global.hpp> +#include <mdds/trie_map.hpp> + +void stop(); + +namespace trie = mdds::trie; + +using mdds::packed_trie_map; +using mdds::trie_map; + +void test_trie_map() +{ + trie_map<trie::std_string_traits, int> empty_tm; + + trie_map<trie::std_string_traits, int> tm_int; + tm_int.insert("a", 13); + tm_int.insert("aa", 10); + tm_int.insert("ab", 3); + tm_int.insert("b", 7); + + trie_map<trie::std_string_traits, std::string> tm_str; + tm_str.insert("a", "13"); + tm_str.insert("aa", "10"); + tm_str.insert("ab", "3"); + tm_str.insert("b", "7"); + + auto tm_search_empty = tm_int.prefix_search("foo"); + auto tm_search_one = tm_int.prefix_search("b"); + auto tm_search_more = tm_int.prefix_search("a"); + + auto tm_iter_begin = tm_int.begin(); + auto tm_iter_end = tm_int.end(); + auto tm_search_iter_begin = tm_search_one.begin(); + auto tm_search_iter_end = tm_search_one.end(); + auto tm_search_iter_empty = tm_search_empty.begin(); + + packed_trie_map<trie::std_string_traits, int>::entry entries_int[] = { + {MDDS_ASCII("a"), 13}, + {MDDS_ASCII("aa"), 10}, + {MDDS_ASCII("ab"), 3}, + {MDDS_ASCII("b"), 7}, + }; + packed_trie_map<trie::std_string_traits, int> empty_ptm(entries_int, 0); + packed_trie_map<trie::std_string_traits, int> ptm_int(entries_int, MDDS_N_ELEMENTS(entries_int)); + packed_trie_map<trie::std_string_traits, std::string>::entry entries_str[] = { + {MDDS_ASCII("a"), "13"}, + {MDDS_ASCII("aa"), "10"}, + {MDDS_ASCII("ab"), "3"}, + {MDDS_ASCII("b"), "7"}, + }; + packed_trie_map<trie::std_string_traits, std::string> ptm_str(entries_str, MDDS_N_ELEMENTS(entries_str)); + + auto ptm_search_empty = ptm_int.prefix_search("foo"); + auto ptm_search_one = ptm_int.prefix_search("b"); + auto ptm_search_more = ptm_int.prefix_search("a"); + + auto ptm_iter_begin = ptm_int.begin(); + auto ptm_iter_end = ptm_int.end(); + auto ptm_search_iter_begin = ptm_search_one.begin(); + auto ptm_search_iter_end = ptm_search_one.end(); + auto ptm_search_iter_empty = ptm_search_empty.begin(); + + stop(); +} + +// vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/test/include/Makefile.am b/test/include/Makefile.am new file mode 100644 index 0000000..1df18d4 --- /dev/null +++ b/test/include/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = test_global.hpp diff --git a/test/include/Makefile.in b/test/include/Makefile.in new file mode 100644 index 0000000..0939e30 --- /dev/null +++ b/test/include/Makefile.in @@ -0,0 +1,460 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/include +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +EXTRA_DIST = test_global.hpp +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/include/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am check-valgrind-am \ + check-valgrind-drd-am check-valgrind-drd-local \ + check-valgrind-helgrind-am check-valgrind-helgrind-local \ + check-valgrind-local check-valgrind-memcheck-am \ + check-valgrind-memcheck-local check-valgrind-sgcheck-am \ + check-valgrind-sgcheck-local clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/include/test_global.hpp b/test/include/test_global.hpp new file mode 100644 index 0000000..0ed6f33 --- /dev/null +++ b/test/include/test_global.hpp @@ -0,0 +1,97 @@ +/************************************************************************* + * + * Copyright (c) 2010-2018 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#ifndef INCLUDED_TEST_GLOBAL_HPP +#define INCLUDED_TEST_GLOBAL_HPP + +#ifdef NDEBUG +// release build +#undef NDEBUG +#include <cassert> +#define NDEBUG +#else +// debug build +#include <cassert> +#endif + +#include <cstdio> +#include <string> +#include <cstdint> +#include <iostream> +#include <sstream> + +struct cmd_options +{ + bool test_func; + bool test_perf; + + cmd_options(); +}; + +bool parse_cmd_options(int argc, char** argv, cmd_options& opt); + +double get_current_time(); + +class stack_watch +{ +public: + stack_watch(); + + void reset(); + double get_duration() const; + +private: + double m_start_time; +}; + +class stack_printer +{ +public: + explicit stack_printer(const char* msg); + stack_printer(std::string msg); + + ~stack_printer(); + + void print_time(int line) const; + +private: + std::string m_msg; + double m_start_time; +}; + +using std::cerr; +using std::cout; +using std::endl; + +#define MDDS_TEST_FUNC_SCOPE stack_printer __sp__(__func__) + +#define MDDS_TEST_FUNC_SCOPE_MSG(stream) \ + std::ostringstream __sp_os__; \ + __sp_os__ << __func__ << ' ' << stream; \ + stack_printer __sp__(__sp_os__.str()) + +#endif diff --git a/test/multi_type_matrix/Makefile.am b/test/multi_type_matrix/Makefile.am new file mode 100644 index 0000000..7cedf46 --- /dev/null +++ b/test/multi_type_matrix/Makefile.am @@ -0,0 +1,18 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main test-walk + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_walk_SOURCES = \ + test_walk.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test-main test-walk + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_matrix/Makefile.in b/test/multi_type_matrix/Makefile.in new file mode 100644 index 0000000..25dcc86 --- /dev/null +++ b/test/multi_type_matrix/Makefile.in @@ -0,0 +1,1012 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) test-walk$(EXEEXT) +TESTS = test-main$(EXEEXT) test-walk$(EXEEXT) +subdir = test/multi_type_matrix +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +am_test_walk_OBJECTS = test_walk.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_walk_OBJECTS = $(am_test_walk_OBJECTS) +test_walk_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_main.Po ./$(DEPDIR)/test_walk.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) $(test_walk_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) $(test_walk_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_walk_SOURCES = \ + test_walk.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_matrix/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_matrix/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +test-walk$(EXEEXT): $(test_walk_OBJECTS) $(test_walk_DEPENDENCIES) $(EXTRA_test_walk_DEPENDENCIES) + @rm -f test-walk$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_walk_OBJECTS) $(test_walk_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_walk.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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-walk.log: test-walk$(EXEEXT) + @p='test-walk$(EXEEXT)'; \ + b='test-walk'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f ./$(DEPDIR)/test_walk.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f ./$(DEPDIR)/test_walk.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_matrix/test_main.cpp b/test/multi_type_matrix/test_main.cpp new file mode 100644 index 0000000..58c4415 --- /dev/null +++ b/test/multi_type_matrix/test_main.cpp @@ -0,0 +1,1140 @@ +/************************************************************************* + * + * Copyright (c) 2012-2018 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. + +#include <mdds/multi_type_matrix.hpp> + +#include <string> +#include <ostream> +#include <functional> + +using namespace mdds; +using namespace std; + +// Standard matrix that uses std::string as its string type. +typedef multi_type_matrix<mtm::std_string_traits> mtx_type; + +// Custom string code -------------------------------------------------------- + +class custom_string +{ + string m_val; + +public: + custom_string() + {} + custom_string(const string& val) : m_val(val) + {} + custom_string(const custom_string& r) : m_val(r.m_val) + {} + const string& get() const + { + return m_val; + } + bool operator==(const custom_string& r) const + { + return m_val == r.m_val; + } + bool operator!=(const custom_string& r) const + { + return !operator==(r); + } +}; + +ostream& operator<<(ostream& os, const custom_string& str) +{ + os << str.get(); + return os; +} + +const mtv::element_t element_type_custom_string = mdds::mtv::element_type_user_start; +typedef mtv::default_element_block<element_type_custom_string, custom_string> custom_string_block; + +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(custom_string, element_type_custom_string, custom_string(), custom_string_block) + +struct custom_string_trait +{ + typedef mdds::mtv::int32_element_block integer_element_block; + typedef custom_string_block string_element_block; +}; + +typedef mdds::multi_type_matrix<custom_string_trait> mtx_custom_type; + +namespace { + +template<typename _T> +void check_value(mtx_type& mtx, size_t row, size_t col, const _T& val) +{ + mtx.set(row, col, val); + _T test = mtx.get<_T>(row, col); + assert(test == val); +} + +bool check_copy(const mtx_type& mx1, const mtx_type& mx2) +{ + size_t row_count = min(mx1.size().row, mx2.size().row); + size_t col_count = min(mx1.size().column, mx2.size().column); + for (size_t i = 0; i < row_count; ++i) + { + for (size_t j = 0; j < col_count; ++j) + { + mtm::element_t elem_type = mx1.get_type(i, j); + if (elem_type != mx2.get_type(i, j)) + { + cout << "check_copy: (row=" << i << ",column=" << j << ") element types differ." << endl; + return false; + } + + switch (elem_type) + { + case mtm::element_boolean: + if (mx1.get<bool>(i, j) != mx2.get<bool>(i, j)) + { + cout << "check_copy: (row=" << i << ",column=" << j << ") different boolean values." << endl; + return false; + } + break; + case mtm::element_numeric: + if (mx1.get<double>(i, j) != mx2.get<double>(i, j)) + { + cout << "check_copy: (row=" << i << ",column=" << j << ") different numeric values." << endl; + return false; + } + break; + case mtm::element_string: + if (mx1.get<mtx_type::string_type>(i, j) != mx2.get<mtx_type::string_type>(i, j)) + { + cout << "check_copy: (row=" << i << ",column=" << j << ") different string values." << endl; + return false; + } + break; + case mtm::element_empty: + default:; + } + } + } + return true; +} + +} // namespace + +void mtm_test_construction() +{ + stack_printer __stack_printer__("::mtm_test_construction"); + { + // default constructor. + mtx_type mtx; + mtx_type::size_pair_type sz = mtx.size(); + assert(sz.row == 0 && sz.column == 0); + } + + { + // construction to a specific size. + mtx_type mtx(2, 5); + mtx_type::size_pair_type sz = mtx.size(); + assert(sz.row == 2 && sz.column == 5); + } + + { + // construction to a specific size with default value. + mtx_type mtx(2, 5, string("foo")); + mtx_type::size_pair_type sz = mtx.size(); + assert(sz.row == 2 && sz.column == 5); + assert(mtx.get_type(0, 0) == mtm::element_string); + assert(mtx.get_string(0, 0) == "foo"); + assert(mtx.get_type(1, 4) == mtm::element_string); + assert(mtx.get_string(1, 4) == "foo"); + } + + { + // construct with an array of data. + vector<double> vals; + vals.push_back(1.1); + vals.push_back(1.2); + vals.push_back(1.3); + vals.push_back(1.4); + mtx_type mtx(2, 2, vals.begin(), vals.end()); + mtx_type::size_pair_type sz = mtx.size(); + assert(sz.row == 2 && sz.column == 2); + assert(mtx.get_numeric(0, 0) == 1.1); + assert(mtx.get_numeric(1, 0) == 1.2); + assert(mtx.get_numeric(0, 1) == 1.3); + assert(mtx.get_numeric(1, 1) == 1.4); + + try + { + mtx_type mtx2(3, 2, vals.begin(), vals.end()); + assert(!"Construction of this matrix should have failed!"); + } + catch (const invalid_arg_error& e) + { + // Good. + cout << "exception caught (as expected) which says: " << e.what() << endl; + } + + try + { + // Trying to initialize a matrix with array of unsupported data + // type should end with an exception thrown. + vector<int8_t> vals_ptr(4, 22); + mtx_type mtx3(2, 2, vals_ptr.begin(), vals_ptr.end()); + assert(!"Construction of this matrix should have failed!"); + } + catch (const exception& e) + { + cout << "exception caught (as expected) which says: " << e.what() << endl; + } + } + + { + // Construct with an array of custom string type. + vector<custom_string> vals; + vals.push_back(custom_string("A")); + vals.push_back(custom_string("B")); + vals.push_back(custom_string("C")); + vals.push_back(custom_string("D")); + mtx_custom_type mtx(1, 4, vals.begin(), vals.end()); + assert(mtx.get_string(0, 0).get() == "A"); + assert(mtx.get_string(0, 1).get() == "B"); + assert(mtx.get_string(0, 2).get() == "C"); + assert(mtx.get_string(0, 3).get() == "D"); + assert(mtx.get_type(0, 0) == mtm::element_string); + assert(mtx.get_type(0, 1) == mtm::element_string); + assert(mtx.get_type(0, 2) == mtm::element_string); + assert(mtx.get_type(0, 3) == mtm::element_string); + } + + { + // Construct size_pair_type from initializer list. + mtx_type::size_pair_type sz({3, 4}); + assert(sz.row == 3); + assert(sz.column == 4); + } +} + +void mtm_test_data_insertion() +{ + stack_printer __stack_printer__("::mtm_test_data_insertion"); + { + // Create with empty elements. + mtx_type mtx(3, 4); + mtx_type::size_pair_type sz = mtx.size(); + assert(sz.row == 3 && sz.column == 4); + assert(!mtx.empty()); + assert(mtx.get_type(0, 0) == mtm::element_empty); + assert(mtx.get_type(2, 3) == mtm::element_empty); + check_value(mtx, 1, 1, 1.2); + check_value(mtx, 2, 1, true); + check_value(mtx, 3, 1, false); + check_value(mtx, 0, 2, string("foo")); + check_value(mtx, 1, 2, 23.4); + + // Overwrite + assert(mtx.get_type(1, 1) == mtm::element_numeric); + check_value(mtx, 1, 1, string("baa")); + + // Setting empty. + assert(mtx.get_type(1, 1) == mtm::element_string); + mtx.set_empty(1, 1); + assert(mtx.get_type(1, 1) == mtm::element_empty); + + mtx.clear(); + assert(mtx.size().row == 0); + assert(mtx.size().column == 0); + assert(mtx.empty()); + } +} + +void mtm_test_data_insertion_multiple() +{ + stack_printer __stack_printer__("::mtm_test_data_insertion_multiple"); + { + mtx_type mtx(3, 5); + + // data shorter than column length + vector<double> vals; + vals.push_back(1.1); + vals.push_back(1.2); + mtx.set_column(2, vals.begin(), vals.end()); + assert(mtx.get_numeric(0, 2) == 1.1); + assert(mtx.get_numeric(1, 2) == 1.2); + assert(mtx.get_type(2, 2) == mtm::element_empty); + + // data exatly at column length + vals.clear(); + vals.push_back(2.1); + vals.push_back(2.2); + vals.push_back(2.3); + mtx.set_column(2, vals.begin(), vals.end()); + assert(mtx.get_numeric(0, 2) == 2.1); + assert(mtx.get_numeric(1, 2) == 2.2); + assert(mtx.get_numeric(2, 2) == 2.3); + assert(mtx.get_type(0, 3) == mtm::element_empty); + + // data longer than column length. The excess data should be ignored. + vals.clear(); + vals.push_back(3.1); + vals.push_back(3.2); + vals.push_back(3.3); + vals.push_back(3.4); + mtx.set_column(2, vals.begin(), vals.end()); + assert(mtx.get_numeric(0, 2) == 3.1); + assert(mtx.get_numeric(1, 2) == 3.2); + assert(mtx.get_numeric(2, 2) == 3.3); + assert(mtx.get_type(0, 3) == mtm::element_empty); + } +} + +void mtm_test_data_insertion_integer() +{ + stack_printer __stack_printer__("::mtm_test_data_insertion_integer"); + + // +--------+--------+ + // | int | double | + // +--------+--------+ + // | double | int | + // +--------+--------+ + + mtx_type mtx(2, 2); + mtx.set(0, 0, int(0)); + mtx.set(1, 1, int(22)); + mtx.set(0, 1, double(10)); + mtx.set(1, 0, double(22)); + + assert(mtx.get_type(0, 0) == mtm::element_integer); + assert(mtx.get_type(1, 1) == mtm::element_integer); + assert(mtx.get_type(0, 1) == mtm::element_numeric); + assert(mtx.get_type(1, 0) == mtm::element_numeric); + + assert(mtx.get_integer(0, 0) == 0); + assert(mtx.get_integer(1, 1) == 22); + assert(mtx.get_integer(0, 1) == 10); + assert(mtx.get_integer(1, 0) == 22); + + assert(mtx.get_numeric(0, 0) == 0.0); + assert(mtx.get_numeric(1, 1) == 22.0); + assert(mtx.get_numeric(0, 1) == 10.0); + assert(mtx.get_numeric(1, 0) == 22.0); + + assert(mtx.get_boolean(0, 0) == false); + assert(mtx.get_boolean(1, 1) == true); + assert(mtx.get_boolean(0, 1) == true); + assert(mtx.get_boolean(1, 0) == true); + + assert(mtx.numeric()); // integers are considered numeric. + + assert(mtx.get<int>(0, 0) == 0); + assert(mtx.get<int>(1, 1) == 22); + + mtx_type::position_type pos = mtx.position(0, 1); + mtx.set(pos, int(987)); + assert(mtx.get<int>(0, 1) == 987); + + // +--------+--------+ + // | int | int | + // +--------+--------+ + // | double | int | + // +--------+--------+ + + vector<mtx_type::element_block_node_type> nodes; + + std::function<void(const mtx_type::element_block_node_type&)> f = + [&nodes](const mtx_type::element_block_node_type& node) { nodes.push_back(node); }; + + mtx.walk(f); + + assert(nodes.size() == 3); + assert(nodes[0].type == mtm::element_integer); + assert(nodes[0].size == 1); + assert(nodes[1].type == mtm::element_numeric); + assert(nodes[1].size == 1); + assert(nodes[2].type == mtm::element_integer); + assert(nodes[2].size == 2); + + { + auto it = nodes[2].begin<mtx_type::integer_block_type>(); + auto ite = nodes[2].end<mtx_type::integer_block_type>(); + assert(*it == 987); + ++it; + assert(*it == 22); + ++it; + assert(it == ite); + } +} + +void mtm_test_set_empty() +{ + stack_printer __stack_printer__("::mtm_test_set_empty"); + { + // set whole column empty. + mtx_type mtx(3, 5, 1.2); + cout << "setting whole column 2 empty..." << endl; + mtx.set_column_empty(2); + assert(mtx.get_type(0, 1) != mtm::element_empty); + assert(mtx.get_type(1, 1) != mtm::element_empty); + assert(mtx.get_type(2, 1) != mtm::element_empty); + assert(mtx.get_type(0, 2) == mtm::element_empty); + assert(mtx.get_type(1, 2) == mtm::element_empty); + assert(mtx.get_type(2, 2) == mtm::element_empty); + assert(mtx.get_type(0, 3) != mtm::element_empty); + assert(mtx.get_type(1, 3) != mtm::element_empty); + assert(mtx.get_type(2, 3) != mtm::element_empty); + } + + { + // set whole row empty. + mtx_type mtx(3, 5, 1.2); + cout << "setting whole row 1 empty..." << endl; + mtx.set_row_empty(1); + assert(mtx.get_type(0, 0) != mtm::element_empty); + assert(mtx.get_type(0, 1) != mtm::element_empty); + assert(mtx.get_type(0, 2) != mtm::element_empty); + assert(mtx.get_type(0, 3) != mtm::element_empty); + assert(mtx.get_type(0, 4) != mtm::element_empty); + assert(mtx.get_type(1, 0) == mtm::element_empty); + assert(mtx.get_type(1, 1) == mtm::element_empty); + assert(mtx.get_type(1, 2) == mtm::element_empty); + assert(mtx.get_type(1, 3) == mtm::element_empty); + assert(mtx.get_type(1, 4) == mtm::element_empty); + assert(mtx.get_type(2, 0) != mtm::element_empty); + assert(mtx.get_type(2, 1) != mtm::element_empty); + assert(mtx.get_type(2, 2) != mtm::element_empty); + assert(mtx.get_type(2, 3) != mtm::element_empty); + assert(mtx.get_type(2, 4) != mtm::element_empty); + } + + { + // Set a range of elements empty. + mtx_type mtx(5, 3, string("A")); + cout << "setting element (0,1) to (1,2) empty..." << endl; + mtx.set_empty(1, 0, 6); // rows 1-4 in column 0 and rows 0-1 in column 1. + assert(mtx.get_type(0, 0) == mtm::element_string); + assert(mtx.get_type(1, 0) == mtm::element_empty); + assert(mtx.get_type(2, 0) == mtm::element_empty); + assert(mtx.get_type(3, 0) == mtm::element_empty); + assert(mtx.get_type(4, 0) == mtm::element_empty); + assert(mtx.get_type(0, 1) == mtm::element_empty); + assert(mtx.get_type(1, 1) == mtm::element_empty); + assert(mtx.get_type(2, 1) == mtm::element_string); + assert(mtx.get_type(3, 1) == mtm::element_string); + assert(mtx.get_type(4, 1) == mtm::element_string); + assert(mtx.get_type(0, 2) == mtm::element_string); + assert(mtx.get_type(1, 2) == mtm::element_string); + assert(mtx.get_type(2, 2) == mtm::element_string); + assert(mtx.get_type(3, 2) == mtm::element_string); + assert(mtx.get_type(4, 2) == mtm::element_string); + + try + { + mtx.set_empty(2, 2, 0); + assert(false); + } + catch (const std::exception&) + { + cout << "exception thrown on length of zero as expected" << endl; + } + } +} + +void mtm_test_swap() +{ + stack_printer __stack_printer__("::mtm_test_swap"); + mtx_type mtx1(3, 6), mtx2(7, 2); + mtx1.set(0, 0, 1.1); + mtx1.set(2, 5, 1.9); + mtx2.set(0, 0, 2.1); + mtx2.set(6, 1, 2.9); + mtx1.swap(mtx2); + + assert(mtx1.size().row == 7); + assert(mtx1.size().column == 2); + assert(mtx1.get<double>(0, 0) == 2.1); + assert(mtx1.get<double>(6, 1) == 2.9); + + assert(mtx2.size().row == 3); + assert(mtx2.size().column == 6); + assert(mtx2.get<double>(0, 0) == 1.1); + assert(mtx2.get<double>(2, 5) == 1.9); +} + +void mtm_test_transpose() +{ + stack_printer __stack_printer__("::mtm_test_transpose"); + mtx_type mtx(3, 6); + mtx.set(0, 0, 1.1); + mtx.set(1, 0, 1.2); + mtx.set(2, 0, 1.3); + mtx.set(1, 5, string("foo")); + mtx.set(2, 3, true); + mtx.transpose(); + assert(mtx.size().row == 6); + assert(mtx.size().column == 3); + assert(mtx.get<double>(0, 0) == 1.1); + assert(mtx.get<double>(0, 1) == 1.2); + assert(mtx.get<double>(0, 2) == 1.3); + assert(mtx.get<string>(5, 1) == "foo"); + assert(mtx.get<bool>(3, 2) == true); +} + +void mtm_test_resize() +{ + stack_printer __stack_printer__("::mtm_test_resize"); + mtx_type mtx(0, 0); + assert(mtx.size().row == 0); + assert(mtx.size().column == 0); + assert(mtx.empty()); + + mtx.resize(1, 3); + assert(mtx.size().row == 1); + assert(mtx.size().column == 3); + assert(!mtx.empty()); + assert(mtx.get_type(0, 0) == mtm::element_empty); + assert(mtx.get_type(0, 1) == mtm::element_empty); + assert(mtx.get_type(0, 2) == mtm::element_empty); + + mtx.set(0, 0, 1.1); + mtx.set(0, 1, string("foo")); + mtx.set(0, 2, true); + assert(mtx.get<double>(0, 0) == 1.1); + assert(mtx.get<string>(0, 1) == "foo"); + assert(mtx.get<bool>(0, 2) == true); + + // This shouldn't alter the original content. + mtx.resize(2, 4); + assert(mtx.size().row == 2); + assert(mtx.size().column == 4); + assert(mtx.get<double>(0, 0) == 1.1); + assert(mtx.get<string>(0, 1) == "foo"); + assert(mtx.get<bool>(0, 2) == true); + assert(mtx.get_type(1, 3) == mtm::element_empty); + + mtx.resize(2, 2); + assert(mtx.size().row == 2); + assert(mtx.size().column == 2); + assert(mtx.get<double>(0, 0) == 1.1); + assert(mtx.get<string>(0, 1) == "foo"); + assert(mtx.get_type(1, 0) == mtm::element_empty); + assert(mtx.get_type(1, 1) == mtm::element_empty); + + // Three ways to resize to empty matrix. + mtx.resize(2, 0); + assert(mtx.size().row == 0); + assert(mtx.size().column == 0); + + mtx.resize(2, 2); + mtx.resize(0, 2); + assert(mtx.size().row == 0); + assert(mtx.size().column == 0); + + mtx.resize(2, 2); + mtx.resize(0, 0); + assert(mtx.size().row == 0); + assert(mtx.size().column == 0); + + // Resize with initial value when the matrix becomes larger. + mtx.resize(3, 2, 12.5); + assert(mtx.size().row == 3); + assert(mtx.size().column == 2); + assert(mtx.get<double>(2, 1) == 12.5); + assert(mtx.get<double>(2, 0) == 12.5); + assert(mtx.get<double>(0, 0) == 12.5); + assert(mtx.get<double>(0, 1) == 12.5); + + // The initial value should be ignored when shrinking. + mtx.resize(2, 1, true); + assert(mtx.size().row == 2); + assert(mtx.size().column == 1); + assert(mtx.get<double>(1, 0) == 12.5); + + // Resize again with initial value of different type. + mtx.resize(3, 2, string("extra")); + assert(mtx.size().row == 3); + assert(mtx.size().column == 2); + assert(mtx.get<double>(0, 0) == 12.5); + assert(mtx.get<double>(1, 0) == 12.5); + assert(mtx.get<string>(2, 1) == "extra"); + assert(mtx.get<string>(2, 0) == "extra"); + assert(mtx.get<string>(1, 1) == "extra"); + assert(mtx.get<string>(0, 1) == "extra"); +} + +void mtm_test_copy() +{ + stack_printer __stack_printer__("::mtm_test_copy"); + + // Assigning from a smaller matrix to a bigger one. + mtx_type mx1(5, 5), mx2(2, 2); + mx2.set(0, 0, 1.2); + mx2.set(1, 1, true); + mx2.set(0, 1, string("test")); + mx2.set(1, 0, string("foo")); + mx1.copy(mx2); + + bool success = check_copy(mx1, mx2); + assert(success); + + mx2.resize(8, 8); + mx2.copy(mx1); + + success = check_copy(mx1, mx2); + assert(success); + + // from a larger matrix to a smaller one. + mx1.set(0, 0, string("test1")); + mx2.set(0, 0, string("test2")); + mx2.set(4, 4, true); + mx2.set(7, 7, false); + mx1.copy(mx2); + success = check_copy(mx1, mx2); + assert(success); + + // self assignment (should be no-op). + mx1.copy(mx1); + success = check_copy(mx1, mx1); + assert(success); + + mx2.copy(mx2); + success = check_copy(mx2, mx2); + assert(success); +} + +void mtm_test_copy_empty_destination() +{ + stack_printer __stack_printer__("::mtm_test_copy_empty_destination"); + + mtx_type mx1, mx2(1, 1); + mx1.copy(mx2); // This should not throw. + + mx2.copy(mx1); // This should not throw either. +} + +void mtm_test_copy_from_array() +{ + stack_printer __stack_printer__("::mtm_test_copy_from_array"); + + vector<double> src; + src.reserve(9); + for (size_t i = 0; i < 9; ++i) + src.push_back(double(i)); + + mtx_type mx(4, 4); + mx.copy(3, 3, src.begin(), src.end()); + + assert(mx.get<double>(0, 0) == 0.0); + assert(mx.get<double>(1, 0) == 1.0); + assert(mx.get<double>(2, 0) == 2.0); + assert(mx.get<double>(0, 1) == 3.0); + assert(mx.get<double>(1, 1) == 4.0); + assert(mx.get<double>(2, 1) == 5.0); + assert(mx.get<double>(0, 2) == 6.0); + assert(mx.get<double>(1, 2) == 7.0); + assert(mx.get<double>(2, 2) == 8.0); + assert(mx.get_type(3, 0) == mtm::element_empty); + assert(mx.get_type(3, 1) == mtm::element_empty); + assert(mx.get_type(3, 2) == mtm::element_empty); + assert(mx.get_type(3, 3) == mtm::element_empty); + assert(mx.get_type(0, 3) == mtm::element_empty); + assert(mx.get_type(1, 3) == mtm::element_empty); + assert(mx.get_type(2, 3) == mtm::element_empty); + assert(mx.get_type(3, 3) == mtm::element_empty); + + vector<std::string> src2; + src2.reserve(4); + src2.push_back("A"); + src2.push_back("B"); + src2.push_back("C"); + src2.push_back("D"); + + mx.copy(2, 2, src2.begin(), src2.end()); + + assert(mx.get<std::string>(0, 0) == "A"); + assert(mx.get<std::string>(1, 0) == "B"); + assert(mx.get<std::string>(0, 1) == "C"); + assert(mx.get<std::string>(1, 1) == "D"); + assert(mx.get<double>(2, 0) == 2.0); + assert(mx.get<double>(2, 1) == 5.0); + assert(mx.get<double>(0, 2) == 6.0); + assert(mx.get<double>(1, 2) == 7.0); + assert(mx.get<double>(2, 2) == 8.0); + assert(mx.get_type(3, 0) == mtm::element_empty); + assert(mx.get_type(3, 1) == mtm::element_empty); + assert(mx.get_type(3, 2) == mtm::element_empty); + assert(mx.get_type(3, 3) == mtm::element_empty); + assert(mx.get_type(0, 3) == mtm::element_empty); + assert(mx.get_type(1, 3) == mtm::element_empty); + assert(mx.get_type(2, 3) == mtm::element_empty); + assert(mx.get_type(3, 3) == mtm::element_empty); + + vector<bool> src3; + src3.push_back(true); + src3.push_back(false); + src3.push_back(true); + src3.push_back(false); + + mx.copy(4, 1, src3.begin(), src3.end()); + assert(mx.get<bool>(0, 0) == true); + assert(mx.get<bool>(1, 0) == false); + assert(mx.get<bool>(2, 0) == true); + assert(mx.get<bool>(3, 0) == false); + + // Try to copy from an array of invalid type. + vector<int8_t> src_invalid; + src_invalid.push_back('a'); + src_invalid.push_back('b'); + + try + { + mx.copy(2, 1, src_invalid.begin(), src_invalid.end()); + assert(!"type_error did not get thrown."); + } + catch (const mdds::type_error& e) + { + cout << "expected exception was thrown: '" << e.what() << "'" << endl; + } +} + +void mtm_test_assignment() +{ + stack_printer __stack_printer__("::mtm_test_assignment"); + mtx_type mx_orig(5, 5, 1.2); + mtx_type mx_copied = mx_orig; + assert(mx_orig == mx_copied); + + mx_copied = mx_copied; // self assignment. + assert(mx_orig == mx_copied); + + mx_orig.set(2, 3, true); + mx_orig.set(1, 1, string("foo")); + mx_copied = mx_orig; + assert(mx_orig == mx_copied); +} + +void mtm_test_numeric() +{ + // Numeric elements only matrix is numeric. + mtx_type mtx(2, 2, 1.1); + assert(mtx.numeric()); + + // Boolean element is numeric. + mtx.set(0, 0, true); + assert(mtx.numeric()); + + // String element is not. + mtx.set(1, 0, string("foo")); + assert(!mtx.numeric()); + + mtx.set(1, 0, 1.3); + assert(mtx.numeric()); + + // Empty element is not numeric. + mtx.set_empty(1, 1); + assert(!mtx.numeric()); + + // Empty matrix is not numeric. + mtx.clear(); + assert(!mtx.numeric()); +} + +void mtm_test_custom_string() +{ + stack_printer __stack_printer__("::mtm_test_custom_string"); + mtx_custom_type mtx(2, 2); + mtx.set(0, 0, custom_string("foo")); + assert(mtx.get_type(0, 0) == mtm::element_string); + assert(mtx.get<custom_string>(0, 0) == custom_string("foo")); + mtx.set(1, 1, 12.3); + assert(mtx.get<double>(1, 1) == 12.3); +} + +void mtm_test_position() +{ + stack_printer __stack_printer__("::mtm_test_position"); + mtx_type mtx(3, 2); + mtx.set(0, 0, 1.0); + mtx.set(0, 1, string("foo")); + mtx.set(1, 0, 2.0); + mtx.set(1, 1, 2.1); + mtx.set(2, 0, true); + mtx.set(2, 1, false); + + assert(mtx.get_type(0, 0) == mtm::element_numeric); + assert(mtx.get_type(0, 1) == mtm::element_string); + assert(mtx.get_type(1, 0) == mtm::element_numeric); + assert(mtx.get_type(1, 1) == mtm::element_numeric); + assert(mtx.get_type(2, 0) == mtm::element_boolean); + assert(mtx.get_type(2, 1) == mtm::element_boolean); + + mtx_type::position_type pos = mtx.position(1, 1); + assert(mtx.get_type(pos) == mtm::element_numeric); + assert(mtx.get_numeric(pos) == 2.1); + + pos = mtx.position(2, 0); + assert(mtx.get_type(pos) == mtm::element_boolean); + assert(mtx.get_boolean(pos) == true); + + pos = mtx.position(0, 1); + assert(mtx.get_type(pos) == mtm::element_string); + assert(mtx.get_string(pos) == "foo"); + + mtx.set_empty(pos); + assert(mtx.get_type(0, 1) == mtm::element_empty); + + pos = mtx.position(1, 1); + mtx.set(pos, false); + assert(mtx.get_type(1, 1) == mtm::element_boolean); + assert(mtx.get_boolean(1, 1) == false); + + pos = mtx.position(2, 0); + mtx.set(pos, 12.3); + assert(mtx.get_type(2, 0) == mtm::element_numeric); + assert(mtx.get_numeric(2, 0) == 12.3); + + pos = mtx.position(2, 1); + mtx.set(pos, string("ABC")); + assert(mtx.get_type(2, 1) == mtm::element_string); + assert(mtx.get_string(2, 1) == "ABC"); + + // Start over, and test the traversal of position object. + pos = mtx.position(0, 0); + mtx_type::size_pair_type mtx_pos = mtx.matrix_position(pos); + assert(mtx_pos.column == 0); + assert(mtx_pos.row == 0); + + pos = mtx_type::next_position(pos); + mtx_pos = mtx.matrix_position(pos); + assert(mtx_pos.column == 0); + assert(mtx_pos.row == 1); + + pos = mtx_type::next_position(pos); + mtx_pos = mtx.matrix_position(pos); + assert(mtx_pos.column == 0); + assert(mtx_pos.row == 2); + + pos = mtx_type::next_position(pos); + mtx_pos = mtx.matrix_position(pos); + assert(mtx_pos.column == 1); + assert(mtx_pos.row == 0); + + pos = mtx_type::next_position(pos); + mtx_pos = mtx.matrix_position(pos); + assert(mtx_pos.column == 1); + assert(mtx_pos.row == 1); + + pos = mtx_type::next_position(pos); + mtx_pos = mtx.matrix_position(pos); + assert(mtx_pos.column == 1); + assert(mtx_pos.row == 2); + + pos = mtx_type::next_position(pos); + assert(pos == mtx.end_position()); +} + +void mtm_test_set_data_via_position() +{ + stack_printer __stack_printer__("::mtm_test_set_data_via_position"); + mtx_type mtx(5, 4); + mtx_type::position_type pos = mtx.position(0, 1); + vector<double> data; + data.push_back(1.1); + data.push_back(1.2); + data.push_back(1.3); + data.push_back(1.4); + data.push_back(1.5); + pos = mtx.set(pos, data.begin(), data.end()); + assert(mtx.get<double>(0, 1) == 1.1); + assert(mtx.get<double>(1, 1) == 1.2); + assert(mtx.get<double>(2, 1) == 1.3); + assert(mtx.get<double>(3, 1) == 1.4); + assert(mtx.get<double>(4, 1) == 1.5); + + mtx_type::size_pair_type mtx_pos = mtx.matrix_position(pos); + assert(mtx_pos.row == 0); + assert(mtx_pos.column == 1); + pos = mtx.position(pos, 0, 2); + pos = mtx.set(pos, string("test")); + pos = mtx_type::next_position(pos); + pos = mtx.set(pos, true); + assert(mtx.get<string>(0, 2) == "test"); + assert(mtx.get<bool>(1, 2) == true); +} + +/** + * Measure the performance of object instantiation for filled storage. + */ +void mtm_perf_test_storage_creation() +{ + cout << "measuring performance on matrix object creation." << endl; + size_t rowsize = 5000; + size_t obj_count = 30000; + cout << "row size: " << rowsize << " object count: " << obj_count << endl; + cout << "--- filled zero" << endl; + for (size_t colsize = 1; colsize <= 5; ++colsize) + { + stack_watch sw; + for (size_t i = 0; i < obj_count; ++i) + mtx_type mx(rowsize, colsize, 0.0); + + cout << "column size: " << colsize << " duration: " << sw.get_duration() << " sec" << endl; + } + cout << endl; +} + +void mtm_perf_test_storage_set_numeric() +{ + cout << "measuring performance on matrix object creation and populating it with numeric data." << endl; + size_t rowsize = 3000; + size_t obj_count = 30000; + cout << "row size: " << rowsize << " object count: " << obj_count << endl; + cout << "--- filled zero (individual insertion)" << endl; + for (size_t colsize = 1; colsize <= 5; ++colsize) + { + stack_watch sw; + for (size_t i = 0; i < obj_count; ++i) + { + mtx_type mx(rowsize, colsize, 0.0); + for (size_t row = 0; row < rowsize; ++row) + { + for (size_t col = 0; col < colsize; ++col) + mx.set(row, col, 1.0); + } + } + cout << "column size: " << colsize << " duration: " << sw.get_duration() << " sec" << endl; + } + + cout << "--- filled zero (per column)" << endl; + for (size_t colsize = 1; colsize <= 5; ++colsize) + { + stack_watch sw; + for (size_t i = 0; i < obj_count; ++i) + { + mtx_type mx(rowsize, colsize, 0.0); + for (size_t col = 0; col < colsize; ++col) + { + vector<double> vals; + vals.reserve(rowsize); + for (size_t row = 0; row < rowsize; ++row) + vals.push_back(1.0); + mx.set(0, col, vals.begin(), vals.end()); + } + } + cout << "column size: " << colsize << " duration: " << sw.get_duration() << " sec" << endl; + } + + cout << "--- filled zero (per column, pre-filled array)" << endl; + for (size_t colsize = 1; colsize <= 5; ++colsize) + { + // Fill the data array before insertion. + vector<double> vals; + vals.reserve(rowsize); + for (size_t row = 0; row < rowsize; ++row) + vals.push_back(1.0); + + stack_watch sw; + for (size_t i = 0; i < obj_count; ++i) + { + mtx_type mx(rowsize, colsize, 0.0); + for (size_t col = 0; col < colsize; ++col) + mx.set(0, col, vals.begin(), vals.end()); + } + cout << "column size: " << colsize << " duration: " << sw.get_duration() << " sec" << endl; + } + + cout << "--- empty on creation (per column)" << endl; + for (size_t colsize = 1; colsize <= 5; ++colsize) + { + stack_watch sw; + for (size_t i = 0; i < obj_count; ++i) + { + mtx_type mx(rowsize, colsize); + for (size_t col = 0; col < colsize; ++col) + { + vector<double> vals; + vals.reserve(rowsize); + for (size_t row = 0; row < rowsize; ++row) + vals.push_back(1.0); + mx.set(0, col, vals.begin(), vals.end()); + } + } + cout << "column size: " << colsize << " duration: " << sw.get_duration() << " sec" << endl; + } + + cout << "--- empty on creation (per column, pre-filled array)" << endl; + for (size_t colsize = 1; colsize <= 5; ++colsize) + { + // Fill the data array before insertion. + vector<double> vals; + vals.reserve(rowsize); + for (size_t row = 0; row < rowsize; ++row) + vals.push_back(1.0); + + stack_watch sw; + for (size_t i = 0; i < obj_count; ++i) + { + mtx_type mx(rowsize, colsize); + for (size_t col = 0; col < colsize; ++col) + mx.set(0, col, vals.begin(), vals.end()); + } + cout << "column size: " << colsize << " duration: " << sw.get_duration() << " sec" << endl; + } + + cout << endl; +} + +struct sum_all_values +{ + double result; + + sum_all_values() : result(0.0) + {} + + void operator()(const mtx_type::element_block_node_type& blk) + { + mtv::double_element_block::const_iterator it = mtv::double_element_block::cbegin(*blk.data); + mtv::double_element_block::const_iterator it_end = mtv::double_element_block::cend(*blk.data); + for (; it != it_end; ++it) + result += *it; + } +}; + +void mtm_perf_test_iterate_elements() +{ + cout << "measuring performance on iterating over all numeric elements." << endl; + size_t rowsize = 100000; + size_t colsize = 1000; + cout << "row size: " << rowsize << " column size: " << colsize << endl; + mtx_type mx(rowsize, colsize, 0.0); + { + stack_watch sw; + double val = 1.0; + std::vector<double> vals; + vals.reserve(rowsize * colsize); + for (size_t i = 0; i < rowsize; ++i) + { + for (size_t j = 0; j < colsize; ++j) + { + vals.push_back(val); + val += 0.001; + } + } + mx.set(0, 0, vals.begin(), vals.end()); + cout << "element values inserted. (duration: " << sw.get_duration() << " sec)" << endl; + } + + { + stack_watch sw; + sum_all_values func; + mx.walk(func); + double val = func.result; + cout << "all element values added. (answer: " << val << ") (duration: " << sw.get_duration() << " sec)" + << endl; + } +} + +void mtm_perf_test_insert_via_position_object() +{ + size_t rowsize = 3000, colsize = 3000; + { + stack_printer __stack_printer__("::mtm_perf_test_insert_via_position_object (column and row positions)"); + mtx_type mx(rowsize, colsize); + for (size_t i = 0; i < rowsize; ++i) + { + for (size_t j = 0; j < colsize; ++j) + { + mx.set(i, j, 1.1); + } + } + } + + { + stack_printer __stack_printer__("::mtm_perf_test_insert_via_position_object (position object)"); + mtx_type mx(rowsize, colsize); + mtx_type::position_type pos = mx.position(0, 0); + for (size_t i = 0; i < rowsize; ++i) + { + for (size_t j = 0; j < colsize; ++j) + { + pos = mx.set(pos, 1.1); + pos = mtx_type::next_position(pos); + } + } + } + + { + stack_printer __stack_printer__("::mtm_perf_test_insert_via_position_object (position object)"); + mtx_type mx(rowsize, colsize); + mtx_type::position_type pos = mx.position(0, 0); + for (; pos != mx.end_position(); pos = mtx_type::next_position(pos)) + pos = mx.set(pos, 1.1); + } +} + +int main(int argc, char** argv) +{ + try + { + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; + + if (opt.test_func) + { + mtm_test_construction(); + mtm_test_data_insertion(); + mtm_test_data_insertion_multiple(); + mtm_test_data_insertion_integer(); + mtm_test_set_empty(); + mtm_test_swap(); + mtm_test_transpose(); + mtm_test_resize(); + mtm_test_copy(); + mtm_test_copy_empty_destination(); + mtm_test_copy_from_array(); + mtm_test_assignment(); + mtm_test_numeric(); + mtm_test_custom_string(); + mtm_test_position(); + mtm_test_set_data_via_position(); + } + + if (opt.test_perf) + { + mtm_perf_test_storage_creation(); + mtm_perf_test_storage_set_numeric(); + mtm_perf_test_iterate_elements(); + mtm_perf_test_insert_via_position_object(); + } + } + catch (const std::exception& e) + { + fprintf(stdout, "Test failed: %s\n", e.what()); + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} diff --git a/test/multi_type_matrix/test_walk.cpp b/test/multi_type_matrix/test_walk.cpp new file mode 100644 index 0000000..5bb4e9f --- /dev/null +++ b/test/multi_type_matrix/test_walk.cpp @@ -0,0 +1,640 @@ +/************************************************************************* + * + * Copyright (c) 2012-2016 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. + +#include <mdds/multi_type_matrix.hpp> + +#include <string> +#include <ostream> +#include <memory> + +using namespace mdds; +using namespace std; + +// Standard matrix that uses std::string as its string type. +typedef multi_type_matrix<mtm::std_string_traits> mtx_type; + +inline std::ostream& operator<<(std::ostream& os, const mtx_type::element_block_node_type& node) +{ + os << "(type=" << node.type << "; offset=" << node.offset << "; size=" << node.size << ")"; + return os; +} + +template<typename _T> +struct print_element +{ + void operator()(const _T& v) const + { + cout << v << endl; + } +}; + +class walk_element_block +{ + size_t m_node_count = 0; + +public: + void operator()(const mtx_type::element_block_node_type& node) + { + switch (node.type) + { + case mtm::element_boolean: + { + mtx_type::boolean_block_type::const_iterator it = mtx_type::boolean_block_type::begin(*node.data); + std::advance(it, node.offset); + mtx_type::boolean_block_type::const_iterator it_end = it; + std::advance(it_end, node.size); + std::for_each(it, it_end, print_element<bool>()); + } + break; + case mtm::element_string: + { + mtx_type::string_block_type::const_iterator it = mtx_type::string_block_type::begin(*node.data); + std::advance(it, node.offset); + mtx_type::string_block_type::const_iterator it_end = it; + std::advance(it_end, node.size); + std::for_each(it, it_end, print_element<mtx_type::string_type>()); + } + break; + case mtm::element_numeric: + { + mtx_type::numeric_block_type::const_iterator it = mtx_type::numeric_block_type::begin(*node.data); + std::advance(it, node.offset); + mtx_type::numeric_block_type::const_iterator it_end = it; + std::advance(it_end, node.size); + std::for_each(it, it_end, print_element<double>()); + } + break; + case mtm::element_empty: + cout << "- empty block -" << endl; + break; + default:; + } + + ++m_node_count; + } + + size_t get_node_count() const + { + return m_node_count; + } +}; + +class walk_element_block_move_only +{ + size_t m_node_count = 0; + +public: + walk_element_block_move_only() + {} + + walk_element_block_move_only(walk_element_block_move_only&& other) : m_node_count(other.m_node_count) + { + other.m_node_count = 0; + } + + walk_element_block_move_only& operator=(walk_element_block_move_only&& other) + { + m_node_count = other.m_node_count; + other.m_node_count = 0; + return *this; + } + + void operator()(const mtx_type::element_block_node_type& /*node*/) + { + ++m_node_count; + } + + size_t get_node_count() const + { + return m_node_count; + } +}; + +void mtm_test_walk() +{ + stack_printer __stack_printer__("::mtm_test_walk"); + mtx_type mtx(12, 1); // single column matrix to make it easier. + mtx.set(2, 0, 1.1); + mtx.set(3, 0, 1.2); + mtx.set(4, 0, 1.3); + mtx.set(5, 0, 1.4); + mtx.set(7, 0, string("A")); + mtx.set(8, 0, string("B")); + mtx.set(9, 0, string("C")); + mtx.set(10, 0, false); + mtx.set(11, 0, true); + walk_element_block func; + func = mtx.walk(func); + assert(func.get_node_count() == 5); + + walk_element_block_move_only func_mo; + func_mo = mtx.walk(std::move(func_mo)); + assert(func_mo.get_node_count() == 5); +} + +void mtm_test_walk_subset() +{ + { + stack_printer __stack_printer__("::mtm_test_walk_subset test1"); + mtx_type mtx(4, 4); + mtx.set(1, 1, 1.1); + mtx.set(2, 1, 1.2); + mtx.set(3, 1, 1.3); + mtx.set(0, 2, string("A1")); + mtx.set(1, 2, string("A2")); + mtx.set(2, 2, false); + walk_element_block func; + func = mtx.walk(func, mtx_type::size_pair_type(1, 1), mtx_type::size_pair_type(2, 2)); + assert(func.get_node_count() == 3); + } + { + stack_printer __stack_printer__("::mtm_test_walk_subset test2"); + mtx_type mtx(4, 4); + mtx.set(0, 1, 1.0); + mtx.set(1, 1, 1.1); + mtx.set(0, 2, string("A1")); + mtx.set(1, 2, string("A2")); + mtx.set(2, 2, string("A3")); + mtx.set(3, 2, string("A4")); + walk_element_block func; + func = mtx.walk(func, mtx_type::size_pair_type(1, 1), mtx_type::size_pair_type(2, 2)); + assert(func.get_node_count() == 3); + } +} + +template<typename _Blk> +void push_to_buffer(const mtx_type::element_block_node_type& node, std::vector<string>& buf) +{ + auto it = node.begin<_Blk>(); + auto ite = node.end<_Blk>(); + std::for_each(it, ite, [&](const typename _Blk::value_type& v) { + ostringstream os; + os << v; + buf.push_back(os.str()); + }); +} + +template<> +void push_to_buffer<mtx_type::boolean_block_type>( + const mtx_type::element_block_node_type& node, std::vector<string>& buf) +{ + using blk_type = mtx_type::boolean_block_type; + auto it = node.begin<blk_type>(); + auto ite = node.end<blk_type>(); + std::for_each(it, ite, [&](bool v) { + ostringstream os; + os << (v ? "true" : "false"); + buf.push_back(os.str()); + }); +} + +class parallel_walk_element_block +{ + using strlist_type = std::vector<string>; + + std::string m_name; + std::shared_ptr<strlist_type> m_ls; + std::shared_ptr<strlist_type> m_rs; + + void process_node(const mtx_type::element_block_node_type& node, strlist_type& buf) + { + switch (node.type) + { + case mtm::element_boolean: + push_to_buffer<mtx_type::boolean_block_type>(node, buf); + break; + case mtm::element_string: + push_to_buffer<mtx_type::string_block_type>(node, buf); + break; + case mtm::element_numeric: + push_to_buffer<mtx_type::numeric_block_type>(node, buf); + break; + case mtm::element_empty: + for (size_t i = 0; i < node.size; ++i) + buf.push_back("' '"); + break; + default:; + } + } + +public: + parallel_walk_element_block(std::string name) + : m_name(std::move(name)), m_ls(std::make_shared<strlist_type>()), m_rs(std::make_shared<strlist_type>()) + {} + parallel_walk_element_block(const parallel_walk_element_block& other) + : m_name(other.m_name), m_ls(other.m_ls), m_rs(other.m_rs) + {} + parallel_walk_element_block(parallel_walk_element_block&& other) + : m_name(std::move(other.m_name)), m_ls(std::move(other.m_ls)), m_rs(std::move(other.m_rs)) + {} + + parallel_walk_element_block& operator=(parallel_walk_element_block other) + { + swap(other); + return *this; + } + + void swap(parallel_walk_element_block& other) + { + m_ls.swap(other.m_ls); + m_rs.swap(other.m_rs); + } + + void operator()(const mtx_type::element_block_node_type& left, const mtx_type::element_block_node_type& right) + { + cout << "--" << endl; + cout << "l: " << left << endl; + cout << "r: " << right << endl; + process_node(left, *m_ls); + process_node(right, *m_rs); + } + + strlist_type get_concat_buffer() const + { + strlist_type buf; + assert(m_ls->size() == m_rs->size()); + auto it = m_ls->begin(), it2 = m_rs->begin(); + auto ite = m_ls->end(); + for (; it != ite; ++it, ++it2) + { + ostringstream os; + os << *it << ":" << *it2; + buf.push_back(os.str()); + } + + return buf; + } + + void clear() + { + m_ls->clear(); + m_rs->clear(); + } + + const std::string& get_name() const + { + return m_name; + } + + void set_name(std::string name) + { + m_name = std::move(name); + } +}; + +bool check_concat_buffer(std::vector<string> concat, const char* expected[], size_t expected_size) +{ + if (concat.size() != expected_size) + { + cerr << "expected size: " << expected_size << ", actual size: " << concat.size() << endl; + return false; + } + + for (size_t i = 0; i < expected_size; ++i) + { + if (concat[i] != expected[i]) + { + cerr << i << ": expected value: " << expected[i] << ", actual value: " << concat[i] << endl; + return false; + } + } + + return true; +} + +void mtm_test_parallel_walk() +{ + stack_printer __stack_printer__("::mtm_test_parallel_walk"); + + parallel_walk_element_block func("test0"); + mtx_type left(10, 1), right(10, 1, string("'+'")); + + right.set(2, 0, 1.2); + right.set(8, 0, false); + right.set(9, 0, true); + + left.set(0, 0, 122.0); + left.set(4, 0, string("A12")); + left.set(5, 0, string("A25")); + + { + func = left.walk(func, right); + assert(func.get_name() == "test0"); + + const char* expected[] = { + "122:'+'", "' ':'+'", "' ':1.2", "' ':'+'", "A12:'+'", + "A25:'+'", "' ':'+'", "' ':'+'", "' ':false", "' ':true", + }; + + size_t n = std::size(expected); + assert(check_concat_buffer(func.get_concat_buffer(), expected, n)); + } + + func.clear(); + + { + func.set_name("test0-2"); + func = left.walk(func, right, mtx_type::size_pair_type(2, 0), mtx_type::size_pair_type(8, 0)); + assert(func.get_name() == "test0-2"); + + const char* expected[] = { + "' ':1.2", "' ':'+'", "A12:'+'", "A25:'+'", "' ':'+'", "' ':'+'", "' ':false", + }; + + size_t n = std::size(expected); + assert(check_concat_buffer(func.get_concat_buffer(), expected, n)); + } + + func.clear(); + + { + // Only one row. + func.set_name("test0-3"); + func = left.walk(func, right, mtx_type::size_pair_type(4, 0), mtx_type::size_pair_type(4, 0)); + assert(func.get_name() == "test0-3"); + + const char* expected[] = { + "A12:'+'", + }; + + size_t n = std::size(expected); + assert(check_concat_buffer(func.get_concat_buffer(), expected, n)); + } +} + +void mtm_test_parallel_walk_non_equal_size() +{ + stack_printer __stack_printer__("::mtm_test_parallel_walk_non_equal_size"); + + mtx_type left(3, 3), right(2, 2); + + left.set(0, 0, 10.0); + left.set(1, 0, 20.0); + left.set(2, 0, 30.0); + left.set(0, 1, 40.0); + left.set(1, 1, 50.0); + left.set(2, 1, 60.0); + left.set(0, 2, 70.0); + left.set(1, 2, 80.0); + left.set(2, 2, 90.0); + + right.set(0, 0, string("A")); + right.set(1, 0, string("B")); + right.set(0, 1, string("C")); + right.set(1, 1, string("D")); + + { + // Only walk the top-left 2x2 range. + parallel_walk_element_block func("test1"); + func = left.walk(func, right, mtx_type::size_pair_type(0, 0), mtx_type::size_pair_type(1, 1)); + assert(func.get_name() == "test1"); + + const char* expected[] = { + "10:A", + "20:B", + "40:C", + "50:D", + }; + + size_t n = std::size(expected); + assert(check_concat_buffer(func.get_concat_buffer(), expected, n)); + } + + // Break up the blocks a little. + left.set(1, 0, true); + left.set(0, 1, false); + right.set(0, 0, -99.0); + right.set(1, 1, -9.9); + + { + // Only walk the top-left 2x2 range. + parallel_walk_element_block func("test2"); + func = left.walk(func, right, mtx_type::size_pair_type(0, 0), mtx_type::size_pair_type(1, 1)); + assert(func.get_name() == "test2"); + + const char* expected[] = { + "10:-99", + "true:B", + "false:C", + "50:-9.9", + }; + + size_t n = std::size(expected); + assert(check_concat_buffer(func.get_concat_buffer(), expected, n)); + } +} + +/** + * Make sure the walk methods can take lambdas. + */ +void mtm_test_walk_with_lambda() +{ + stack_printer __stack_printer__("::mtm_test_walk_with_lambda"); + vector<double> values = {1.1, 1.2, 1.3, 1.4}; + mtx_type mtx(2, 2, values.begin(), values.end()); + + mtx.walk([](const mtx_type::element_block_node_type& node) { + assert(node.type == mdds::mtm::element_numeric); + assert(node.offset == 0); + assert(node.size == 4); + }); + + struct section + { + mdds::mtm::element_t type; + size_t offset; + size_t size; + + bool operator==(const section& other) const + { + return type == other.type && offset == other.offset && size == other.size; + } + }; + + std::vector<section> expected = { + {mdds::mtm::element_numeric, 0, 1}, + {mdds::mtm::element_numeric, 2, 1}, + }; + + std::vector<section> actual; + + mtx.walk( + [&](const mtx_type::element_block_node_type& node) { + actual.emplace_back(); + actual.back().type = node.type; + actual.back().offset = node.offset; + actual.back().size = node.size; + }, + {0, 0}, {0, 1} // (row=0, column=0) to (row=0, column=1) + ); + + assert(expected == actual); +} + +void mtm_test_parallel_walk_with_lambda() +{ + stack_printer __stack_printer__("::mtm_test_parallel_walk_with_lambda"); + + vector<double> values = {1.1, 1.2, 1.3, 1.4}; + mtx_type mtx1(2, 2, values.begin(), values.end()); + + mtx_type mtx2(2, 2); + mtx2.set(0, 0, 2.2); + mtx2.set(1, 0, 2.5); + mtx2.set(0, 1, true); + mtx2.set(1, 1, false); + + struct section + { + mdds::mtm::element_t type; + size_t offset; + size_t size; + + bool operator==(const section& other) const + { + return type == other.type && offset == other.offset && size == other.size; + } + }; + + struct section_pair + { + section left; + section right; + + bool operator==(const section_pair& other) const + { + return left == other.left && right == other.right; + } + }; + + std::vector<section_pair> expected = { + {{mdds::mtm::element_numeric, 0, 2}, {mdds::mtm::element_numeric, 0, 2}}, + {{mdds::mtm::element_numeric, 2, 2}, {mdds::mtm::element_boolean, 0, 2}}, + }; + + std::vector<section_pair> actual; + + cout << "--" << endl; + + mtx1.walk( + [&](const mtx_type::element_block_node_type& l, const mtx_type::element_block_node_type& r) { + cout << "left: " << l << "; right: " << r << endl; + actual.emplace_back(); + actual.back().left.type = l.type; + actual.back().left.offset = l.offset; + actual.back().left.size = l.size; + actual.back().right.type = r.type; + actual.back().right.offset = r.offset; + actual.back().right.size = r.size; + }, + mtx2); + + assert(expected == actual); + + mtx_type mtx3(4, 4, 1.0), mtx4(4, 4, std::string("A")); + mtx3.set(2, 0, true); + mtx3.set(3, 0, true); + mtx4.set(0, 1, 2.2); + mtx4.set(1, 1, 2.3); + mtx4.set(0, 2, 1.1); + mtx4.set(1, 2, 1.1); + mtx3.set(1, 2, true); + mtx3.set(2, 2, false); + + expected = { + {{mdds::mtm::element_numeric, 0, 2}, {mdds::mtm::element_string, 0, 2}}, + {{mdds::mtm::element_boolean, 0, 1}, {mdds::mtm::element_string, 2, 1}}, + + {{mdds::mtm::element_numeric, 0, 2}, {mdds::mtm::element_numeric, 0, 2}}, + {{mdds::mtm::element_numeric, 2, 1}, {mdds::mtm::element_string, 0, 1}}, + + {{mdds::mtm::element_numeric, 4, 1}, {mdds::mtm::element_numeric, 0, 1}}, + {{mdds::mtm::element_boolean, 0, 1}, {mdds::mtm::element_numeric, 1, 1}}, + {{mdds::mtm::element_boolean, 1, 1}, {mdds::mtm::element_string, 0, 1}}, + }; + + actual.clear(); + + cout << "--" << endl; + + mtx3.walk( + [&](const mtx_type::element_block_node_type& l, const mtx_type::element_block_node_type& r) { + cout << "left: " << l << "; right: " << r << endl; + actual.emplace_back(); + actual.back().left.type = l.type; + actual.back().left.offset = l.offset; + actual.back().left.size = l.size; + actual.back().right.type = r.type; + actual.back().right.offset = r.offset; + actual.back().right.size = r.size; + }, + mtx4, {0, 0}, {2, 2}); + + assert(expected.size() == actual.size()); + assert(expected[0] == actual[0]); + assert(expected[1] == actual[1]); + assert(expected[2] == actual[2]); + assert(expected[3] == actual[3]); + assert(expected[4] == actual[4]); + assert(expected[5] == actual[5]); + assert(expected[6] == actual[6]); +} + +int main(int argc, char** argv) +{ + try + { + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; + + if (opt.test_func) + { + mtm_test_walk(); + mtm_test_walk_subset(); + mtm_test_parallel_walk(); + mtm_test_parallel_walk_non_equal_size(); + mtm_test_walk_with_lambda(); + mtm_test_parallel_walk_with_lambda(); + } + + if (opt.test_perf) + { + // no perf test yet. + } + } + catch (const std::exception& e) + { + fprintf(stdout, "Test failed: %s\n", e.what()); + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} diff --git a/test/multi_type_vector/Makefile.am b/test/multi_type_vector/Makefile.am new file mode 100644 index 0000000..19956de --- /dev/null +++ b/test/multi_type_vector/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = collection custom custom-trait debug-util default element-blocks event perf diff --git a/test/multi_type_vector/Makefile.in b/test/multi_type_vector/Makefile.in new file mode 100644 index 0000000..8793bb0 --- /dev/null +++ b/test/multi_type_vector/Makefile.in @@ -0,0 +1,638 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = collection custom custom-trait debug-util default element-blocks event perf +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/collection/Makefile.am b/test/multi_type_vector/collection/Makefile.am new file mode 100644 index 0000000..ddfbe44 --- /dev/null +++ b/test/multi_type_vector/collection/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = aos soa tc diff --git a/test/multi_type_vector/collection/Makefile.in b/test/multi_type_vector/collection/Makefile.in new file mode 100644 index 0000000..36b54da --- /dev/null +++ b/test/multi_type_vector/collection/Makefile.in @@ -0,0 +1,638 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/collection +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = aos soa tc +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/collection/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/collection/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/collection/aos/Makefile.am b/test/multi_type_vector/collection/aos/Makefile.am new file mode 100644 index 0000000..c4b4f95 --- /dev/null +++ b/test/multi_type_vector/collection/aos/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/collection/aos/Makefile.in b/test/multi_type_vector/collection/aos/Makefile.in new file mode 100644 index 0000000..da559b0 --- /dev/null +++ b/test/multi_type_vector/collection/aos/Makefile.in @@ -0,0 +1,1028 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/multi_type_vector/collection/aos +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main-test_main.$(OBJEXT) \ + $(top_builddir)/test/test_main-test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po \ + ./$(DEPDIR)/test_main-test_main.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/collection/aos/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/collection/aos/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_main-test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_main-test_main.o: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.o -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp + +test_main-test_main.obj: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.obj -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` + +$(top_builddir)/test/test_main-test_global.o: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.o -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp + +$(top_builddir)/test/test_main-test_global.obj: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.obj -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/collection/aos/test_main.cpp b/test/multi_type_vector/collection/aos/test_main.cpp new file mode 100644 index 0000000..41eb8b5 --- /dev/null +++ b/test/multi_type_vector/collection/aos/test_main.cpp @@ -0,0 +1,67 @@ +/************************************************************************* + * + * Copyright (c) 2016-2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/aos/main.hpp> +#include <mdds/multi_type_vector/collection.hpp> + +#include <iostream> +#include <vector> +#include <deque> +#include <memory> + +using mtv_type = mdds::mtv::aos::multi_type_vector<mdds::mtv::standard_element_blocks_traits>; +using cols_type = mdds::mtv::collection<mtv_type>; + +#include "all.inl" + +int main() +{ + try + { + mtv_test_empty(); + mtv_test_pointer_size1(); + mtv_test_unique_pointer_size1(); + mtv_test_shared_pointer_size2(); + mtv_test_non_pointer_size1(); + mtv_test_invalid_collection(); + mtv_test_sub_element_ranges(); + mtv_test_sub_element_ranges_invalid(); + mtv_test_sub_collection_ranges_invalid(); + mtv_test_boolean_block(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} diff --git a/test/multi_type_vector/collection/soa/Makefile.am b/test/multi_type_vector/collection/soa/Makefile.am new file mode 100644 index 0000000..c4b4f95 --- /dev/null +++ b/test/multi_type_vector/collection/soa/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/collection/soa/Makefile.in b/test/multi_type_vector/collection/soa/Makefile.in new file mode 100644 index 0000000..294229e --- /dev/null +++ b/test/multi_type_vector/collection/soa/Makefile.in @@ -0,0 +1,1028 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/multi_type_vector/collection/soa +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main-test_main.$(OBJEXT) \ + $(top_builddir)/test/test_main-test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po \ + ./$(DEPDIR)/test_main-test_main.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/collection/soa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/collection/soa/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_main-test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_main-test_main.o: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.o -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp + +test_main-test_main.obj: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.obj -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` + +$(top_builddir)/test/test_main-test_global.o: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.o -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp + +$(top_builddir)/test/test_main-test_global.obj: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.obj -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/collection/soa/test_main.cpp b/test/multi_type_vector/collection/soa/test_main.cpp new file mode 100644 index 0000000..f2f0154 --- /dev/null +++ b/test/multi_type_vector/collection/soa/test_main.cpp @@ -0,0 +1,67 @@ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/soa/main.hpp> +#include <mdds/multi_type_vector/collection.hpp> + +#include <iostream> +#include <vector> +#include <deque> +#include <memory> + +using mtv_type = mdds::mtv::soa::multi_type_vector<mdds::mtv::standard_element_blocks_traits>; +using cols_type = mdds::mtv::collection<mtv_type>; + +#include "all.inl" + +int main() +{ + try + { + mtv_test_empty(); + mtv_test_pointer_size1(); + mtv_test_unique_pointer_size1(); + mtv_test_shared_pointer_size2(); + mtv_test_non_pointer_size1(); + mtv_test_invalid_collection(); + mtv_test_sub_element_ranges(); + mtv_test_sub_element_ranges_invalid(); + mtv_test_sub_collection_ranges_invalid(); + mtv_test_boolean_block(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} diff --git a/test/multi_type_vector/collection/tc/Makefile.am b/test/multi_type_vector/collection/tc/Makefile.am new file mode 100644 index 0000000..fa2214a --- /dev/null +++ b/test/multi_type_vector/collection/tc/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = all.inl diff --git a/test/multi_type_vector/collection/tc/Makefile.in b/test/multi_type_vector/collection/tc/Makefile.in new file mode 100644 index 0000000..0a56a42 --- /dev/null +++ b/test/multi_type_vector/collection/tc/Makefile.in @@ -0,0 +1,460 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/collection/tc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +EXTRA_DIST = all.inl +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/collection/tc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/collection/tc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am check-valgrind-am \ + check-valgrind-drd-am check-valgrind-drd-local \ + check-valgrind-helgrind-am check-valgrind-helgrind-local \ + check-valgrind-local check-valgrind-memcheck-am \ + check-valgrind-memcheck-local check-valgrind-sgcheck-am \ + check-valgrind-sgcheck-local clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/collection/tc/all.inl b/test/multi_type_vector/collection/tc/all.inl new file mode 100644 index 0000000..8c78c3e --- /dev/null +++ b/test/multi_type_vector/collection/tc/all.inl @@ -0,0 +1,394 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_empty() +{ + stack_printer __stack_printer__(__FUNCTION__); + cols_type empty; + assert(empty.begin() == empty.end()); +} + +void mtv_test_pointer_size1() +{ + stack_printer __stack_printer__(__FUNCTION__); + + // Two vectors of size 1, both of which are totally empty. + + std::vector<mtv_type*> vectors; + for (size_t i = 0; i < 2; ++i) + vectors.push_back(new mtv_type(1)); + + cols_type collection(vectors.begin(), vectors.end()); + cols_type::const_iterator it, ite; + it = collection.begin(); + ite = collection.end(); + assert(it->type == mdds::mtv::element_type_empty); + assert((it++)->index == 0); + assert(it != ite); + + assert(it->type == mdds::mtv::element_type_empty); + assert(it->index == 1); + + assert(++it == ite); + + for_each(vectors.begin(), vectors.end(), [](const mtv_type* p) { delete p; }); +} + +void mtv_test_unique_pointer_size1() +{ + stack_printer __stack_printer__(__FUNCTION__); + + // Two vector of size 1, with empty and numeric values. + + std::vector<std::unique_ptr<mtv_type>> vectors; + for (size_t i = 0; i < 2; ++i) + vectors.push_back(std::make_unique<mtv_type>(1)); + + vectors[1]->set(0, 1.1); + + cols_type collection(vectors.begin(), vectors.end()); + cols_type::const_iterator it = collection.begin(), ite = collection.end(); + assert((*it).type == mdds::mtv::element_type_empty); + assert((*it).index == 0); + + ++it; + assert((*it).type == mdds::mtv::element_type_double); + assert((*it).index == 1); + assert(it->get<mdds::mtv::double_element_block>() == 1.1); + + assert(++it == ite); +} + +void mtv_test_shared_pointer_size2() +{ + stack_printer __stack_printer__(__FUNCTION__); + + std::vector<std::shared_ptr<mtv_type>> vectors; + vectors.push_back(std::make_shared<mtv_type>(2, 2.3)); + vectors.push_back(std::make_shared<mtv_type>(2, std::string("test"))); + + cols_type collection(vectors.begin(), vectors.end()); + assert(collection.size() == 2); + + cols_type::const_iterator it = collection.begin(); + + assert(it->type == mdds::mtv::element_type_double); + assert(it->index == 0); + assert(it->position == 0); + assert(it->get<mdds::mtv::double_element_block>() == 2.3); + + ++it; + assert(it->type == mdds::mtv::element_type_string); + assert(it->index == 1); + assert(it->position == 0); + assert(it->get<mdds::mtv::string_element_block>() == "test"); + + ++it; + assert(it->type == mdds::mtv::element_type_double); + assert(it->index == 0); + assert(it->position == 1); + assert(it->get<mdds::mtv::double_element_block>() == 2.3); + + ++it; + assert(it->type == mdds::mtv::element_type_string); + assert(it->index == 1); + assert(it->position == 1); + assert(it->get<mdds::mtv::string_element_block>() == "test"); + + assert(++it == collection.end()); +} + +void mtv_test_non_pointer_size1() +{ + stack_printer __stack_printer__(__FUNCTION__); + + // Test 1 by 1 grid. + + std::vector<mtv_type> vectors; + vectors.reserve(1); + vectors.emplace_back(1, int8_t('c')); + + cols_type collection(vectors.begin(), vectors.end()); + assert(collection.size() == 1); + + auto it = collection.begin(); + assert(it->type == mdds::mtv::element_type_int8); + assert(it->index == 0); + assert(it->position == 0); + assert(it->get<mdds::mtv::int8_element_block>() == 'c'); + + assert(++it == collection.end()); +} + +void mtv_test_invalid_collection() +{ + stack_printer __stack_printer__(__FUNCTION__); + + std::vector<mtv_type> vectors; + vectors.reserve(2); + vectors.emplace_back(1, int8_t('c')); + vectors.emplace_back(2); + + try + { + // Grouping vectors of different lengths is not allowed. + cols_type collection(vectors.begin(), vectors.end()); + assert(!"invalid_arg_error is expected to be thrown"); + } + catch (const mdds::invalid_arg_error&) + {} + + vectors.clear(); + vectors.emplace_back(0); + vectors.emplace_back(0); + + try + { + // Grouping of empty vectors is not allowed. + cols_type collection(vectors.begin(), vectors.end()); + assert(false); + } + catch (const mdds::invalid_arg_error&) + { + // Good. + } +} + +void mtv_test_sub_element_ranges() +{ + stack_printer __stack_printer__(__FUNCTION__); + + std::deque<mtv_type> vectors; + vectors.emplace_back(0); + vectors.emplace_back(0); + vectors.emplace_back(0); + + mtv_type* p = &vectors[0]; + p->push_back<int>(0); + p->push_back<int>(1); + p->push_back<int>(2); + + p = &vectors[1]; + p->push_back<int>(3); + p->push_back<int>(4); + p->push_back<int>(5); + + p = &vectors[2]; + p->push_back<int>(6); + p->push_back<int>(7); + p->push_back<int>(8); + + // +---+---+---+ + // | 0 | 3 | 6 | + // | 1 | 4 | 7 | + // | 2 | 5 | 8 | + // +---+---+---+ + + cols_type collection(vectors.begin(), vectors.end()); + + // Limit the element range. + + collection.set_element_range(1, 2); + + cols_type::const_iterator it = collection.begin(); + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 1); + assert(it->index == 0); + assert(it->position == 1); + + ++it; + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 4); + assert(it->index == 1); + assert(it->position == 1); + + ++it; + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 7); + assert(it->index == 2); + assert(it->position == 1); + + ++it; + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 2); + assert(it->index == 0); + assert(it->position == 2); + + ++it; + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 5); + assert(it->index == 1); + assert(it->position == 2); + + ++it; + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 8); + assert(it->index == 2); + assert(it->position == 2); + + assert(++it == collection.end()); + + // Limit the collection range. + collection.set_collection_range(1, 1); + it = collection.begin(); + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 4); + assert(it->index == 1); + assert(it->position == 1); + + ++it; + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 5); + assert(it->index == 1); + assert(it->position == 2); + + assert(++it == collection.end()); + + // Swap and try again. + cols_type swapped; + collection.swap(swapped); + it = swapped.begin(); + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 4); + assert(it->index == 1); + assert(it->position == 1); + + ++it; + assert(it->type == mdds::mtv::element_type_int32); + assert(it->get<mdds::mtv::int32_element_block>() == 5); + assert(it->index == 1); + assert(it->position == 2); + + assert(++it == swapped.end()); +} + +void mtv_test_sub_element_ranges_invalid() +{ + stack_printer __stack_printer__(__FUNCTION__); + + std::deque<mtv_type> vectors; + vectors.emplace_back(5); + vectors.emplace_back(5); + vectors.emplace_back(5); + + cols_type collection(vectors.begin(), vectors.end()); + try + { + // Empty size. + collection.set_element_range(0, 0); + assert(!"invalid_arg_error is expected to be thrown"); + } + catch (const mdds::invalid_arg_error&) + {} + + try + { + // out-of-range start position. + collection.set_element_range(5, 1); + assert(!"invalid_arg_error is expected to be thrown"); + } + catch (const mdds::invalid_arg_error&) + {} + + try + { + // out-of-range end position. + collection.set_element_range(0, 6); + assert(!"invalid_arg_error is expected to be thrown"); + } + catch (const mdds::invalid_arg_error&) + {} +} + +void mtv_test_sub_collection_ranges_invalid() +{ + stack_printer __stack_printer__(__FUNCTION__); + + std::deque<mtv_type> vectors; + vectors.emplace_back(1); + vectors.emplace_back(1); + vectors.emplace_back(1); + vectors.emplace_back(1); + vectors.emplace_back(1); + + cols_type collection(vectors.begin(), vectors.end()); + try + { + // Empty size. + collection.set_collection_range(0, 0); + assert(!"invalid_arg_error is expected to be thrown"); + } + catch (const mdds::invalid_arg_error&) + {} + + try + { + // out-of-range start position. + collection.set_collection_range(5, 1); + assert(!"invalid_arg_error is expected to be thrown"); + } + catch (const mdds::invalid_arg_error&) + {} + + try + { + // out-of-range end position. + collection.set_collection_range(0, 6); + assert(!"invalid_arg_error is expected to be thrown"); + } + catch (const mdds::invalid_arg_error&) + {} +} + +void mtv_test_boolean_block() +{ + stack_printer __stack_printer__(__FUNCTION__); + + std::vector<mtv_type> vectors; + vectors.reserve(2); + vectors.emplace_back(1, true); + vectors.emplace_back(1, false); + + cols_type collection(vectors.begin(), vectors.end()); + + auto it = collection.begin(); + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->index == 0); + assert(it->position == 0); + assert(it->get<mdds::mtv::boolean_element_block>() == true); + + ++it; + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->index == 1); + assert(it->position == 0); + assert(it->get<mdds::mtv::boolean_element_block>() == false); + + assert(++it == collection.end()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom-trait/Makefile.am b/test/multi_type_vector/custom-trait/Makefile.am new file mode 100644 index 0000000..e3dad36 --- /dev/null +++ b/test/multi_type_vector/custom-trait/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = aos soa + +EXTRA_DIST = tc/loop_unrolling.inl diff --git a/test/multi_type_vector/custom-trait/Makefile.in b/test/multi_type_vector/custom-trait/Makefile.in new file mode 100644 index 0000000..a755399 --- /dev/null +++ b/test/multi_type_vector/custom-trait/Makefile.in @@ -0,0 +1,639 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/custom-trait +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = aos soa +EXTRA_DIST = tc/loop_unrolling.inl +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/custom-trait/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/custom-trait/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/custom-trait/aos/Makefile.am b/test/multi_type_vector/custom-trait/aos/Makefile.am new file mode 100644 index 0000000..b5774c1 --- /dev/null +++ b/test/multi_type_vector/custom-trait/aos/Makefile.am @@ -0,0 +1,17 @@ + +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + -I$(srcdir)/../tc + +check_PROGRAMS = test + +test_SOURCES = \ + test_main.hpp \ + test_main.cpp \ + test_loop_unrolling.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/custom-trait/aos/Makefile.in b/test/multi_type_vector/custom-trait/aos/Makefile.in new file mode 100644 index 0000000..7b70aec --- /dev/null +++ b/test/multi_type_vector/custom-trait/aos/Makefile.in @@ -0,0 +1,1007 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test$(EXEEXT) +TESTS = test$(EXEEXT) +subdir = test/multi_type_vector/custom-trait/aos +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_OBJECTS = test_main.$(OBJEXT) test_loop_unrolling.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_OBJECTS = $(am_test_OBJECTS) +test_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_loop_unrolling.Po ./$(DEPDIR)/test_main.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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 = +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 = $(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 = +SOURCES = $(test_SOURCES) +DIST_SOURCES = $(test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + -I$(srcdir)/../tc + +test_SOURCES = \ + test_main.hpp \ + test_main.cpp \ + test_loop_unrolling.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/custom-trait/aos/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/custom-trait/aos/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) + @rm -f test$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_loop_unrolling.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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.log: test$(EXEEXT) + @p='test$(EXEEXT)'; \ + b='test'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_loop_unrolling.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_loop_unrolling.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/custom-trait/aos/test_loop_unrolling.cpp b/test/multi_type_vector/custom-trait/aos/test_loop_unrolling.cpp new file mode 100644 index 0000000..8b26e3d --- /dev/null +++ b/test/multi_type_vector/custom-trait/aos/test_loop_unrolling.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "loop_unrolling.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom-trait/aos/test_main.cpp b/test/multi_type_vector/custom-trait/aos/test_main.cpp new file mode 100644 index 0000000..b770a0c --- /dev/null +++ b/test/multi_type_vector/custom-trait/aos/test_main.cpp @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +int main() +{ + try + { + mtv_test_loop_unrolling_0(); + mtv_test_loop_unrolling_4(); + mtv_test_loop_unrolling_8(); + mtv_test_loop_unrolling_16(); + mtv_test_loop_unrolling_32(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom-trait/aos/test_main.hpp b/test/multi_type_vector/custom-trait/aos/test_main.hpp new file mode 100644 index 0000000..09d88dd --- /dev/null +++ b/test/multi_type_vector/custom-trait/aos/test_main.hpp @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/aos/main.hpp> + +template<typename Traits> +using mtv_alias_type = mdds::mtv::aos::multi_type_vector<Traits>; + +void mtv_test_loop_unrolling_0(); +void mtv_test_loop_unrolling_4(); +void mtv_test_loop_unrolling_8(); +void mtv_test_loop_unrolling_16(); +void mtv_test_loop_unrolling_32(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom-trait/soa/Makefile.am b/test/multi_type_vector/custom-trait/soa/Makefile.am new file mode 100644 index 0000000..5ea1671 --- /dev/null +++ b/test/multi_type_vector/custom-trait/soa/Makefile.am @@ -0,0 +1,18 @@ + +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + -I$(srcdir)/../tc + +check_PROGRAMS = test + +test_SOURCES = \ + test_main.hpp \ + test_main.cpp \ + test_loop_unrolling.cpp \ + test_loop_unrolling_simd.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/custom-trait/soa/Makefile.in b/test/multi_type_vector/custom-trait/soa/Makefile.in new file mode 100644 index 0000000..246ad54 --- /dev/null +++ b/test/multi_type_vector/custom-trait/soa/Makefile.in @@ -0,0 +1,1014 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test$(EXEEXT) +TESTS = test$(EXEEXT) +subdir = test/multi_type_vector/custom-trait/soa +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_OBJECTS = test_main.$(OBJEXT) test_loop_unrolling.$(OBJEXT) \ + test_loop_unrolling_simd.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_OBJECTS = $(am_test_OBJECTS) +test_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_loop_unrolling.Po \ + ./$(DEPDIR)/test_loop_unrolling_simd.Po \ + ./$(DEPDIR)/test_main.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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 = +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 = $(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 = +SOURCES = $(test_SOURCES) +DIST_SOURCES = $(test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + -I$(srcdir)/../tc + +test_SOURCES = \ + test_main.hpp \ + test_main.cpp \ + test_loop_unrolling.cpp \ + test_loop_unrolling_simd.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/custom-trait/soa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/custom-trait/soa/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) + @rm -f test$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_loop_unrolling.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_loop_unrolling_simd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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.log: test$(EXEEXT) + @p='test$(EXEEXT)'; \ + b='test'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_loop_unrolling.Po + -rm -f ./$(DEPDIR)/test_loop_unrolling_simd.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_loop_unrolling.Po + -rm -f ./$(DEPDIR)/test_loop_unrolling_simd.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/custom-trait/soa/test_loop_unrolling.cpp b/test/multi_type_vector/custom-trait/soa/test_loop_unrolling.cpp new file mode 100644 index 0000000..8b26e3d --- /dev/null +++ b/test/multi_type_vector/custom-trait/soa/test_loop_unrolling.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "loop_unrolling.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom-trait/soa/test_loop_unrolling_simd.cpp b/test/multi_type_vector/custom-trait/soa/test_loop_unrolling_simd.cpp new file mode 100644 index 0000000..f7a1126 --- /dev/null +++ b/test/multi_type_vector/custom-trait/soa/test_loop_unrolling_simd.cpp @@ -0,0 +1,201 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +namespace { + +using mdds::mtv::lu_factor_t; + +template<lu_factor_t F> +struct trait_lu : public mdds::mtv::standard_element_blocks_traits +{ + using event_func = mdds::mtv::empty_event_func; + + constexpr static lu_factor_t loop_unrolling = F; +}; + +template<lu_factor_t F> +void run_test() +{ + using mtv_type = mtv_alias_type<trait_lu<F>>; + + mtv_type db(5, std::string("test")); + + // keep inserting blocks of alternating types at position 0 to force block + // position adjustments. + + for (int i = 0; i < 50; ++i) + { + db.insert_empty(0, 2); + + std::vector<int8_t> values(2, 89); + db.insert(0, values.begin(), values.end()); + } +} + +} // namespace + +#if SIZEOF_VOID_P == 8 && defined(__SSE2__) + +void mtv_test_loop_unrolling_sse2_x64() +{ + stack_printer __stack_printer__(__FUNCTION__); + + run_test<lu_factor_t::sse2_x64>(); +} + +void mtv_test_loop_unrolling_sse2_x64_4() +{ + stack_printer __stack_printer__(__FUNCTION__); + + run_test<lu_factor_t::sse2_x64_lu4>(); +} + +void mtv_test_loop_unrolling_sse2_x64_8() +{ + stack_printer __stack_printer__(__FUNCTION__); + + run_test<lu_factor_t::sse2_x64_lu8>(); +} + +void mtv_test_loop_unrolling_sse2_x64_16() +{ + stack_printer __stack_printer__(__FUNCTION__); + + run_test<lu_factor_t::sse2_x64_lu16>(); +} + +#else + +void print_disabled_reasons_sse2() +{ + cout << "Test disabled for the following reasons:" << endl; + +#if SIZEOF_VOID_P != 8 + cout << " * not a 64-bit build" << endl; +#endif + +#ifndef __SSE2__ + cout << " * __SSE2__ not defined" << endl; +#endif +} + +void mtv_test_loop_unrolling_sse2_x64() +{ + stack_printer __stack_printer__(__FUNCTION__); + + print_disabled_reasons_sse2(); +} + +void mtv_test_loop_unrolling_sse2_x64_4() +{ + stack_printer __stack_printer__(__FUNCTION__); + + print_disabled_reasons_sse2(); +} + +void mtv_test_loop_unrolling_sse2_x64_8() +{ + stack_printer __stack_printer__(__FUNCTION__); + + print_disabled_reasons_sse2(); +} + +void mtv_test_loop_unrolling_sse2_x64_16() +{ + stack_printer __stack_printer__(__FUNCTION__); + + print_disabled_reasons_sse2(); +} + +#endif + +#if SIZEOF_VOID_P == 8 && defined(__AVX2__) + +void mtv_test_loop_unrolling_avx2_x64() +{ + stack_printer __stack_printer__(__FUNCTION__); + + run_test<lu_factor_t::avx2_x64>(); +} + +void mtv_test_loop_unrolling_avx2_x64_4() +{ + stack_printer __stack_printer__(__FUNCTION__); + + run_test<lu_factor_t::avx2_x64_lu4>(); +} + +void mtv_test_loop_unrolling_avx2_x64_8() +{ + stack_printer __stack_printer__(__FUNCTION__); + + run_test<lu_factor_t::avx2_x64_lu8>(); +} + +#else + +void print_disabled_reasons_avx2() +{ + cout << "Test disabled for the following reasons:" << endl; + +#if SIZEOF_VOID_P != 8 + cout << " * not a 64-bit build" << endl; +#endif + +#ifndef __AVX2__ + cout << " * __AVX2__ not defined" << endl; +#endif +} + +void mtv_test_loop_unrolling_avx2_x64() +{ + stack_printer __stack_printer__(__FUNCTION__); + + print_disabled_reasons_avx2(); +} + +void mtv_test_loop_unrolling_avx2_x64_4() +{ + stack_printer __stack_printer__(__FUNCTION__); + + print_disabled_reasons_avx2(); +} + +void mtv_test_loop_unrolling_avx2_x64_8() +{ + stack_printer __stack_printer__(__FUNCTION__); + + print_disabled_reasons_avx2(); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom-trait/soa/test_main.cpp b/test/multi_type_vector/custom-trait/soa/test_main.cpp new file mode 100644 index 0000000..b99bc98 --- /dev/null +++ b/test/multi_type_vector/custom-trait/soa/test_main.cpp @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +int main() +{ + try + { + mtv_test_loop_unrolling_0(); + mtv_test_loop_unrolling_4(); + mtv_test_loop_unrolling_8(); + mtv_test_loop_unrolling_16(); + mtv_test_loop_unrolling_32(); + mtv_test_loop_unrolling_sse2_x64(); + mtv_test_loop_unrolling_sse2_x64_4(); + mtv_test_loop_unrolling_sse2_x64_8(); + mtv_test_loop_unrolling_sse2_x64_16(); + mtv_test_loop_unrolling_avx2_x64(); + mtv_test_loop_unrolling_avx2_x64_4(); + mtv_test_loop_unrolling_avx2_x64_8(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom-trait/soa/test_main.hpp b/test/multi_type_vector/custom-trait/soa/test_main.hpp new file mode 100644 index 0000000..9007727 --- /dev/null +++ b/test/multi_type_vector/custom-trait/soa/test_main.hpp @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/soa/main.hpp> + +template<typename Traits> +using mtv_alias_type = mdds::mtv::soa::multi_type_vector<Traits>; + +void mtv_test_loop_unrolling_0(); +void mtv_test_loop_unrolling_4(); +void mtv_test_loop_unrolling_8(); +void mtv_test_loop_unrolling_16(); +void mtv_test_loop_unrolling_32(); + +void mtv_test_loop_unrolling_sse2_x64(); // SoA only +void mtv_test_loop_unrolling_sse2_x64_4(); // SoA only +void mtv_test_loop_unrolling_sse2_x64_8(); // SoA only +void mtv_test_loop_unrolling_sse2_x64_16(); // SoA only + +void mtv_test_loop_unrolling_avx2_x64(); // SoA only +void mtv_test_loop_unrolling_avx2_x64_4(); // SoA only +void mtv_test_loop_unrolling_avx2_x64_8(); // SoA only + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom-trait/tc/loop_unrolling.inl b/test/multi_type_vector/custom-trait/tc/loop_unrolling.inl new file mode 100644 index 0000000..e28420a --- /dev/null +++ b/test/multi_type_vector/custom-trait/tc/loop_unrolling.inl @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +namespace { + +using mdds::mtv::lu_factor_t; + +template<lu_factor_t F> +struct trait_lu : public mdds::mtv::standard_element_blocks_traits +{ + using event_func = mdds::mtv::empty_event_func; + + constexpr static lu_factor_t loop_unrolling = F; +}; + +} // namespace + +template<lu_factor_t F> +void mtv_test_loop_unrolling() +{ + cout << "loop unrolling factor = " << int(F) << endl; + using mtv_type = mtv_alias_type<trait_lu<F>>; + + mtv_type db(5, std::string("test")); + + // keep inserting blocks of alternating types at position 0 to force block + // position adjustments. + + for (int i = 0; i < 50; ++i) + { + db.insert_empty(0, 2); + + std::vector<int8_t> values(2, 89); + db.insert(0, values.begin(), values.end()); + } +} + +void mtv_test_loop_unrolling_0() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_test_loop_unrolling<lu_factor_t::none>(); +} + +void mtv_test_loop_unrolling_4() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_test_loop_unrolling<lu_factor_t::lu4>(); +} + +void mtv_test_loop_unrolling_8() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_test_loop_unrolling<lu_factor_t::lu8>(); +} + +void mtv_test_loop_unrolling_16() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_test_loop_unrolling<lu_factor_t::lu16>(); +} + +void mtv_test_loop_unrolling_32() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_test_loop_unrolling<lu_factor_t::lu32>(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/Makefile.am b/test/multi_type_vector/custom/Makefile.am new file mode 100644 index 0000000..729383f --- /dev/null +++ b/test/multi_type_vector/custom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = aos soa tc + +EXTRA_DIST = common_types.hpp diff --git a/test/multi_type_vector/custom/Makefile.in b/test/multi_type_vector/custom/Makefile.in new file mode 100644 index 0000000..e48ac6b --- /dev/null +++ b/test/multi_type_vector/custom/Makefile.in @@ -0,0 +1,639 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/custom +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = aos soa tc +EXTRA_DIST = common_types.hpp +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/custom/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/custom/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/custom/aos/Makefile.am b/test/multi_type_vector/custom/aos/Makefile.am new file mode 100644 index 0000000..e1b65e0 --- /dev/null +++ b/test/multi_type_vector/custom/aos/Makefile.am @@ -0,0 +1,26 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + test_basic.cpp \ + test_managed_block.cpp \ + test_misc.cpp \ + test_swap.cpp \ + test_transfer.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/custom/aos/Makefile.in b/test/multi_type_vector/custom/aos/Makefile.in new file mode 100644 index 0000000..07546cc --- /dev/null +++ b/test/multi_type_vector/custom/aos/Makefile.in @@ -0,0 +1,1128 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/multi_type_vector/custom/aos +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main-test_main.$(OBJEXT) \ + test_main-test_basic.$(OBJEXT) \ + test_main-test_managed_block.$(OBJEXT) \ + test_main-test_misc.$(OBJEXT) test_main-test_swap.$(OBJEXT) \ + test_main-test_transfer.$(OBJEXT) \ + $(top_builddir)/test/test_main-test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po \ + ./$(DEPDIR)/test_main-test_basic.Po \ + ./$(DEPDIR)/test_main-test_main.Po \ + ./$(DEPDIR)/test_main-test_managed_block.Po \ + ./$(DEPDIR)/test_main-test_misc.Po \ + ./$(DEPDIR)/test_main-test_swap.Po \ + ./$(DEPDIR)/test_main-test_transfer.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + test_basic.cpp \ + test_managed_block.cpp \ + test_misc.cpp \ + test_swap.cpp \ + test_transfer.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/custom/aos/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/custom/aos/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_main-test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_basic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_managed_block.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_misc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_swap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_transfer.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_main-test_main.o: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.o -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp + +test_main-test_main.obj: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.obj -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` + +test_main-test_basic.o: test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_basic.o -MD -MP -MF $(DEPDIR)/test_main-test_basic.Tpo -c -o test_main-test_basic.o `test -f 'test_basic.cpp' || echo '$(srcdir)/'`test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_basic.Tpo $(DEPDIR)/test_main-test_basic.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_basic.cpp' object='test_main-test_basic.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_basic.o `test -f 'test_basic.cpp' || echo '$(srcdir)/'`test_basic.cpp + +test_main-test_basic.obj: test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_basic.obj -MD -MP -MF $(DEPDIR)/test_main-test_basic.Tpo -c -o test_main-test_basic.obj `if test -f 'test_basic.cpp'; then $(CYGPATH_W) 'test_basic.cpp'; else $(CYGPATH_W) '$(srcdir)/test_basic.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_basic.Tpo $(DEPDIR)/test_main-test_basic.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_basic.cpp' object='test_main-test_basic.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_basic.obj `if test -f 'test_basic.cpp'; then $(CYGPATH_W) 'test_basic.cpp'; else $(CYGPATH_W) '$(srcdir)/test_basic.cpp'; fi` + +test_main-test_managed_block.o: test_managed_block.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_managed_block.o -MD -MP -MF $(DEPDIR)/test_main-test_managed_block.Tpo -c -o test_main-test_managed_block.o `test -f 'test_managed_block.cpp' || echo '$(srcdir)/'`test_managed_block.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_managed_block.Tpo $(DEPDIR)/test_main-test_managed_block.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_managed_block.cpp' object='test_main-test_managed_block.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_managed_block.o `test -f 'test_managed_block.cpp' || echo '$(srcdir)/'`test_managed_block.cpp + +test_main-test_managed_block.obj: test_managed_block.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_managed_block.obj -MD -MP -MF $(DEPDIR)/test_main-test_managed_block.Tpo -c -o test_main-test_managed_block.obj `if test -f 'test_managed_block.cpp'; then $(CYGPATH_W) 'test_managed_block.cpp'; else $(CYGPATH_W) '$(srcdir)/test_managed_block.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_managed_block.Tpo $(DEPDIR)/test_main-test_managed_block.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_managed_block.cpp' object='test_main-test_managed_block.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_managed_block.obj `if test -f 'test_managed_block.cpp'; then $(CYGPATH_W) 'test_managed_block.cpp'; else $(CYGPATH_W) '$(srcdir)/test_managed_block.cpp'; fi` + +test_main-test_misc.o: test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_misc.o -MD -MP -MF $(DEPDIR)/test_main-test_misc.Tpo -c -o test_main-test_misc.o `test -f 'test_misc.cpp' || echo '$(srcdir)/'`test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_misc.Tpo $(DEPDIR)/test_main-test_misc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_misc.cpp' object='test_main-test_misc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_misc.o `test -f 'test_misc.cpp' || echo '$(srcdir)/'`test_misc.cpp + +test_main-test_misc.obj: test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_misc.obj -MD -MP -MF $(DEPDIR)/test_main-test_misc.Tpo -c -o test_main-test_misc.obj `if test -f 'test_misc.cpp'; then $(CYGPATH_W) 'test_misc.cpp'; else $(CYGPATH_W) '$(srcdir)/test_misc.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_misc.Tpo $(DEPDIR)/test_main-test_misc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_misc.cpp' object='test_main-test_misc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_misc.obj `if test -f 'test_misc.cpp'; then $(CYGPATH_W) 'test_misc.cpp'; else $(CYGPATH_W) '$(srcdir)/test_misc.cpp'; fi` + +test_main-test_swap.o: test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap.o -MD -MP -MF $(DEPDIR)/test_main-test_swap.Tpo -c -o test_main-test_swap.o `test -f 'test_swap.cpp' || echo '$(srcdir)/'`test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap.Tpo $(DEPDIR)/test_main-test_swap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap.cpp' object='test_main-test_swap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap.o `test -f 'test_swap.cpp' || echo '$(srcdir)/'`test_swap.cpp + +test_main-test_swap.obj: test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap.obj -MD -MP -MF $(DEPDIR)/test_main-test_swap.Tpo -c -o test_main-test_swap.obj `if test -f 'test_swap.cpp'; then $(CYGPATH_W) 'test_swap.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap.Tpo $(DEPDIR)/test_main-test_swap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap.cpp' object='test_main-test_swap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap.obj `if test -f 'test_swap.cpp'; then $(CYGPATH_W) 'test_swap.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap.cpp'; fi` + +test_main-test_transfer.o: test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_transfer.o -MD -MP -MF $(DEPDIR)/test_main-test_transfer.Tpo -c -o test_main-test_transfer.o `test -f 'test_transfer.cpp' || echo '$(srcdir)/'`test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_transfer.Tpo $(DEPDIR)/test_main-test_transfer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_transfer.cpp' object='test_main-test_transfer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_transfer.o `test -f 'test_transfer.cpp' || echo '$(srcdir)/'`test_transfer.cpp + +test_main-test_transfer.obj: test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_transfer.obj -MD -MP -MF $(DEPDIR)/test_main-test_transfer.Tpo -c -o test_main-test_transfer.obj `if test -f 'test_transfer.cpp'; then $(CYGPATH_W) 'test_transfer.cpp'; else $(CYGPATH_W) '$(srcdir)/test_transfer.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_transfer.Tpo $(DEPDIR)/test_main-test_transfer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_transfer.cpp' object='test_main-test_transfer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_transfer.obj `if test -f 'test_transfer.cpp'; then $(CYGPATH_W) 'test_transfer.cpp'; else $(CYGPATH_W) '$(srcdir)/test_transfer.cpp'; fi` + +$(top_builddir)/test/test_main-test_global.o: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.o -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp + +$(top_builddir)/test/test_main-test_global.obj: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.obj -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_basic.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_managed_block.Po + -rm -f ./$(DEPDIR)/test_main-test_misc.Po + -rm -f ./$(DEPDIR)/test_main-test_swap.Po + -rm -f ./$(DEPDIR)/test_main-test_transfer.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_basic.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_managed_block.Po + -rm -f ./$(DEPDIR)/test_main-test_misc.Po + -rm -f ./$(DEPDIR)/test_main-test_swap.Po + -rm -f ./$(DEPDIR)/test_main-test_transfer.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/custom/aos/test_basic.cpp b/test/multi_type_vector/custom/aos/test_basic.cpp new file mode 100644 index 0000000..8857d98 --- /dev/null +++ b/test/multi_type_vector/custom/aos/test_basic.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "basic.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/aos/test_main.cpp b/test/multi_type_vector/custom/aos/test_main.cpp new file mode 100644 index 0000000..897c864 --- /dev/null +++ b/test/multi_type_vector/custom/aos/test_main.cpp @@ -0,0 +1,64 @@ +/************************************************************************* + * + * Copyright (c) 2012-2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include <memory> +#include <sstream> +#include <vector> + +using namespace std; + +int main() +{ + try + { + mtv_test_misc_types(); + mtv_test_misc_block_identifier(); + mtv_test_misc_custom_block_func1(); + mtv_test_misc_custom_block_func3(); + mtv_test_misc_release(); + mtv_test_misc_construction_with_array(); + mtv_test_basic(); + mtv_test_basic_equality(); + mtv_test_managed_block(); + mtv_test_transfer(); + mtv_test_swap(); + mtv_test_swap_2(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/aos/test_main.hpp b/test/multi_type_vector/custom/aos/test_main.hpp new file mode 100644 index 0000000..960a39c --- /dev/null +++ b/test/multi_type_vector/custom/aos/test_main.hpp @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#include "common_types.hpp" + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/aos/main.hpp> + +using mtv_type = mdds::mtv::aos::multi_type_vector<user_muser_trait>; +using mtv_fruit_type = mdds::mtv::aos::multi_type_vector<fruit_trait>; +using mtv3_type = mdds::mtv::aos::multi_type_vector<muser_fruit_date_trait>; + +void mtv_test_misc_types(); +void mtv_test_misc_block_identifier(); +void mtv_test_misc_custom_block_func1(); +void mtv_test_misc_custom_block_func3(); +void mtv_test_misc_release(); +void mtv_test_misc_construction_with_array(); +void mtv_test_basic(); +void mtv_test_basic_equality(); +void mtv_test_managed_block(); +void mtv_test_transfer(); +void mtv_test_swap(); +void mtv_test_swap_2(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/aos/test_managed_block.cpp b/test/multi_type_vector/custom/aos/test_managed_block.cpp new file mode 100644 index 0000000..f734fef --- /dev/null +++ b/test/multi_type_vector/custom/aos/test_managed_block.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "managed_block.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/aos/test_misc.cpp b/test/multi_type_vector/custom/aos/test_misc.cpp new file mode 100644 index 0000000..b8589e2 --- /dev/null +++ b/test/multi_type_vector/custom/aos/test_misc.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "misc.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/aos/test_swap.cpp b/test/multi_type_vector/custom/aos/test_swap.cpp new file mode 100644 index 0000000..21b7d24 --- /dev/null +++ b/test/multi_type_vector/custom/aos/test_swap.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "swap.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/aos/test_transfer.cpp b/test/multi_type_vector/custom/aos/test_transfer.cpp new file mode 100644 index 0000000..cc53440 --- /dev/null +++ b/test/multi_type_vector/custom/aos/test_transfer.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "transfer.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/common_types.hpp b/test/multi_type_vector/custom/common_types.hpp new file mode 100644 index 0000000..6b786d1 --- /dev/null +++ b/test/multi_type_vector/custom/common_types.hpp @@ -0,0 +1,162 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#include <mdds/multi_type_vector/macro.hpp> +#include <mdds/multi_type_vector/standard_element_blocks.hpp> + +/** Caller manages the life cycle of these cells. */ +struct user_cell +{ + double value; + + user_cell() : value(0.0) + {} + user_cell(double _v) : value(_v) + {} +}; + +/** + * Managed user cell: the storing block manages the life cycle of these + * cells. + */ +struct muser_cell +{ + double value; + + muser_cell() : value(0.0) + {} + muser_cell(const muser_cell& r) : value(r.value) + {} + muser_cell(double _v) : value(_v) + {} + ~muser_cell() + {} +}; + +enum my_fruit_type +{ + unknown_fruit = 0, + apple, + orange, + mango, + peach +}; + +struct date +{ + int year; + int month; + int day; + + date() : year(0), month(0), day(0) + {} + date(int _year, int _month, int _day) : year(_year), month(_month), day(_day) + {} +}; + +/** custom cell type definition. */ +constexpr mdds::mtv::element_t element_type_user_block = mdds::mtv::element_type_user_start; +constexpr mdds::mtv::element_t element_type_muser_block = mdds::mtv::element_type_user_start + 1; +constexpr mdds::mtv::element_t element_type_fruit_block = mdds::mtv::element_type_user_start + 2; +constexpr mdds::mtv::element_t element_type_date_block = mdds::mtv::element_type_user_start + 3; + +using user_cell_block = mdds::mtv::default_element_block<element_type_user_block, user_cell*>; +using muser_cell_block = mdds::mtv::managed_element_block<element_type_muser_block, muser_cell>; +using fruit_block = mdds::mtv::default_element_block<element_type_fruit_block, my_fruit_type>; +using date_block = mdds::mtv::default_element_block<element_type_date_block, date>; + +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS_PTR(user_cell, element_type_user_block, nullptr, user_cell_block) +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS_PTR(muser_cell, element_type_muser_block, nullptr, muser_cell_block) +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(my_fruit_type, element_type_fruit_block, unknown_fruit, fruit_block) +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(date, element_type_date_block, date(), date_block) + +template<typename T> +class cell_pool +{ + std::vector<std::unique_ptr<T>> m_pool; + +public: + cell_pool() = default; + cell_pool(const cell_pool&) = delete; + cell_pool& operator=(const cell_pool&) = delete; + + T* construct() + { + m_pool.emplace_back(new T); + return m_pool.back().get(); + } + + void clear() + { + m_pool.clear(); + } +}; + +class user_cell_pool : public cell_pool<user_cell> +{ +public: + user_cell* construct(double val) + { + user_cell* p = cell_pool<user_cell>::construct(); + p->value = val; + return p; + } +}; + +struct user_muser_trait : public mdds::mtv::default_traits +{ + using block_funcs = mdds::mtv::element_block_funcs< + mdds::mtv::boolean_element_block, mdds::mtv::int8_element_block, mdds::mtv::uint8_element_block, + mdds::mtv::int16_element_block, mdds::mtv::uint16_element_block, mdds::mtv::int32_element_block, + mdds::mtv::uint32_element_block, mdds::mtv::int64_element_block, mdds::mtv::uint64_element_block, + mdds::mtv::float_element_block, mdds::mtv::double_element_block, mdds::mtv::string_element_block, + user_cell_block, muser_cell_block>; +}; + +struct fruit_trait : public mdds::mtv::default_traits +{ + using block_funcs = mdds::mtv::element_block_funcs< + mdds::mtv::boolean_element_block, mdds::mtv::int8_element_block, mdds::mtv::uint8_element_block, + mdds::mtv::int16_element_block, mdds::mtv::uint16_element_block, mdds::mtv::int32_element_block, + mdds::mtv::uint32_element_block, mdds::mtv::int64_element_block, mdds::mtv::uint64_element_block, + mdds::mtv::float_element_block, mdds::mtv::double_element_block, mdds::mtv::string_element_block, fruit_block>; +}; + +struct muser_fruit_date_trait : public mdds::mtv::default_traits +{ + using block_funcs = mdds::mtv::element_block_funcs< + mdds::mtv::boolean_element_block, mdds::mtv::int8_element_block, mdds::mtv::uint8_element_block, + mdds::mtv::int16_element_block, mdds::mtv::uint16_element_block, mdds::mtv::int32_element_block, + mdds::mtv::uint32_element_block, mdds::mtv::int64_element_block, mdds::mtv::uint64_element_block, + mdds::mtv::float_element_block, mdds::mtv::double_element_block, mdds::mtv::string_element_block, + muser_cell_block, fruit_block, date_block>; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/soa/Makefile.am b/test/multi_type_vector/custom/soa/Makefile.am new file mode 100644 index 0000000..e1b65e0 --- /dev/null +++ b/test/multi_type_vector/custom/soa/Makefile.am @@ -0,0 +1,26 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + test_basic.cpp \ + test_managed_block.cpp \ + test_misc.cpp \ + test_swap.cpp \ + test_transfer.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/custom/soa/Makefile.in b/test/multi_type_vector/custom/soa/Makefile.in new file mode 100644 index 0000000..b38a4bb --- /dev/null +++ b/test/multi_type_vector/custom/soa/Makefile.in @@ -0,0 +1,1128 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/multi_type_vector/custom/soa +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main-test_main.$(OBJEXT) \ + test_main-test_basic.$(OBJEXT) \ + test_main-test_managed_block.$(OBJEXT) \ + test_main-test_misc.$(OBJEXT) test_main-test_swap.$(OBJEXT) \ + test_main-test_transfer.$(OBJEXT) \ + $(top_builddir)/test/test_main-test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po \ + ./$(DEPDIR)/test_main-test_basic.Po \ + ./$(DEPDIR)/test_main-test_main.Po \ + ./$(DEPDIR)/test_main-test_managed_block.Po \ + ./$(DEPDIR)/test_main-test_misc.Po \ + ./$(DEPDIR)/test_main-test_swap.Po \ + ./$(DEPDIR)/test_main-test_transfer.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + test_basic.cpp \ + test_managed_block.cpp \ + test_misc.cpp \ + test_swap.cpp \ + test_transfer.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/custom/soa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/custom/soa/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_main-test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_basic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_managed_block.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_misc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_swap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_transfer.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_main-test_main.o: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.o -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp + +test_main-test_main.obj: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.obj -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` + +test_main-test_basic.o: test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_basic.o -MD -MP -MF $(DEPDIR)/test_main-test_basic.Tpo -c -o test_main-test_basic.o `test -f 'test_basic.cpp' || echo '$(srcdir)/'`test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_basic.Tpo $(DEPDIR)/test_main-test_basic.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_basic.cpp' object='test_main-test_basic.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_basic.o `test -f 'test_basic.cpp' || echo '$(srcdir)/'`test_basic.cpp + +test_main-test_basic.obj: test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_basic.obj -MD -MP -MF $(DEPDIR)/test_main-test_basic.Tpo -c -o test_main-test_basic.obj `if test -f 'test_basic.cpp'; then $(CYGPATH_W) 'test_basic.cpp'; else $(CYGPATH_W) '$(srcdir)/test_basic.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_basic.Tpo $(DEPDIR)/test_main-test_basic.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_basic.cpp' object='test_main-test_basic.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_basic.obj `if test -f 'test_basic.cpp'; then $(CYGPATH_W) 'test_basic.cpp'; else $(CYGPATH_W) '$(srcdir)/test_basic.cpp'; fi` + +test_main-test_managed_block.o: test_managed_block.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_managed_block.o -MD -MP -MF $(DEPDIR)/test_main-test_managed_block.Tpo -c -o test_main-test_managed_block.o `test -f 'test_managed_block.cpp' || echo '$(srcdir)/'`test_managed_block.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_managed_block.Tpo $(DEPDIR)/test_main-test_managed_block.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_managed_block.cpp' object='test_main-test_managed_block.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_managed_block.o `test -f 'test_managed_block.cpp' || echo '$(srcdir)/'`test_managed_block.cpp + +test_main-test_managed_block.obj: test_managed_block.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_managed_block.obj -MD -MP -MF $(DEPDIR)/test_main-test_managed_block.Tpo -c -o test_main-test_managed_block.obj `if test -f 'test_managed_block.cpp'; then $(CYGPATH_W) 'test_managed_block.cpp'; else $(CYGPATH_W) '$(srcdir)/test_managed_block.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_managed_block.Tpo $(DEPDIR)/test_main-test_managed_block.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_managed_block.cpp' object='test_main-test_managed_block.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_managed_block.obj `if test -f 'test_managed_block.cpp'; then $(CYGPATH_W) 'test_managed_block.cpp'; else $(CYGPATH_W) '$(srcdir)/test_managed_block.cpp'; fi` + +test_main-test_misc.o: test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_misc.o -MD -MP -MF $(DEPDIR)/test_main-test_misc.Tpo -c -o test_main-test_misc.o `test -f 'test_misc.cpp' || echo '$(srcdir)/'`test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_misc.Tpo $(DEPDIR)/test_main-test_misc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_misc.cpp' object='test_main-test_misc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_misc.o `test -f 'test_misc.cpp' || echo '$(srcdir)/'`test_misc.cpp + +test_main-test_misc.obj: test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_misc.obj -MD -MP -MF $(DEPDIR)/test_main-test_misc.Tpo -c -o test_main-test_misc.obj `if test -f 'test_misc.cpp'; then $(CYGPATH_W) 'test_misc.cpp'; else $(CYGPATH_W) '$(srcdir)/test_misc.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_misc.Tpo $(DEPDIR)/test_main-test_misc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_misc.cpp' object='test_main-test_misc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_misc.obj `if test -f 'test_misc.cpp'; then $(CYGPATH_W) 'test_misc.cpp'; else $(CYGPATH_W) '$(srcdir)/test_misc.cpp'; fi` + +test_main-test_swap.o: test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap.o -MD -MP -MF $(DEPDIR)/test_main-test_swap.Tpo -c -o test_main-test_swap.o `test -f 'test_swap.cpp' || echo '$(srcdir)/'`test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap.Tpo $(DEPDIR)/test_main-test_swap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap.cpp' object='test_main-test_swap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap.o `test -f 'test_swap.cpp' || echo '$(srcdir)/'`test_swap.cpp + +test_main-test_swap.obj: test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap.obj -MD -MP -MF $(DEPDIR)/test_main-test_swap.Tpo -c -o test_main-test_swap.obj `if test -f 'test_swap.cpp'; then $(CYGPATH_W) 'test_swap.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap.Tpo $(DEPDIR)/test_main-test_swap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap.cpp' object='test_main-test_swap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap.obj `if test -f 'test_swap.cpp'; then $(CYGPATH_W) 'test_swap.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap.cpp'; fi` + +test_main-test_transfer.o: test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_transfer.o -MD -MP -MF $(DEPDIR)/test_main-test_transfer.Tpo -c -o test_main-test_transfer.o `test -f 'test_transfer.cpp' || echo '$(srcdir)/'`test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_transfer.Tpo $(DEPDIR)/test_main-test_transfer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_transfer.cpp' object='test_main-test_transfer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_transfer.o `test -f 'test_transfer.cpp' || echo '$(srcdir)/'`test_transfer.cpp + +test_main-test_transfer.obj: test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_transfer.obj -MD -MP -MF $(DEPDIR)/test_main-test_transfer.Tpo -c -o test_main-test_transfer.obj `if test -f 'test_transfer.cpp'; then $(CYGPATH_W) 'test_transfer.cpp'; else $(CYGPATH_W) '$(srcdir)/test_transfer.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_transfer.Tpo $(DEPDIR)/test_main-test_transfer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_transfer.cpp' object='test_main-test_transfer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_transfer.obj `if test -f 'test_transfer.cpp'; then $(CYGPATH_W) 'test_transfer.cpp'; else $(CYGPATH_W) '$(srcdir)/test_transfer.cpp'; fi` + +$(top_builddir)/test/test_main-test_global.o: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.o -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp + +$(top_builddir)/test/test_main-test_global.obj: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.obj -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_basic.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_managed_block.Po + -rm -f ./$(DEPDIR)/test_main-test_misc.Po + -rm -f ./$(DEPDIR)/test_main-test_swap.Po + -rm -f ./$(DEPDIR)/test_main-test_transfer.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_basic.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_managed_block.Po + -rm -f ./$(DEPDIR)/test_main-test_misc.Po + -rm -f ./$(DEPDIR)/test_main-test_swap.Po + -rm -f ./$(DEPDIR)/test_main-test_transfer.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/custom/soa/test_basic.cpp b/test/multi_type_vector/custom/soa/test_basic.cpp new file mode 100644 index 0000000..8857d98 --- /dev/null +++ b/test/multi_type_vector/custom/soa/test_basic.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "basic.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/soa/test_main.cpp b/test/multi_type_vector/custom/soa/test_main.cpp new file mode 100644 index 0000000..4c92050 --- /dev/null +++ b/test/multi_type_vector/custom/soa/test_main.cpp @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +int main() +{ + try + { + mtv_test_misc_types(); + mtv_test_misc_block_identifier(); + mtv_test_misc_custom_block_func1(); + mtv_test_misc_custom_block_func3(); + mtv_test_misc_release(); + mtv_test_misc_construction_with_array(); + mtv_test_basic(); + mtv_test_basic_equality(); + mtv_test_managed_block(); + mtv_test_transfer(); + mtv_test_swap(); + mtv_test_swap_2(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/soa/test_main.hpp b/test/multi_type_vector/custom/soa/test_main.hpp new file mode 100644 index 0000000..2005f2f --- /dev/null +++ b/test/multi_type_vector/custom/soa/test_main.hpp @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#include "common_types.hpp" + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/soa/main.hpp> + +template<typename T> +using mtv_template_type = mdds::mtv::soa::multi_type_vector<T>; + +using mtv_type = mtv_template_type<user_muser_trait>; +using mtv_fruit_type = mtv_template_type<fruit_trait>; +using mtv3_type = mtv_template_type<muser_fruit_date_trait>; + +void mtv_test_misc_types(); +void mtv_test_misc_block_identifier(); +void mtv_test_misc_custom_block_func1(); +void mtv_test_misc_custom_block_func3(); +void mtv_test_misc_release(); +void mtv_test_misc_construction_with_array(); +void mtv_test_basic(); +void mtv_test_basic_equality(); +void mtv_test_managed_block(); +void mtv_test_transfer(); +void mtv_test_swap(); +void mtv_test_swap_2(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/soa/test_managed_block.cpp b/test/multi_type_vector/custom/soa/test_managed_block.cpp new file mode 100644 index 0000000..f734fef --- /dev/null +++ b/test/multi_type_vector/custom/soa/test_managed_block.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "managed_block.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/soa/test_misc.cpp b/test/multi_type_vector/custom/soa/test_misc.cpp new file mode 100644 index 0000000..b8589e2 --- /dev/null +++ b/test/multi_type_vector/custom/soa/test_misc.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "misc.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/soa/test_swap.cpp b/test/multi_type_vector/custom/soa/test_swap.cpp new file mode 100644 index 0000000..21b7d24 --- /dev/null +++ b/test/multi_type_vector/custom/soa/test_swap.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "swap.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/soa/test_transfer.cpp b/test/multi_type_vector/custom/soa/test_transfer.cpp new file mode 100644 index 0000000..cc53440 --- /dev/null +++ b/test/multi_type_vector/custom/soa/test_transfer.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "transfer.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/tc/Makefile.am b/test/multi_type_vector/custom/tc/Makefile.am new file mode 100644 index 0000000..c33c6ac --- /dev/null +++ b/test/multi_type_vector/custom/tc/Makefile.am @@ -0,0 +1,8 @@ + +EXTRA_DIST = \ + basic.inl \ + managed_block.inl \ + misc.inl \ + swap.inl \ + transfer.inl + diff --git a/test/multi_type_vector/custom/tc/Makefile.in b/test/multi_type_vector/custom/tc/Makefile.in new file mode 100644 index 0000000..81a86cf --- /dev/null +++ b/test/multi_type_vector/custom/tc/Makefile.in @@ -0,0 +1,466 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/custom/tc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +EXTRA_DIST = \ + basic.inl \ + managed_block.inl \ + misc.inl \ + swap.inl \ + transfer.inl + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/custom/tc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/custom/tc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am check-valgrind-am \ + check-valgrind-drd-am check-valgrind-drd-local \ + check-valgrind-helgrind-am check-valgrind-helgrind-local \ + check-valgrind-local check-valgrind-memcheck-am \ + check-valgrind-memcheck-local check-valgrind-sgcheck-am \ + check-valgrind-sgcheck-local clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/custom/tc/basic.inl b/test/multi_type_vector/custom/tc/basic.inl new file mode 100644 index 0000000..1602683 --- /dev/null +++ b/test/multi_type_vector/custom/tc/basic.inl @@ -0,0 +1,216 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_basic() +{ + stack_printer __stack_printer__(__FUNCTION__); + + // mdds::multi_type_vector does not manage the life cycle of individual cells; + // the client code needs to manage them when storing pointers. + + user_cell_pool pool; + + { + // set_cell() + mtv_type db(4); + user_cell* p = pool.construct(1.2); + db.set(0, p); + db.set(1, p); + db.set(3, p); + db.set(2, p); + + user_cell* p2 = db.get<user_cell*>(0); + assert(p->value == p2->value); + + p = pool.construct(3.4); + db.set(0, p); + p2 = db.get<user_cell*>(0); + assert(p->value == p2->value); + pool.clear(); + } + + { + // set_cells(), resize(), insert_cells(). + mtv_type db(3); + user_cell* p1 = pool.construct(1.1); + user_cell* p2 = pool.construct(2.2); + user_cell* p3 = pool.construct(3.3); + std::vector<user_cell*> vals; + vals.reserve(3); + vals.push_back(p1); + vals.push_back(p2); + vals.push_back(p3); + db.set(0, vals.begin(), vals.end()); + + user_cell* ptest; + ptest = db.get<user_cell*>(0); + assert(ptest && ptest->value == 1.1); + ptest = db.get<user_cell*>(1); + assert(ptest && ptest->value == 2.2); + ptest = db.get<user_cell*>(2); + assert(ptest && ptest->value == 3.3); + + db.resize(6); + user_cell* p4 = pool.construct(11); + user_cell* p5 = pool.construct(22); + user_cell* p6 = pool.construct(33); + vals.clear(); + vals.push_back(p4); + vals.push_back(p5); + vals.push_back(p6); + db.set(3, vals.begin(), vals.end()); + + ptest = db.get<user_cell*>(0); + assert(ptest && ptest->value == 1.1); + ptest = db.get<user_cell*>(1); + assert(ptest && ptest->value == 2.2); + ptest = db.get<user_cell*>(2); + assert(ptest && ptest->value == 3.3); + ptest = db.get<user_cell*>(3); + assert(ptest && ptest->value == 11); + ptest = db.get<user_cell*>(4); + assert(ptest && ptest->value == 22); + ptest = db.get<user_cell*>(5); + assert(ptest && ptest->value == 33); + + // Shrink the block to erase the bottom 3 cells. + db.resize(3); + assert(db.size() == 3); + ptest = db.get<user_cell*>(2); + assert(ptest && ptest->value == 3.3); + + // Re-insert the values at the front. + db.insert(0, vals.begin(), vals.end()); + assert(db.size() == 6); + + ptest = db.get<user_cell*>(0); + assert(ptest && ptest->value == 11); + ptest = db.get<user_cell*>(1); + assert(ptest && ptest->value == 22); + ptest = db.get<user_cell*>(2); + assert(ptest && ptest->value == 33); + ptest = db.get<user_cell*>(3); + assert(ptest && ptest->value == 1.1); + ptest = db.get<user_cell*>(4); + assert(ptest && ptest->value == 2.2); + ptest = db.get<user_cell*>(5); + assert(ptest && ptest->value == 3.3); + + // set_empty(), is_empty(). + db.set_empty(2, 4); + assert(db.block_size() == 3); + assert(db.get<user_cell*>(1)->value == 22); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + assert(db.get<user_cell*>(5)->value == 3.3); + + // erase() + db.erase(3, 5); + assert(db.size() == 3); + assert(db.get<user_cell*>(1)->value == 22); + assert(db.is_empty(2)); + + // insert_empty(). + db.insert_empty(1, 2); + assert(db.size() == 5); + assert(db.get<user_cell*>(0)->value == 11); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.get<user_cell*>(3)->value == 22); + assert(db.is_empty(4)); + + pool.clear(); + } + + { + // set_cells() to overwrite existing values of type user_cell*. + mtv_type db(2); + user_cell* p0 = pool.construct(1.2); + db.set(1, p0); + db.set(0, p0); + + std::vector<user_cell*> vals; + vals.push_back(pool.construct(2.3)); + vals.push_back(pool.construct(2.4)); + db.set(0, vals.begin(), vals.end()); + pool.clear(); + } + + { + mtv_type db(4); + user_cell* p0 = pool.construct(1.1); + db.set(3, p0); + + std::vector<user_cell*> vals; + vals.push_back(pool.construct(2.3)); + vals.push_back(pool.construct(2.4)); + db.set(1, vals.begin(), vals.end()); + assert(db.is_empty(0)); + assert(db.get<user_cell*>(1)->value == 2.3); + assert(db.get<user_cell*>(2)->value == 2.4); + assert(db.get<user_cell*>(3)->value == 1.1); + + pool.clear(); + } + + { + // Get empty value. + mtv_type db(1); + user_cell* p = db.get<user_cell*>(0); + assert(p == nullptr); + } +} + +void mtv_test_basic_equality() +{ + stack_printer __stack_printer__(__FUNCTION__); + + user_cell_pool pool; + + mtv_type db1(3); + mtv_type db2 = db1; + assert(db2 == db1); + user_cell* p0 = pool.construct(1.1); + db1.set(0, p0); + assert(db1 != db2); + db2.set(0, p0); + assert(db1 == db2); + db1.set(2, std::string("foo")); + db2.set(2, std::string("foo")); + assert(db1 == db2); + + // same value but different memory addresses. + user_cell* p1 = pool.construct(1.2); + user_cell* p2 = pool.construct(1.2); + db1.set(1, p1); + db2.set(1, p2); + assert(db1 != db2); // equality is by the pointer value. +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/tc/managed_block.inl b/test/multi_type_vector/custom/tc/managed_block.inl new file mode 100644 index 0000000..c6cf4a7 --- /dev/null +++ b/test/multi_type_vector/custom/tc/managed_block.inl @@ -0,0 +1,655 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +/** + * This test is to be run with valgrind, to ensure no memory leak occurs. + */ +void mtv_test_managed_block() +{ + stack_printer __stack_printer__(__FUNCTION__); + { + mtv_type db(1); + db.set(0, new muser_cell(1.0)); + const muser_cell* p = db.get<muser_cell*>(0); + assert(p->value == 1.0); + db.set(0, new muser_cell(2.0)); // overwrite. + p = db.get<muser_cell*>(0); + assert(p->value == 2.0); + } + + { + // Overwrite with empty cells. + mtv_type db(3); + + // Empty the upper part. + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.set_empty(0, 0); + + // Empty the lower part. + db.set(0, new muser_cell(4.0)); + db.set_empty(2, 2); + + // Empty the middle part. + db.set(2, new muser_cell(5.0)); + db.set_empty(1, 1); + } + + { + // More overwrite with empty cells. + mtv_type db(3); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, 3.0); + db.set_empty(1, 2); + + db.set(0, std::string("foo")); + db.set(1, new muser_cell(4.0)); + db.set(2, new muser_cell(5.0)); + db.set_empty(0, 1); + + db.set(0, new muser_cell(6.0)); + db.set(1, static_cast<uint64_t>(12)); + db.set_empty(0, 2); + } + + { + // Another case for set_empty(). + mtv_type db(5); + db.set(0, 1.2); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.set(3, new muser_cell(4.0)); + db.set(4, new muser_cell(5.0)); + db.set_empty(2, 4); + + db.set(2, new muser_cell(3.0)); + db.set(3, new muser_cell(4.0)); + db.set(4, new muser_cell(5.0)); + db.set_empty(1, 2); + + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.set_empty(2, 3); + } + + { + // Test for cloning. + mtv_type db(3); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + + // swap + mtv_type db2; + db2.swap(db); + assert(db.empty()); + assert(db2.get<muser_cell*>(0)->value == 1.0); + assert(db2.get<muser_cell*>(1)->value == 2.0); + assert(db2.get<muser_cell*>(2)->value == 3.0); + db.swap(db2); + assert(db2.empty()); + assert(db.get<muser_cell*>(0)->value == 1.0); + assert(db.get<muser_cell*>(1)->value == 2.0); + assert(db.get<muser_cell*>(2)->value == 3.0); + + // copy constructor + mtv_type db_copied(db); + assert(db_copied.size() == 3); + assert(db_copied.get<muser_cell*>(0)->value == 1.0); + assert(db_copied.get<muser_cell*>(1)->value == 2.0); + assert(db_copied.get<muser_cell*>(2)->value == 3.0); + + // Assignment. + mtv_type db_assigned = db; + assert(db_assigned.size() == 3); + assert(db_assigned.get<muser_cell*>(0)->value == 1.0); + assert(db_assigned.get<muser_cell*>(1)->value == 2.0); + assert(db_assigned.get<muser_cell*>(2)->value == 3.0); + } + + { + // Resize and clear + mtv_type db(3); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.resize(1); + assert(db.get<muser_cell*>(0)->value == 1.0); + + db.clear(); + } + + { + // Overwrite with a cell of different type. + mtv_type db(3); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.set(1, 4.5); + } + + { + // Erase (single block) + mtv_type db(3); + + // Erase the whole thing. + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.erase(0, 2); + assert(db.empty()); + + // Erase top. + db.resize(3); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.erase(0, 1); + assert(db.size() == 1); + + // Erase bottom. + db.resize(3); + db.set(1, new muser_cell(4.0)); + db.set(2, new muser_cell(5.0)); + db.erase(1, 2); + assert(db.size() == 1); + + // Erase middle. + db.resize(3); + db.set(1, new muser_cell(4.0)); + db.set(2, new muser_cell(5.0)); + db.erase(1, 1); + assert(db.size() == 2); + } + + { + // Erase (single block with preceding block) + mtv_type db(4); + + // Erase the whole thing. + db.set(0, 1.1); + db.set(1, new muser_cell(1.0)); + db.set(2, new muser_cell(2.0)); + db.set(3, new muser_cell(3.0)); + db.erase(1, 3); + assert(db.size() == 1); + + // Erase top. + db.resize(4); + db.set(1, new muser_cell(1.0)); + db.set(2, new muser_cell(2.0)); + db.set(3, new muser_cell(3.0)); + db.erase(1, 2); + assert(db.size() == 2); + + // Erase bottom. + db.resize(4); + db.set(2, new muser_cell(4.0)); + db.set(3, new muser_cell(5.0)); + db.erase(2, 3); + assert(db.size() == 2); + + // Erase middle. + db.resize(4); + db.set(2, new muser_cell(4.0)); + db.set(3, new muser_cell(5.0)); + db.erase(2, 2); + assert(db.size() == 3); + } + + { + // Erase (multi-block 1) + mtv_type db(6); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.set(3, 4.1); + db.set(4, 4.2); + db.set(5, 4.3); + db.erase(1, 4); + } + + { + // Erase (multi-block 2) + mtv_type db(6); + db.set(0, 4.1); + db.set(1, 4.2); + db.set(2, 4.3); + db.set(3, new muser_cell(5.0)); + db.set(4, new muser_cell(6.0)); + db.set(5, new muser_cell(7.0)); + db.erase(1, 4); + } + + { + // Erase (multi-block 3) + mtv_type db(6); + db.set(0, 1.0); + db.set(1, 2.0); + db.set(2, new muser_cell(3.0)); + db.set(3, new muser_cell(4.0)); + db.set(4, 5.0); + db.set(5, 6.0); + db.erase(1, 4); + } + + { + // Insert into the middle of block. This one shouldn't overwrite any + // cells, but just to be safe... + mtv_type db(2); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.insert_empty(1, 2); + assert(db.size() == 4); + assert(db.get<muser_cell*>(0)->value == 1.0); + assert(db.get<muser_cell*>(3)->value == 2.0); + } + + { + // set_cells (simple overwrite) + mtv_type db(2); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + + std::vector<muser_cell*> vals; + vals.push_back(new muser_cell(3.0)); + vals.push_back(new muser_cell(4.0)); + db.set(0, vals.begin(), vals.end()); + assert(db.get<muser_cell*>(0)->value == 3.0); + assert(db.get<muser_cell*>(1)->value == 4.0); + } + + { + // set_cells (overwrite upper) + mtv_type db(2); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + double vals[] = {3.0}; + const double* p = &vals[0]; + db.set(0, p, p + 1); + assert(db.get<double>(0) == 3.0); + assert(db.get<muser_cell*>(1)->value == 2.0); + } + + { + // set_cells (overwrite lower) + mtv_type db(2); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + double vals[] = {3.0}; + const double* p = &vals[0]; + db.set(1, p, p + 1); + assert(db.get<muser_cell*>(0)->value == 1.0); + assert(db.get<double>(1) == 3.0); + } + + { + // set_cells (overwrite middle) + mtv_type db(4); + db.set(0, 1.1); + db.set(1, new muser_cell(1.0)); + db.set(2, new muser_cell(2.0)); + db.set(3, new muser_cell(3.0)); + double vals[] = {4.0}; + const double* p = &vals[0]; + db.set(2, p, p + 1); + assert(db.get<muser_cell*>(1)->value == 1.0); + assert(db.get<double>(2) == 4.0); + assert(db.get<muser_cell*>(3)->value == 3.0); + } + { + // insert_empty() to split the block into two. + mtv_type db(3); + db.set(0, 1.1); + db.set(1, new muser_cell(1.0)); + db.set(2, new muser_cell(2.0)); + db.insert_empty(2, 2); + assert(db.size() == 5); + assert(db.get<muser_cell*>(1)->value == 1.0); + assert(db.get<muser_cell*>(4)->value == 2.0); + } + + { + // erase() to merge two blocks. + mtv_type db(4); + db.set(0, 1.1); + db.set(1, new muser_cell(1.0)); + db.set(2, static_cast<uint64_t>(2)); + db.set(3, new muser_cell(3.0)); + assert(db.block_size() == 4); + assert(db.size() == 4); + + db.erase(2, 2); + assert(db.block_size() == 2); + assert(db.size() == 3); + assert(db.get<double>(0) == 1.1); + assert(db.get<muser_cell*>(1)->value == 1.0); + assert(db.get<muser_cell*>(2)->value == 3.0); + } + + { + // set_cells() across multiple blocks. + mtv_type db(5); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, 1.2); + db.set(3, new muser_cell(3.0)); + db.set(4, new muser_cell(4.0)); + uint64_t vals[] = {5, 6, 7}; + const uint64_t* p = &vals[0]; + db.set(1, p, p + 3); + } + + { + // set_cells() across multiple blocks, part 2. + mtv_type db(6); + db.set(0, static_cast<uint64_t>(12)); + db.set(1, new muser_cell(1.0)); + db.set(2, new muser_cell(2.0)); + db.set(3, 1.2); + db.set(4, new muser_cell(3.0)); + db.set(5, new muser_cell(4.0)); + assert(db.block_size() == 4); + + std::vector<muser_cell*> vals; + vals.push_back(new muser_cell(5.0)); + vals.push_back(new muser_cell(6.0)); + vals.push_back(new muser_cell(7.0)); + db.set(2, vals.begin(), vals.end()); + assert(db.block_size() == 2); + } + + { + // set_cell() to merge 3 blocks. + mtv_type db(6); + db.set(0, static_cast<uint64_t>(12)); + db.set(1, new muser_cell(1.0)); + db.set(2, new muser_cell(2.0)); + db.set(3, 1.2); + db.set(4, new muser_cell(3.0)); + db.set(5, new muser_cell(4.0)); + assert(db.block_size() == 4); + assert(db.get<uint64_t>(0) == 12); + assert(db.get<muser_cell*>(1)->value == 1.0); + assert(db.get<muser_cell*>(2)->value == 2.0); + assert(db.get<double>(3) == 1.2); + assert(db.get<muser_cell*>(4)->value == 3.0); + assert(db.get<muser_cell*>(5)->value == 4.0); + + db.set(3, new muser_cell(5.0)); // merge blocks. + assert(db.block_size() == 2); + assert(db.get<uint64_t>(0) == 12); + assert(db.get<muser_cell*>(1)->value == 1.0); + assert(db.get<muser_cell*>(2)->value == 2.0); + assert(db.get<muser_cell*>(3)->value == 5.0); + assert(db.get<muser_cell*>(4)->value == 3.0); + assert(db.get<muser_cell*>(5)->value == 4.0); + } + + { + // set_cell() to merge 2 blocks. + mtv_type db(3); + db.set(0, static_cast<uint64_t>(23)); + db.set(1, new muser_cell(2.1)); + db.set(2, new muser_cell(3.1)); + + db.set(0, new muser_cell(4.2)); // merge + assert(db.block_size() == 1); + assert(db.get<muser_cell*>(0)->value == 4.2); + assert(db.get<muser_cell*>(1)->value == 2.1); + assert(db.get<muser_cell*>(2)->value == 3.1); + } + + { + // insert_cells() to split block into two. + mtv_type db(2); + db.set(0, new muser_cell(2.1)); + db.set(1, new muser_cell(2.2)); + double vals[] = {3.1, 3.2}; + const double* p = &vals[0]; + db.insert(1, p, p + 2); + } + + { + // set_cells() - merge new data block with existing block below. + mtv_type db(6); + db.set(0, std::string("foo")); + db.set(1, std::string("baa")); + db.set(2, 1.1); + db.set(3, 1.2); + db.set(4, new muser_cell(2.2)); + db.set(5, new muser_cell(2.3)); + assert(db.block_size() == 3); + + std::vector<muser_cell*> vals; + vals.push_back(new muser_cell(2.4)); + vals.push_back(new muser_cell(2.5)); + vals.push_back(new muser_cell(2.6)); + db.set(1, vals.begin(), vals.end()); + assert(db.block_size() == 2); + + assert(db.get<std::string>(0) == "foo"); + assert(db.get<muser_cell*>(1)->value == 2.4); + assert(db.get<muser_cell*>(2)->value == 2.5); + assert(db.get<muser_cell*>(3)->value == 2.6); + assert(db.get<muser_cell*>(4)->value == 2.2); + assert(db.get<muser_cell*>(5)->value == 2.3); + } + + { + // set_cells() - merge new data block with existing block below, but + // it overwrites the upper cell. + mtv_type db(6); + db.set(0, std::string("foo")); + db.set(1, std::string("baa")); + db.set(2, 1.1); + db.set(3, new muser_cell(2.1)); + db.set(4, new muser_cell(2.2)); + db.set(5, new muser_cell(2.3)); + std::vector<muser_cell*> vals; + vals.push_back(new muser_cell(2.4)); + vals.push_back(new muser_cell(2.5)); + vals.push_back(new muser_cell(2.6)); + db.set(1, vals.begin(), vals.end()); + assert(db.block_size() == 2); + + assert(db.get<std::string>(0) == "foo"); + assert(db.get<muser_cell*>(1)->value == 2.4); + assert(db.get<muser_cell*>(2)->value == 2.5); + assert(db.get<muser_cell*>(3)->value == 2.6); + assert(db.get<muser_cell*>(4)->value == 2.2); + assert(db.get<muser_cell*>(5)->value == 2.3); + } + + { + mtv_type db(3); + db.set(0, new muser_cell(1.0)); + db.set(2, new muser_cell(1.0)); + db.set(1, new muser_cell(1.0)); + assert(db.block_size() == 1); + } + + { + mtv_type db(10); + for (size_t i = 0; i < 10; ++i) + db.set(i, new muser_cell(1.1)); + + std::vector<double> doubles(3, 2.2); + db.set(3, doubles.begin(), doubles.end()); + assert(db.block_size() == 3); + + std::vector<muser_cell*> cells; + cells.push_back(new muser_cell(2.1)); + cells.push_back(new muser_cell(2.2)); + cells.push_back(new muser_cell(2.3)); + db.set(3, cells.begin(), cells.end()); + assert(db.block_size() == 1); + assert(db.get<muser_cell*>(0)->value == 1.1); + assert(db.get<muser_cell*>(1)->value == 1.1); + assert(db.get<muser_cell*>(2)->value == 1.1); + assert(db.get<muser_cell*>(3)->value == 2.1); + assert(db.get<muser_cell*>(4)->value == 2.2); + assert(db.get<muser_cell*>(5)->value == 2.3); + assert(db.get<muser_cell*>(6)->value == 1.1); + assert(db.get<muser_cell*>(7)->value == 1.1); + assert(db.get<muser_cell*>(8)->value == 1.1); + assert(db.get<muser_cell*>(9)->value == 1.1); + } + + { + mtv_type db(3); + db.set(0, new muser_cell(1.0)); + db.set(1, new muser_cell(2.0)); + db.set(2, new muser_cell(3.0)); + db.set_empty(1, 1); + assert(db.block_size() == 3); + assert(db.get<muser_cell*>(0)->value == 1.0); + assert(db.is_empty(1)); + assert(db.get<muser_cell*>(2)->value == 3.0); + } + + { + mtv_type db(3); + db.set(1, new muser_cell(3.3)); + assert(db.block_size() == 3); + db.set_empty(1, 1); + assert(db.block_size() == 1); + } + + { + // Release an element. + mtv_type db(1); + muser_cell* p1 = new muser_cell(4.5); + db.set(0, p1); + muser_cell* p2 = db.release<muser_cell*>(0); + assert(p1 == p2); + assert(p2->value == 4.5); + assert(db.is_empty(0)); + delete p2; + + db = mtv_type(2); + db.set(0, new muser_cell(23.3)); + assert(db.block_size() == 2); + p2 = db.release<muser_cell*>(0); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.block_size() == 1); + delete p2; + + db = mtv_type(2); + db.set(0, new muser_cell(1.2)); + db.set(1, new muser_cell(1.3)); + + p2 = db.release<muser_cell*>(0); + assert(db.is_empty(0)); + assert(!db.is_empty(1)); + assert(p2->value == 1.2); + delete p2; + + db.set(0, new muser_cell(1.4)); + p2 = db.release<muser_cell*>(1); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(p2->value == 1.3); + delete p2; + + db = mtv_type(3); + db.set(0, new muser_cell(2.1)); + db.set(1, new muser_cell(2.2)); + db.set(2, new muser_cell(2.3)); + + p2 = db.release<muser_cell*>(1); + assert(p2->value == 2.2); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(!db.is_empty(2)); + + delete p2; + + db = mtv_type(3); + db.set(0, new muser_cell(2.1)); + db.set(1, new muser_cell(2.2)); + db.set(2, new muser_cell(2.3)); + db.set_empty(0, 2); // Make sure this doesn't release anything. + + // Release with position hint. + db = mtv_type(4); + db.set(0, new muser_cell(4.5)); + db.set(1, new muser_cell(4.6)); + db.set(3, new muser_cell(5.1)); + + mtv_type::iterator pos = db.release(0, p1); + assert(pos == db.begin()); + pos = db.release(pos, 3, p2); + ++pos; + assert(pos == db.end()); + assert(p1->value == 4.5); + assert(p2->value == 5.1); + assert(db.block_size() == 3); + assert(db.is_empty(0)); + assert(db.get<muser_cell*>(1)->value == 4.6); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + delete p1; + delete p2; + } + + { + mtv_type db(5); + + db.set(1, new muser_cell(1.1)); + db.set(2, new muser_cell(1.2)); + db.set(3, new muser_cell(1.3)); + + db.set(1, 2.1); // Don't leak the overwritten muser_cell instance. + db.set(2, 2.2); // ditto + } + + { + mtv_type db(4); + db.set(0, new muser_cell(1.1)); + db.set(1, new muser_cell(1.2)); + db.set(2, new muser_cell(1.3)); + + db.set(2, 2.1); // Don't leak the overwritten muser_cell instance. + db.set(1, 2.0); // ditto + } + + { + mtv_type db(8); + db.set(3, new muser_cell(1.1)); + db.set(4, new muser_cell(1.2)); + db.set(5, 1.3); + + db.set(4, 2.2); // Overwrite muser_cell and don't leak. + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/tc/misc.inl b/test/multi_type_vector/custom/tc/misc.inl new file mode 100644 index 0000000..7b540ff --- /dev/null +++ b/test/multi_type_vector/custom/tc/misc.inl @@ -0,0 +1,200 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_misc_types() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mdds::mtv::element_t ct; + + // Basic types + ct = mtv_type::get_element_type(double(12.3)); + assert(ct == mdds::mtv::element_type_double); + ct = mtv_type::get_element_type(std::string()); + assert(ct == mdds::mtv::element_type_string); + ct = mtv_type::get_element_type(static_cast<uint64_t>(12)); + assert(ct == mdds::mtv::element_type_uint64); + ct = mtv_type::get_element_type(true); + assert(ct == mdds::mtv::element_type_boolean); + ct = mtv_type::get_element_type(false); + assert(ct == mdds::mtv::element_type_boolean); + + // Custom cell type + user_cell* p = nullptr; + ct = mtv_type::get_element_type(p); + assert(ct == element_type_user_block && ct >= mdds::mtv::element_type_user_start); + ct = mtv_type::get_element_type(static_cast<muser_cell*>(nullptr)); + assert(ct == element_type_muser_block && ct >= mdds::mtv::element_type_user_start); + ct = mtv_fruit_type::get_element_type(unknown_fruit); + assert(ct == element_type_fruit_block && ct >= mdds::mtv::element_type_user_start); +} + +void mtv_test_misc_block_identifier() +{ + stack_printer __stack_printer__(__FUNCTION__); + assert(user_cell_block::block_type == element_type_user_block); + assert(muser_cell_block::block_type == element_type_muser_block); + assert(fruit_block::block_type == element_type_fruit_block); + assert(date_block::block_type == element_type_date_block); +} + +void mtv_test_misc_custom_block_func1() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_fruit_type db(10); + db.set(0, apple); + db.set(1, orange); + db.set(2, mango); + db.set(3, peach); + assert(db.block_size() == 2); + assert(db.get_type(0) == element_type_fruit_block); + assert(db.get<my_fruit_type>(0) == apple); + assert(db.get<my_fruit_type>(1) == orange); + assert(db.get<my_fruit_type>(2) == mango); + assert(db.get<my_fruit_type>(3) == peach); + db.set<int>(1, 234); + assert(db.block_size() == 4); + db.set(1, apple); + assert(db.block_size() == 2); +} + +void mtv_test_misc_custom_block_func3() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv3_type db(10); + + // Insert custom elements. + db.set(0, new muser_cell(12.3)); + db.set(1, apple); + db.set(2, date(1989, 12, 13)); + db.set(3, date(2011, 8, 7)); + assert(db.get_type(0) == element_type_muser_block); + assert(db.get_type(1) == element_type_fruit_block); + assert(db.get_type(2) == element_type_date_block); + assert(db.get_type(3) == element_type_date_block); + assert(db.get<muser_cell*>(0)->value == 12.3); + assert(db.get<my_fruit_type>(1) == apple); + assert(db.get<date>(2).year == 1989); + assert(db.get<date>(2).month == 12); + assert(db.get<date>(2).day == 13); + assert(db.get<date>(3).year == 2011); + assert(db.get<date>(3).month == 8); + assert(db.get<date>(3).day == 7); + assert(db.block_size() == 4); + + // We should still support the primitive types. + db.set(8, 34.56); + assert(db.get<double>(8) == 34.56); +} + +void mtv_test_misc_release() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(3); + muser_cell c1(1.2), c2(1.3); // allocated on the stack. + db.set(0, &c1); + db.set(2, &c2); + db.release(); // Prevent invalid free when db goes out of scope. + + // Variant with no argument should make the container empty after the call. + assert(db.empty()); + + db.push_back(new muser_cell(10.0)); + db.push_back(&c1); + db.push_back(&c2); + db.push_back(new muser_cell(10.1)); + + assert(db.size() == 4); + assert(db.block_size() == 1); + + // Release those allocated on the stack to avoid double deletion. + mtv_type::iterator it = db.release_range(1, 2); + + // Check the integrity of the returned iterator. + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 2); + mtv_type::iterator check = it; + --check; + assert(check == db.begin()); + check = it; + ++check; + ++check; + assert(check == db.end()); + + db.push_back(new muser_cell(10.2)); + assert(db.size() == 5); + + muser_cell* p1 = db.get<muser_cell*>(3); + muser_cell* p2 = db.get<muser_cell*>(4); + assert(p1->value == 10.1); + assert(p2->value == 10.2); + + // Pass iterator as a position hint. + it = db.release_range(it, 3, 4); + assert(db.block_size() == 2); + + // Check the returned iterator. + check = it; + --check; + assert(check == db.begin()); + assert(check->type == element_type_muser_block); + assert(check->size == 1); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 4); + ++it; + assert(it == db.end()); + + // It should be safe to delete these instances now that they've been released. + delete p1; + delete p2; +} + +void mtv_test_misc_construction_with_array() +{ + stack_printer __stack_printer__(__FUNCTION__); + { + std::vector<muser_cell*> vals; + vals.push_back(new muser_cell(2.1)); + vals.push_back(new muser_cell(2.2)); + vals.push_back(new muser_cell(2.3)); + mtv_type db(vals.size(), vals.begin(), vals.end()); + + db.set(1, 10.2); // overwrite. + assert(db.size() == 3); + assert(db.block_size() == 3); + assert(db.get<muser_cell*>(0)->value == 2.1); + assert(db.get<double>(1) == 10.2); + assert(db.get<muser_cell*>(2)->value == 2.3); + + // Now those heap objects are owned by the container. Clearing the + // array shouldn't leak. + vals.clear(); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/tc/swap.inl b/test/multi_type_vector/custom/tc/swap.inl new file mode 100644 index 0000000..1337915 --- /dev/null +++ b/test/multi_type_vector/custom/tc/swap.inl @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_swap() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv3_type db1(5), db2(2); + db1.set(0, new muser_cell(1.1)); + db1.set(1, new muser_cell(1.2)); + db1.set(2, new muser_cell(1.3)); + db1.set(3, new muser_cell(1.4)); + db1.set(4, new muser_cell(1.5)); + + db2.set(0, std::string("A")); + db2.set(1, std::string("B")); + + db1.swap(2, 3, db2, 0); + + // swap blocks of equal size, one managed, and one default. + + db1.clear(); + db1.resize(10); + db2.clear(); + db2.resize(10); + + db1.set(3, 2.1); + db1.set(4, 2.2); + db1.set(5, 2.3); + + db2.set(3, new muser_cell(3.1)); + db2.set(4, new muser_cell(3.2)); + db2.set(5, new muser_cell(3.3)); + + db2.swap(3, 5, db1, 3); + + assert(db1.size() == 10); + assert(db1.block_size() == 3); + assert(db2.size() == 10); + assert(db2.block_size() == 3); + + assert(db1.get<muser_cell*>(3)->value == 3.1); + assert(db1.get<muser_cell*>(4)->value == 3.2); + assert(db1.get<muser_cell*>(5)->value == 3.3); + assert(db2.get<double>(3) == 2.1); + assert(db2.get<double>(4) == 2.2); + assert(db2.get<double>(5) == 2.3); + + db2.swap(3, 5, db1, 3); + + assert(db1.get<double>(3) == 2.1); + assert(db1.get<double>(4) == 2.2); + assert(db1.get<double>(5) == 2.3); + assert(db2.get<muser_cell*>(3)->value == 3.1); + assert(db2.get<muser_cell*>(4)->value == 3.2); + assert(db2.get<muser_cell*>(5)->value == 3.3); + + // Same as above, except that the source segment splits the block into 2. + + db1.clear(); + db1.resize(10); + db2.clear(); + db2.resize(10); + + db1.set(3, 2.1); + db1.set(4, 2.2); + + db2.set(3, new muser_cell(3.1)); + db2.set(4, new muser_cell(3.2)); + db2.set(5, new muser_cell(3.3)); + + db2.swap(3, 4, db1, 3); + + // Another scenario that used to crash on double delete. + + db1.clear(); + db1.resize(10); + db2.clear(); + db2.resize(10); + + db1.set(2, new muser_cell(4.1)); + db1.set(3, 4.2); + db1.set(4, new muser_cell(4.3)); + + db2.set(3, new muser_cell(6.1)); + db2.set(4, 6.2); + db2.set(5, 6.3); + + assert(db1.get<muser_cell*>(2)->value == 4.1); + assert(db1.get<double>(3) == 4.2); + assert(db1.get<muser_cell*>(4)->value == 4.3); + + assert(db2.get<muser_cell*>(3)->value == 6.1); + assert(db2.get<double>(4) == 6.2); + assert(db2.get<double>(5) == 6.3); + + db2.swap(4, 4, db1, 4); + + assert(db1.get<muser_cell*>(2)->value == 4.1); + assert(db1.get<double>(3) == 4.2); + assert(db1.get<double>(4) == 6.2); + + assert(db2.get<muser_cell*>(3)->value == 6.1); + assert(db2.get<muser_cell*>(4)->value == 4.3); + assert(db2.get<double>(5) == 6.3); + + // One more on double deletion... + + db1.clear(); + db1.resize(10); + db2.clear(); + db2.resize(10); + + db1.set(0, 2.1); + db1.set(1, 2.2); + db1.set(2, 2.3); + db1.set(3, new muser_cell(4.5)); + + db2.set(2, new muser_cell(3.1)); + db2.set(3, new muser_cell(3.2)); + db2.set(4, new muser_cell(3.3)); + + db1.swap(2, 2, db2, 3); + + assert(db1.get<double>(0) == 2.1); + assert(db1.get<double>(1) == 2.2); + assert(db1.get<muser_cell*>(2)->value == 3.2); + assert(db1.get<muser_cell*>(3)->value == 4.5); + + assert(db2.get<muser_cell*>(2)->value == 3.1); + assert(db2.get<double>(3) == 2.3); + assert(db2.get<muser_cell*>(4)->value == 3.3); +} + +void mtv_test_swap_2() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv3_type db1(3), db2(3); + + db1.set(0, new muser_cell(1.1)); + db1.set(1, new muser_cell(1.2)); + + db2.set(0, 1.2); + db2.set(1, std::string("foo")); + + // Repeat the same swap twice. + db1.swap(0, 1, db2, 0); + assert(db2.get<muser_cell*>(0)->value == 1.1); + assert(db2.get<muser_cell*>(1)->value == 1.2); + assert(db1.get<double>(0) == 1.2); + assert(db1.get<std::string>(1) == "foo"); + + db1.swap(0, 1, db2, 0); + assert(db1.get<muser_cell*>(0)->value == 1.1); + assert(db1.get<muser_cell*>(1)->value == 1.2); + assert(db2.get<double>(0) == 1.2); + assert(db2.get<std::string>(1) == "foo"); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/custom/tc/transfer.inl b/test/multi_type_vector/custom/tc/transfer.inl new file mode 100644 index 0000000..24d3f79 --- /dev/null +++ b/test/multi_type_vector/custom/tc/transfer.inl @@ -0,0 +1,428 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_transfer() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db1(3), db2(4); // db2 is larger than db1. + db1.set(0, new muser_cell(1.1)); + db1.set(1, new muser_cell(1.2)); + db1.set(2, new muser_cell(1.3)); + assert(db1.block_size() == 1); + + try + { + db1.transfer(0, 1, db1, 0); + assert(!"Exception should have been thrown"); + } + catch (const mdds::invalid_arg_error&) + { + // Good. + } + + // Do the transfer. + db1.transfer(0, 2, db2, 0); + + // Now db1 should be totally empty. + assert(db1.block_size() == 1); + mtv_type::iterator check = db1.begin(); + assert(check != db1.end()); + assert(check->type == mdds::mtv::element_type_empty); + assert(check->size == 3); + + assert(db2.block_size() == 2); + assert(db2.get<muser_cell*>(0)->value == 1.1); + assert(db2.get<muser_cell*>(1)->value == 1.2); + assert(db2.get<muser_cell*>(2)->value == 1.3); + assert(db2.is_empty(3)); + + // Transfer back to db1. This should make db2 to be totally empty again. + db2.transfer(0, 2, db1, 0); + assert(db2.block_size() == 1); + check = db2.begin(); + assert(check != db2.end()); + assert(check->size == 4); + assert(check->type == mdds::mtv::element_type_empty); + + assert(db1.block_size() == 1); + assert(db1.get<muser_cell*>(0)->value == 1.1); + assert(db1.get<muser_cell*>(1)->value == 1.2); + assert(db1.get<muser_cell*>(2)->value == 1.3); + + // Now, transfer only the top 2 elements. + db1.transfer(0, 1, db2, 0); + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.get<muser_cell*>(2)->value == 1.3); + + assert(db2.get<muser_cell*>(0)->value == 1.1); + assert(db2.get<muser_cell*>(1)->value == 1.2); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + + // .. and back. + db2.transfer(0, 1, db1, 0); + assert(db1.block_size() == 1); + assert(db1.get<muser_cell*>(0)->value == 1.1); + assert(db1.get<muser_cell*>(1)->value == 1.2); + assert(db1.get<muser_cell*>(2)->value == 1.3); + + assert(db2.block_size() == 1); + check = db2.begin(); + assert(check != db2.end()); + assert(check->size == 4); + assert(check->type == mdds::mtv::element_type_empty); + + db1 = mtv_type(4); + db2 = mtv_type(4); + db2.set(1, new muser_cell(2.1)); + db2.set(2, new muser_cell(2.2)); + assert(db2.block_size() == 3); + db1.transfer(0, 1, db2, 1); // This causes db2's 3 blocks to merge into one. + assert(db2.block_size() == 1); + check = db2.begin(); + assert(check != db2.end()); + assert(check->size == 4); + assert(check->type == mdds::mtv::element_type_empty); + assert(db1.block_size() == 1); + check = db1.begin(); + assert(check != db1.end()); + assert(check->size == 4); + assert(check->type == mdds::mtv::element_type_empty); + + db2.set(0, new muser_cell(3.1)); + assert(db2.block_size() == 2); + + db1.set(1, new muser_cell(3.2)); + db1.set(2, new muser_cell(3.3)); + db1.set(3, new muser_cell(3.4)); + assert(db1.block_size() == 2); + + db1.transfer(1, 2, db2, 1); + assert(db1.block_size() == 2); + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.get<muser_cell*>(3)->value == 3.4); + assert(db2.block_size() == 2); + assert(db2.get<muser_cell*>(0)->value == 3.1); + assert(db2.get<muser_cell*>(1)->value == 3.2); + assert(db2.get<muser_cell*>(2)->value == 3.3); + assert(db2.is_empty(3)); + + db1 = mtv_type(3); + db2 = mtv_type(3); + db1.set(1, new muser_cell(4.2)); + db2.set(0, new muser_cell(4.1)); + db2.set(2, new muser_cell(4.3)); + + db1.transfer(1, 1, db2, 1); + assert(db1.block_size() == 1); + check = db1.begin(); + assert(check != db1.end()); + assert(check->size == 3); + assert(check->type == mdds::mtv::element_type_empty); + assert(db2.block_size() == 1); + assert(db2.get<muser_cell*>(0)->value == 4.1); + assert(db2.get<muser_cell*>(1)->value == 4.2); + assert(db2.get<muser_cell*>(2)->value == 4.3); + + // Transfer to middle of block. + db1 = mtv_type(3); + db2 = mtv_type(3); + db1.set(0, new muser_cell(5.2)); + assert(db1.block_size() == 2); + db1.transfer(0, 0, db2, 1); + assert(db1.block_size() == 1); + check = db1.begin(); + assert(check != db1.end()); + assert(check->size == 3); + assert(check->type == mdds::mtv::element_type_empty); + assert(db2.block_size() == 3); + assert(db2.is_empty(0)); + assert(db2.get<muser_cell*>(1)->value == 5.2); + assert(db2.is_empty(2)); + + db1 = mtv_type(2); + db2 = mtv_type(3); + db1.set(0, new muser_cell(11.1)); + db1.set(1, new muser_cell(11.2)); + db1.transfer(1, 1, db2, 1); + assert(db1.block_size() == 2); + assert(db1.get<muser_cell*>(0)->value == 11.1); + assert(db1.is_empty(1)); + assert(db2.block_size() == 3); + assert(db2.is_empty(0)); + assert(db2.get<muser_cell*>(1)->value == 11.2); + assert(db2.is_empty(2)); + + // Transfer to bottom of block. + db1 = mtv_type(4); + db2 = mtv_type(5); + db1.set(0, new muser_cell(6.1)); + db1.set(1, new muser_cell(6.2)); + db1.transfer(0, 1, db2, 3); + assert(db1.block_size() == 1); + check = db1.begin(); + assert(check != db1.end()); + assert(check->size == 4); + assert(check->type == mdds::mtv::element_type_empty); + assert(db2.block_size() == 2); + assert(db2.is_empty(0)); + assert(db2.is_empty(1)); + assert(db2.is_empty(2)); + assert(db2.get<muser_cell*>(3)->value == 6.1); + assert(db2.get<muser_cell*>(4)->value == 6.2); + + // Transfer multiple blocks. Very simple use case. + db1 = mtv_type(4); + db2 = mtv_type(3); + db1.set(1, new muser_cell(10.1)); + db1.set(3, new muser_cell(10.2)); + db1.transfer(1, 3, db2, 0); + + // db1 should be completely empty. + assert(db1.block_size() == 1); + check = db1.begin(); + assert(check != db1.end()); + assert(check->size == 4); + assert(check->type == mdds::mtv::element_type_empty); + + assert(db2.block_size() == 3); + assert(db2.get<muser_cell*>(0)->value == 10.1); + assert(db2.is_empty(1)); + assert(db2.get<muser_cell*>(2)->value == 10.2); + + // Multiple-block transfer that involves merging. + db1 = mtv_type(5); + db2 = mtv_type(5); + db1.set(0, new muser_cell(0.1)); + db1.set(1, new muser_cell(0.2)); + db1.set(3, new muser_cell(0.3)); + db1.set(4, new muser_cell(0.4)); + + db2.set(0, new muser_cell(1.1)); + db2.set(4, new muser_cell(1.2)); + + mtv_type::iterator it = db1.transfer(1, 3, db2, 1); + assert(db1.block_size() == 3); + assert(db1.get<muser_cell*>(0)->value == 0.1); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.is_empty(3)); + assert(db1.get<muser_cell*>(4)->value == 0.4); + + assert(db2.block_size() == 3); + assert(db2.get<muser_cell*>(0)->value == 1.1); + assert(db2.get<muser_cell*>(1)->value == 0.2); + assert(db2.is_empty(2)); + assert(db2.get<muser_cell*>(3)->value == 0.3); + assert(db2.get<muser_cell*>(4)->value == 1.2); + + assert(it != db1.end()); + assert(it->size == 3); + assert(it->type == mdds::mtv::element_type_empty); + it = db1.transfer(it, 4, 4, db2, 2); // Transfer single element at 4. + assert(db1.block_size() == 2); + assert(db1.get<muser_cell*>(0)->value == 0.1); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.is_empty(3)); + assert(db1.is_empty(4)); + + assert(db2.block_size() == 1); + assert(db2.get<muser_cell*>(0)->value == 1.1); + assert(db2.get<muser_cell*>(1)->value == 0.2); + assert(db2.get<muser_cell*>(2)->value == 0.4); + assert(db2.get<muser_cell*>(3)->value == 0.3); + assert(db2.get<muser_cell*>(4)->value == 1.2); + + assert(it != db1.end()); + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db1.end()); + + // Multi-block transfer to the top part of destination block. + db1 = mtv_type(5); + db2 = mtv_type(5); + db1.set(0, new muser_cell(-1.1)); + db1.set(1, new muser_cell(-2.1)); + db1.set(2, new muser_cell(-3.1)); + db1.set(3, std::string("foo")); + db1.set(4, new muser_cell(-5.1)); + db2.set(1, true); + db2.set(2, false); + db2.set(3, true); + it = db1.transfer(2, 3, db2, 2); + assert(it != db1.end()); + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_empty); + std::advance(it, 2); + assert(it == db1.end()); + assert(db1.block_size() == 3); + assert(db1.get<muser_cell*>(0)->value == -1.1); + assert(db1.get<muser_cell*>(1)->value == -2.1); + assert(db1.is_empty(2)); + assert(db1.is_empty(3)); + assert(db1.get<muser_cell*>(4)->value == -5.1); + + assert(db2.block_size() == 5); + assert(db2.is_empty(0)); + assert(db2.get<bool>(1) == true); + assert(db2.get<muser_cell*>(2)->value == -3.1); + assert(db2.get<std::string>(3) == "foo"); + assert(db2.is_empty(4)); + + // Multi-block transfer to the bottom part of destination block. + db1 = mtv_type(10); + db2 = mtv_type(10); + db1.set(0, new muser_cell(2.1)); + db1.set(1, new muser_cell(2.2)); + db1.set(2, int8_t('a')); + db1.set(3, int8_t('b')); + db2.set(0, true); + db2.set(1, false); + + it = db1.transfer(0, 2, db2, 7); + assert(it != db1.end()); + assert(it->size == 3); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it != db1.end()); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_int8); + ++it; + assert(it != db1.end()); + assert(it->size == 6); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db1.end()); + assert(db1.block_size() == 3); + assert(db1.get<int8_t>(3) == 'b'); + + assert(db2.block_size() == 4); + assert(db2.get<bool>(0) == true); + assert(db2.get<bool>(1) == false); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + assert(db2.is_empty(4)); + assert(db2.is_empty(5)); + assert(db2.is_empty(6)); + assert(db2.get<muser_cell*>(7)->value == 2.1); + assert(db2.get<muser_cell*>(8)->value == 2.2); + assert(db2.get<int8_t>(9) == 'a'); + + // Multi-block transfer to the middle part of destination block. + db1 = mtv_type(10); + db2 = mtv_type(10); + db2.set(0, true); + db2.set(9, true); + db1.set(3, new muser_cell(2.4)); + db1.set(4, new muser_cell(2.5)); + db1.set(5, std::string("abc")); + db1.set(6, new muser_cell(2.6)); + db1.set(7, new muser_cell(2.7)); + db1.set(8, true); + it = db1.transfer(3, 6, db2, 2); + assert(it != db1.end()); + assert(it->size == 7); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it != db1.end()); + assert(it->size == 1); + assert(it->type == element_type_muser_block); + ++it; + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db1.end()); + + assert(db1.block_size() == 4); + assert(db1.is_empty(6)); + assert(db1.get<muser_cell*>(7)->value == 2.7); + assert(db1.get<bool>(8) == true); + assert(db1.is_empty(9)); + + assert(db2.block_size() == 7); + assert(db2.get<bool>(0) == true); + assert(db2.is_empty(1)); + assert(db2.get<muser_cell*>(2)->value == 2.4); + assert(db2.get<muser_cell*>(3)->value == 2.5); + assert(db2.get<std::string>(4) == "abc"); + assert(db2.get<muser_cell*>(5)->value == 2.6); + assert(db2.is_empty(6)); + assert(db2.is_empty(7)); + assert(db2.is_empty(8)); + assert(db2.get<bool>(9) == true); + + db1 = mtv_type(10); + db2 = mtv_type(10); + db1.set(3, true); + db2.set(3, std::string("test")); + db1.transfer(0, 6, db2, 0); + assert(db1.block_size() == 1); + check = db1.begin(); + assert(check != db1.end()); + assert(check->size == 10); + assert(check->type == mdds::mtv::element_type_empty); + ++check; + assert(check == db1.end()); + assert(db2.block_size() == 3); + assert(db2.is_empty(0)); + assert(db2.is_empty(1)); + assert(db2.is_empty(2)); + assert(db2.get<bool>(3) == true); + assert(db2.is_empty(4)); + assert(db2.is_empty(5)); + assert(db2.is_empty(6)); + assert(db2.is_empty(7)); + assert(db2.is_empty(8)); + assert(db2.is_empty(9)); + + // Make sure that transfer will overwrite cells in managed blocks. + db1 = mtv_type(3); + db2 = mtv_type(3); + db1.set(0, new muser_cell(1.1)); + db1.set(1, new muser_cell(1.2)); + db1.set(2, new muser_cell(1.3)); + + db2.set(1, new muser_cell(2.1)); // This element will be overwritten. + db1.transfer(0, 2, db2, 0); + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db2.get<muser_cell*>(0)->value == 1.1); + assert(db2.get<muser_cell*>(1)->value == 1.2); + assert(db2.get<muser_cell*>(2)->value == 1.3); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/debug-util/Makefile.am b/test/multi_type_vector/debug-util/Makefile.am new file mode 100644 index 0000000..3e54dfd --- /dev/null +++ b/test/multi_type_vector/debug-util/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = soa diff --git a/test/multi_type_vector/debug-util/Makefile.in b/test/multi_type_vector/debug-util/Makefile.in new file mode 100644 index 0000000..47baab7 --- /dev/null +++ b/test/multi_type_vector/debug-util/Makefile.in @@ -0,0 +1,638 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/debug-util +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = soa +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/debug-util/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/debug-util/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/debug-util/soa/Makefile.am b/test/multi_type_vector/debug-util/soa/Makefile.am new file mode 100644 index 0000000..9cf0761 --- /dev/null +++ b/test/multi_type_vector/debug-util/soa/Makefile.am @@ -0,0 +1,13 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include + +check_PROGRAMS = test-trace + +test_trace_SOURCES = \ + test_trace.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test-trace + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/debug-util/soa/Makefile.in b/test/multi_type_vector/debug-util/soa/Makefile.in new file mode 100644 index 0000000..ed494ad --- /dev/null +++ b/test/multi_type_vector/debug-util/soa/Makefile.in @@ -0,0 +1,989 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-trace$(EXEEXT) +TESTS = test-trace$(EXEEXT) +subdir = test/multi_type_vector/debug-util/soa +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_trace_OBJECTS = test_trace.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_trace_OBJECTS = $(am_test_trace_OBJECTS) +test_trace_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_trace.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_trace_SOURCES) +DIST_SOURCES = $(test_trace_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include + +test_trace_SOURCES = \ + test_trace.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/debug-util/soa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/debug-util/soa/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-trace$(EXEEXT): $(test_trace_OBJECTS) $(test_trace_DEPENDENCIES) $(EXTRA_test_trace_DEPENDENCIES) + @rm -f test-trace$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_trace_OBJECTS) $(test_trace_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_trace.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-trace.log: test-trace$(EXEEXT) + @p='test-trace$(EXEEXT)'; \ + b='test-trace'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_trace.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_trace.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/debug-util/soa/test_trace.cpp b/test/multi_type_vector/debug-util/soa/test_trace.cpp new file mode 100644 index 0000000..6f32936 --- /dev/null +++ b/test/multi_type_vector/debug-util/soa/test_trace.cpp @@ -0,0 +1,454 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include <iostream> + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/soa/main.hpp> + +using mdds::mtv::trace_method_t; + +namespace { + +bool starts_with(std::string_view s, std::string_view test) +{ + std::string_view ss = s.substr(0, test.size()); + return ss == test; +} + +struct checked_method_props +{ + const void* instance = nullptr; + std::string function_name; + trace_method_t type = trace_method_t::unspecified; + + bool operator==(const checked_method_props& other) const + { + return instance == other.instance && function_name == other.function_name && type == other.type; + } +}; + +std::ostream& operator<<(std::ostream& os, const checked_method_props& v) +{ + os << "{instance: " << v.instance << ", function_name: " << v.function_name << ", type: " << int(v.type); + return os; +} + +bool compare(const checked_method_props& lhs, const checked_method_props& rhs) +{ + bool res = lhs.instance == rhs.instance && lhs.function_name == rhs.function_name && lhs.type == rhs.type; + if (!res) + { + std::cerr << "The two are not equal!" << std::endl; + std::cerr << "lhs: " << lhs << std::endl; + std::cerr << "rhs: " << rhs << std::endl; + } + return res; +} + +class test_scope +{ + std::vector<checked_method_props> m_expected; + std::vector<checked_method_props>& m_observed; + int m_line_number; + +public: + test_scope(std::vector<checked_method_props>& observed, int line_number) + : m_observed(observed), m_line_number(line_number) + { + std::cout << "--" << std::endl; + } + + ~test_scope() + { + if (!std::equal(m_expected.cbegin(), m_expected.cend(), m_observed.cbegin(), compare)) + { + std::cerr << "test failed (line=" << m_line_number << ")" << std::endl; + assert(false); + } + m_observed.clear(); + } + + auto& expected() + { + return m_expected; + } +}; + +std::vector<checked_method_props> observed; + +struct mtv_custom_trait : public mdds::mtv::standard_element_blocks_traits +{ + static void trace(const mdds::mtv::trace_method_properties_t& props) + { + std::cout << "[" << props.instance << "]: {" << props.function_name << ": " << props.function_args + << "}; type=" << int(props.type) << std::endl; + + // Some compilers put an extra space after the 'operator'. Let's delete that extra space char. + std::string func_name = props.function_name; + if (starts_with(func_name, "operator ")) + { + std::string rest = func_name.substr(9); + func_name = "operator" + rest; + } + observed.push_back({props.instance, func_name, props.type}); + } +}; + +using mtv_type = mdds::mtv::soa::multi_type_vector<mtv_custom_trait>; + +} // anonymous namespace + +int main() +{ + { + // Random assortment of calls (1) + test_scope ts(observed, __LINE__); + { + mtv_type db(10); + auto pos = db.begin(); + pos = db.set<std::string>(pos, 2, "str"); + pos = db.set<int32_t>(pos, 4, 23); + + [[maybe_unused]] std::string s = db.get<std::string>(2); + [[maybe_unused]] bool b = db.is_empty(0); + [[maybe_unused]] auto t = db.get_type(2); + [[maybe_unused]] auto size = db.size(); + + db.clear(); + + ts.expected() = { + {&db, "multi_type_vector", trace_method_t::constructor}, + {&db, "begin", trace_method_t::accessor}, + {&db, "set", trace_method_t::mutator_with_pos_hint}, + {&db, "set", trace_method_t::mutator_with_pos_hint}, + {&db, "get", trace_method_t::accessor}, + {&db, "is_empty", trace_method_t::accessor}, + {&db, "get_type", trace_method_t::accessor}, + {&db, "size", trace_method_t::accessor}, + {&db, "clear", trace_method_t::mutator}, + {&db, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // Random assortment of calls (2) + test_scope ts(observed, __LINE__); + { + mtv_type db(10); + db.set<std::string>(2, "str"); + db.set<int32_t>(4, 23); + + [[maybe_unused]] auto bs = db.block_size(); + [[maybe_unused]] bool b = db.empty(); + + [[maybe_unused]] int32_t v; + db.get(4, v); + + db.clear(); + + [[maybe_unused]] auto it_end = db.end(); + + ts.expected() = { + {&db, "multi_type_vector", trace_method_t::constructor}, + {&db, "set", trace_method_t::mutator}, + {&db, "set", trace_method_t::mutator}, + {&db, "block_size", trace_method_t::accessor}, + {&db, "empty", trace_method_t::accessor}, + {&db, "get", trace_method_t::accessor}, + {&db, "clear", trace_method_t::mutator}, + {&db, "end", trace_method_t::accessor}, + {&db, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // constructors & event handler access + test_scope ts(observed, __LINE__); + { + mtv_type db1; + mtv_type db2{mtv_type::event_func()}; // move + mtv_type::event_func ef; + mtv_type db3(ef); // copy + + [[maybe_unused]] auto& ref_ef = db3.event_handler(); // non-const ref + const mtv_type& cdb3 = db3; + [[maybe_unused]] const auto& cref_ef = cdb3.event_handler(); // const ref + + mtv_type db4(20, true); // constructor with one init value + std::vector<int32_t> values = {1, 2, 3, 4, 5}; + mtv_type db5(5, values.begin(), values.end()); // constructor with a series of values + + mtv_type db6(db5); // copy constructor + mtv_type db7(std::move(db6)); // move constructor + + ts.expected() = { + {&db1, "multi_type_vector", trace_method_t::constructor}, + {&db2, "multi_type_vector", trace_method_t::constructor}, + {&db3, "multi_type_vector", trace_method_t::constructor}, + {&db3, "event_handler", trace_method_t::accessor}, + {&db3, "event_handler", trace_method_t::accessor}, + {&db4, "multi_type_vector", trace_method_t::constructor}, + {&db5, "multi_type_vector", trace_method_t::constructor}, + {&db6, "multi_type_vector", trace_method_t::constructor}, + {&db7, "multi_type_vector", trace_method_t::constructor}, + + {&db7, "~multi_type_vector", trace_method_t::destructor}, + {&db6, "~multi_type_vector", trace_method_t::destructor}, + {&db5, "~multi_type_vector", trace_method_t::destructor}, + {&db4, "~multi_type_vector", trace_method_t::destructor}, + {&db3, "~multi_type_vector", trace_method_t::destructor}, + {&db2, "~multi_type_vector", trace_method_t::destructor}, + {&db1, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // position methods + test_scope ts(observed, __LINE__); + { + mtv_type db(10); + const mtv_type& cdb = db; // const ref + auto pos = db.position(0); + auto pos_hint = db.begin(); + pos = db.position(pos_hint, 2); + + [[maybe_unused]] auto cpos = cdb.position(1); // const method + cpos = cdb.position(pos_hint, 1); + + ts.expected() = { + {&db, "multi_type_vector", trace_method_t::constructor}, + {&db, "position", trace_method_t::accessor}, + {&db, "begin", trace_method_t::accessor}, + {&db, "position", trace_method_t::accessor_with_pos_hint}, + {&db, "position", trace_method_t::accessor}, + {&db, "position", trace_method_t::accessor_with_pos_hint}, + {&db, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // set, push_back, insert, set_empty, erase, and insert_empty methods + test_scope ts(observed, __LINE__); + { + mtv_type db(10); + std::vector<uint8_t> values = {3, 4, 5, 6}; + auto pos_hint = db.set(2, values.begin(), values.end()); + pos_hint = db.set(pos_hint, 4, values.begin(), values.end()); + db.push_back<int16_t>(456); + db.push_back_empty(); + pos_hint = db.insert(0, values.begin(), values.end()); + db.insert(pos_hint, 0, values.begin(), values.end()); + pos_hint = db.set_empty(0, 3); + pos_hint = db.set_empty(pos_hint, 4, 5); + db.erase(2, 3); + pos_hint = db.insert_empty(3, 10); + db.insert_empty(pos_hint, 15, 2); + + ts.expected() = { + {&db, "multi_type_vector", trace_method_t::constructor}, + {&db, "set", trace_method_t::mutator}, + {&db, "set", trace_method_t::mutator_with_pos_hint}, + {&db, "push_back", trace_method_t::mutator}, + {&db, "push_back_empty", trace_method_t::mutator}, + {&db, "insert", trace_method_t::mutator}, + {&db, "insert", trace_method_t::mutator_with_pos_hint}, + {&db, "set_empty", trace_method_t::mutator}, + {&db, "set_empty", trace_method_t::mutator_with_pos_hint}, + {&db, "erase", trace_method_t::mutator}, + {&db, "insert_empty", trace_method_t::mutator}, + {&db, "insert_empty", trace_method_t::mutator_with_pos_hint}, + {&db, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // transfer + test_scope ts(observed, __LINE__); + { + mtv_type src(10, true), dst(10); + auto pos_hint = src.transfer(0, 3, dst, 0); + pos_hint = src.transfer(pos_hint, 6, 8, dst, 6); + + ts.expected() = { + {&src, "multi_type_vector", trace_method_t::constructor}, + {&dst, "multi_type_vector", trace_method_t::constructor}, + // transfer() calls destination's size() and set_empty() internally. + {&src, "transfer", trace_method_t::mutator}, + {&dst, "size", trace_method_t::accessor}, + {&dst, "set_empty", trace_method_t::mutator}, + // same here... + {&src, "transfer", trace_method_t::mutator_with_pos_hint}, + {&dst, "size", trace_method_t::accessor}, + {&dst, "set_empty", trace_method_t::mutator}, + {&dst, "~multi_type_vector", trace_method_t::destructor}, + {&src, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // release, which has 4 variants. + test_scope ts(observed, __LINE__); + { + mtv_type db(10, int32_t(42)); + + int32_t v = db.release<int32_t>(0); // variant 1 + auto pos_hint = db.release(1, v); // variant 2 + pos_hint = db.release(pos_hint, 2, v); // variant 3 + db.release(); // final variant + + ts.expected() = { + {&db, "multi_type_vector", trace_method_t::constructor}, + {&db, "release", trace_method_t::mutator}, + {&db, "release", trace_method_t::mutator}, + {&db, "release", trace_method_t::mutator_with_pos_hint}, + {&db, "release", trace_method_t::mutator}, + {&db, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // release_range (2 variants) + test_scope ts(observed, __LINE__); + { + mtv_type db(10, int32_t(42)); + auto pos_hint = db.release_range(0, 2); + pos_hint = db.release_range(pos_hint, 5, 7); + + ts.expected() = { + {&db, "multi_type_vector", trace_method_t::constructor}, + {&db, "release_range", trace_method_t::mutator}, + {&db, "release_range", trace_method_t::mutator_with_pos_hint}, + {&db, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // iterator accessors. + test_scope ts(observed, __LINE__); + { + mtv_type db(10); + auto it = db.begin(); + it = db.end(); + const mtv_type& cdb = db; + auto cit = cdb.cbegin(); + cit = cdb.cend(); + + cit = cdb.begin(); + cit = cdb.end(); + + auto rit = db.rbegin(); + rit = db.rend(); + + auto crit = cdb.rbegin(); + crit = cdb.rend(); + + crit = cdb.crbegin(); + crit = cdb.crend(); + + ts.expected() = { + {&db, "multi_type_vector", trace_method_t::constructor}, + {&db, "begin", trace_method_t::accessor}, + {&db, "end", trace_method_t::accessor}, + {&db, "cbegin", trace_method_t::accessor}, + {&db, "cend", trace_method_t::accessor}, + {&db, "begin", trace_method_t::accessor}, + {&db, "end", trace_method_t::accessor}, + {&db, "rbegin", trace_method_t::accessor}, + {&db, "rend", trace_method_t::accessor}, + {&db, "rbegin", trace_method_t::accessor}, + {&db, "rend", trace_method_t::accessor}, + {&db, "crbegin", trace_method_t::accessor}, + {&db, "crend", trace_method_t::accessor}, + {&db, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + // resize, swap, shrink_to_fit and (non-)equality operators. + test_scope ts(observed, __LINE__); + { + mtv_type db; + db.resize(10); + + mtv_type db2(10); + db2.swap(db); + + db2.swap(0, 2, db, 0); + db2.shrink_to_fit(); + + [[maybe_unused]] bool b = db == db2; + b = db != db2; + + ts.expected() = { + {&db, "multi_type_vector", trace_method_t::constructor}, + {&db, "resize", trace_method_t::mutator}, + {&db2, "multi_type_vector", trace_method_t::constructor}, + {&db2, "swap", trace_method_t::mutator}, + {&db2, "swap", trace_method_t::mutator}, + {&db2, "shrink_to_fit", trace_method_t::mutator}, + {&db, "operator==", trace_method_t::accessor}, + {&db, "operator!=", trace_method_t::accessor}, + {&db2, "~multi_type_vector", trace_method_t::destructor}, + {&db, "~multi_type_vector", trace_method_t::destructor}, + }; + } + } + + { + std::cout << "--" << std::endl; + + // assignment operators. These methods internally call other public + // methods that cannot be tested, so we only check the first trace call. + mtv_type db, db2; + observed.clear(); + db = db2; // copy + checked_method_props expected{&db, "operator=", trace_method_t::mutator}; + assert(compare(observed.at(0), expected)); + + observed.clear(); + db = std::move(db2); // move + assert(compare(observed.at(0), expected)); + + observed.clear(); + } + + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/Makefile.am b/test/multi_type_vector/default/Makefile.am new file mode 100644 index 0000000..ddfbe44 --- /dev/null +++ b/test/multi_type_vector/default/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = aos soa tc diff --git a/test/multi_type_vector/default/Makefile.in b/test/multi_type_vector/default/Makefile.in new file mode 100644 index 0000000..299ffc0 --- /dev/null +++ b/test/multi_type_vector/default/Makefile.in @@ -0,0 +1,638 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/default +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = aos soa tc +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/default/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/default/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/default/aos/Makefile.am b/test/multi_type_vector/default/aos/Makefile.am new file mode 100644 index 0000000..106f5b7 --- /dev/null +++ b/test/multi_type_vector/default/aos/Makefile.am @@ -0,0 +1,36 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_construction.cpp \ + test_basic.cpp \ + test_empty_cells.cpp \ + test_erase.cpp \ + test_hints.cpp \ + test_insert.cpp \ + test_iterators.cpp \ + test_iterators_insert.cpp \ + test_iterators_set.cpp \ + test_iterators_set_empty.cpp \ + test_misc.cpp \ + test_position.cpp \ + test_set.cpp \ + test_swap_range.cpp \ + test_transfer.cpp \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/default/aos/Makefile.in b/test/multi_type_vector/default/aos/Makefile.in new file mode 100644 index 0000000..59f49b3 --- /dev/null +++ b/test/multi_type_vector/default/aos/Makefile.in @@ -0,0 +1,1327 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/multi_type_vector/default/aos +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main-test_construction.$(OBJEXT) \ + test_main-test_basic.$(OBJEXT) \ + test_main-test_empty_cells.$(OBJEXT) \ + test_main-test_erase.$(OBJEXT) test_main-test_hints.$(OBJEXT) \ + test_main-test_insert.$(OBJEXT) \ + test_main-test_iterators.$(OBJEXT) \ + test_main-test_iterators_insert.$(OBJEXT) \ + test_main-test_iterators_set.$(OBJEXT) \ + test_main-test_iterators_set_empty.$(OBJEXT) \ + test_main-test_misc.$(OBJEXT) \ + test_main-test_position.$(OBJEXT) test_main-test_set.$(OBJEXT) \ + test_main-test_swap_range.$(OBJEXT) \ + test_main-test_transfer.$(OBJEXT) \ + test_main-test_main.$(OBJEXT) \ + $(top_builddir)/test/test_main-test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po \ + ./$(DEPDIR)/test_main-test_basic.Po \ + ./$(DEPDIR)/test_main-test_construction.Po \ + ./$(DEPDIR)/test_main-test_empty_cells.Po \ + ./$(DEPDIR)/test_main-test_erase.Po \ + ./$(DEPDIR)/test_main-test_hints.Po \ + ./$(DEPDIR)/test_main-test_insert.Po \ + ./$(DEPDIR)/test_main-test_iterators.Po \ + ./$(DEPDIR)/test_main-test_iterators_insert.Po \ + ./$(DEPDIR)/test_main-test_iterators_set.Po \ + ./$(DEPDIR)/test_main-test_iterators_set_empty.Po \ + ./$(DEPDIR)/test_main-test_main.Po \ + ./$(DEPDIR)/test_main-test_misc.Po \ + ./$(DEPDIR)/test_main-test_position.Po \ + ./$(DEPDIR)/test_main-test_set.Po \ + ./$(DEPDIR)/test_main-test_swap_range.Po \ + ./$(DEPDIR)/test_main-test_transfer.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_construction.cpp \ + test_basic.cpp \ + test_empty_cells.cpp \ + test_erase.cpp \ + test_hints.cpp \ + test_insert.cpp \ + test_iterators.cpp \ + test_iterators_insert.cpp \ + test_iterators_set.cpp \ + test_iterators_set_empty.cpp \ + test_misc.cpp \ + test_position.cpp \ + test_set.cpp \ + test_swap_range.cpp \ + test_transfer.cpp \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/default/aos/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/default/aos/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_main-test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_basic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_construction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_empty_cells.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_erase.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_hints.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_insert.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_iterators.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_iterators_insert.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_iterators_set.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_iterators_set_empty.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_misc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_position.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_set.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_swap_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_transfer.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_main-test_construction.o: test_construction.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_construction.o -MD -MP -MF $(DEPDIR)/test_main-test_construction.Tpo -c -o test_main-test_construction.o `test -f 'test_construction.cpp' || echo '$(srcdir)/'`test_construction.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_construction.Tpo $(DEPDIR)/test_main-test_construction.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_construction.cpp' object='test_main-test_construction.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_construction.o `test -f 'test_construction.cpp' || echo '$(srcdir)/'`test_construction.cpp + +test_main-test_construction.obj: test_construction.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_construction.obj -MD -MP -MF $(DEPDIR)/test_main-test_construction.Tpo -c -o test_main-test_construction.obj `if test -f 'test_construction.cpp'; then $(CYGPATH_W) 'test_construction.cpp'; else $(CYGPATH_W) '$(srcdir)/test_construction.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_construction.Tpo $(DEPDIR)/test_main-test_construction.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_construction.cpp' object='test_main-test_construction.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_construction.obj `if test -f 'test_construction.cpp'; then $(CYGPATH_W) 'test_construction.cpp'; else $(CYGPATH_W) '$(srcdir)/test_construction.cpp'; fi` + +test_main-test_basic.o: test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_basic.o -MD -MP -MF $(DEPDIR)/test_main-test_basic.Tpo -c -o test_main-test_basic.o `test -f 'test_basic.cpp' || echo '$(srcdir)/'`test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_basic.Tpo $(DEPDIR)/test_main-test_basic.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_basic.cpp' object='test_main-test_basic.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_basic.o `test -f 'test_basic.cpp' || echo '$(srcdir)/'`test_basic.cpp + +test_main-test_basic.obj: test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_basic.obj -MD -MP -MF $(DEPDIR)/test_main-test_basic.Tpo -c -o test_main-test_basic.obj `if test -f 'test_basic.cpp'; then $(CYGPATH_W) 'test_basic.cpp'; else $(CYGPATH_W) '$(srcdir)/test_basic.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_basic.Tpo $(DEPDIR)/test_main-test_basic.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_basic.cpp' object='test_main-test_basic.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_basic.obj `if test -f 'test_basic.cpp'; then $(CYGPATH_W) 'test_basic.cpp'; else $(CYGPATH_W) '$(srcdir)/test_basic.cpp'; fi` + +test_main-test_empty_cells.o: test_empty_cells.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_empty_cells.o -MD -MP -MF $(DEPDIR)/test_main-test_empty_cells.Tpo -c -o test_main-test_empty_cells.o `test -f 'test_empty_cells.cpp' || echo '$(srcdir)/'`test_empty_cells.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_empty_cells.Tpo $(DEPDIR)/test_main-test_empty_cells.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_empty_cells.cpp' object='test_main-test_empty_cells.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_empty_cells.o `test -f 'test_empty_cells.cpp' || echo '$(srcdir)/'`test_empty_cells.cpp + +test_main-test_empty_cells.obj: test_empty_cells.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_empty_cells.obj -MD -MP -MF $(DEPDIR)/test_main-test_empty_cells.Tpo -c -o test_main-test_empty_cells.obj `if test -f 'test_empty_cells.cpp'; then $(CYGPATH_W) 'test_empty_cells.cpp'; else $(CYGPATH_W) '$(srcdir)/test_empty_cells.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_empty_cells.Tpo $(DEPDIR)/test_main-test_empty_cells.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_empty_cells.cpp' object='test_main-test_empty_cells.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_empty_cells.obj `if test -f 'test_empty_cells.cpp'; then $(CYGPATH_W) 'test_empty_cells.cpp'; else $(CYGPATH_W) '$(srcdir)/test_empty_cells.cpp'; fi` + +test_main-test_erase.o: test_erase.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_erase.o -MD -MP -MF $(DEPDIR)/test_main-test_erase.Tpo -c -o test_main-test_erase.o `test -f 'test_erase.cpp' || echo '$(srcdir)/'`test_erase.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_erase.Tpo $(DEPDIR)/test_main-test_erase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_erase.cpp' object='test_main-test_erase.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_erase.o `test -f 'test_erase.cpp' || echo '$(srcdir)/'`test_erase.cpp + +test_main-test_erase.obj: test_erase.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_erase.obj -MD -MP -MF $(DEPDIR)/test_main-test_erase.Tpo -c -o test_main-test_erase.obj `if test -f 'test_erase.cpp'; then $(CYGPATH_W) 'test_erase.cpp'; else $(CYGPATH_W) '$(srcdir)/test_erase.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_erase.Tpo $(DEPDIR)/test_main-test_erase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_erase.cpp' object='test_main-test_erase.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_erase.obj `if test -f 'test_erase.cpp'; then $(CYGPATH_W) 'test_erase.cpp'; else $(CYGPATH_W) '$(srcdir)/test_erase.cpp'; fi` + +test_main-test_hints.o: test_hints.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_hints.o -MD -MP -MF $(DEPDIR)/test_main-test_hints.Tpo -c -o test_main-test_hints.o `test -f 'test_hints.cpp' || echo '$(srcdir)/'`test_hints.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_hints.Tpo $(DEPDIR)/test_main-test_hints.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_hints.cpp' object='test_main-test_hints.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_hints.o `test -f 'test_hints.cpp' || echo '$(srcdir)/'`test_hints.cpp + +test_main-test_hints.obj: test_hints.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_hints.obj -MD -MP -MF $(DEPDIR)/test_main-test_hints.Tpo -c -o test_main-test_hints.obj `if test -f 'test_hints.cpp'; then $(CYGPATH_W) 'test_hints.cpp'; else $(CYGPATH_W) '$(srcdir)/test_hints.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_hints.Tpo $(DEPDIR)/test_main-test_hints.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_hints.cpp' object='test_main-test_hints.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_hints.obj `if test -f 'test_hints.cpp'; then $(CYGPATH_W) 'test_hints.cpp'; else $(CYGPATH_W) '$(srcdir)/test_hints.cpp'; fi` + +test_main-test_insert.o: test_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_insert.o -MD -MP -MF $(DEPDIR)/test_main-test_insert.Tpo -c -o test_main-test_insert.o `test -f 'test_insert.cpp' || echo '$(srcdir)/'`test_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_insert.Tpo $(DEPDIR)/test_main-test_insert.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_insert.cpp' object='test_main-test_insert.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_insert.o `test -f 'test_insert.cpp' || echo '$(srcdir)/'`test_insert.cpp + +test_main-test_insert.obj: test_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_insert.obj -MD -MP -MF $(DEPDIR)/test_main-test_insert.Tpo -c -o test_main-test_insert.obj `if test -f 'test_insert.cpp'; then $(CYGPATH_W) 'test_insert.cpp'; else $(CYGPATH_W) '$(srcdir)/test_insert.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_insert.Tpo $(DEPDIR)/test_main-test_insert.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_insert.cpp' object='test_main-test_insert.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_insert.obj `if test -f 'test_insert.cpp'; then $(CYGPATH_W) 'test_insert.cpp'; else $(CYGPATH_W) '$(srcdir)/test_insert.cpp'; fi` + +test_main-test_iterators.o: test_iterators.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators.o -MD -MP -MF $(DEPDIR)/test_main-test_iterators.Tpo -c -o test_main-test_iterators.o `test -f 'test_iterators.cpp' || echo '$(srcdir)/'`test_iterators.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators.Tpo $(DEPDIR)/test_main-test_iterators.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators.cpp' object='test_main-test_iterators.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators.o `test -f 'test_iterators.cpp' || echo '$(srcdir)/'`test_iterators.cpp + +test_main-test_iterators.obj: test_iterators.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators.obj -MD -MP -MF $(DEPDIR)/test_main-test_iterators.Tpo -c -o test_main-test_iterators.obj `if test -f 'test_iterators.cpp'; then $(CYGPATH_W) 'test_iterators.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators.Tpo $(DEPDIR)/test_main-test_iterators.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators.cpp' object='test_main-test_iterators.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators.obj `if test -f 'test_iterators.cpp'; then $(CYGPATH_W) 'test_iterators.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators.cpp'; fi` + +test_main-test_iterators_insert.o: test_iterators_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_insert.o -MD -MP -MF $(DEPDIR)/test_main-test_iterators_insert.Tpo -c -o test_main-test_iterators_insert.o `test -f 'test_iterators_insert.cpp' || echo '$(srcdir)/'`test_iterators_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_insert.Tpo $(DEPDIR)/test_main-test_iterators_insert.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_insert.cpp' object='test_main-test_iterators_insert.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_insert.o `test -f 'test_iterators_insert.cpp' || echo '$(srcdir)/'`test_iterators_insert.cpp + +test_main-test_iterators_insert.obj: test_iterators_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_insert.obj -MD -MP -MF $(DEPDIR)/test_main-test_iterators_insert.Tpo -c -o test_main-test_iterators_insert.obj `if test -f 'test_iterators_insert.cpp'; then $(CYGPATH_W) 'test_iterators_insert.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_insert.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_insert.Tpo $(DEPDIR)/test_main-test_iterators_insert.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_insert.cpp' object='test_main-test_iterators_insert.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_insert.obj `if test -f 'test_iterators_insert.cpp'; then $(CYGPATH_W) 'test_iterators_insert.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_insert.cpp'; fi` + +test_main-test_iterators_set.o: test_iterators_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_set.o -MD -MP -MF $(DEPDIR)/test_main-test_iterators_set.Tpo -c -o test_main-test_iterators_set.o `test -f 'test_iterators_set.cpp' || echo '$(srcdir)/'`test_iterators_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_set.Tpo $(DEPDIR)/test_main-test_iterators_set.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_set.cpp' object='test_main-test_iterators_set.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_set.o `test -f 'test_iterators_set.cpp' || echo '$(srcdir)/'`test_iterators_set.cpp + +test_main-test_iterators_set.obj: test_iterators_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_set.obj -MD -MP -MF $(DEPDIR)/test_main-test_iterators_set.Tpo -c -o test_main-test_iterators_set.obj `if test -f 'test_iterators_set.cpp'; then $(CYGPATH_W) 'test_iterators_set.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_set.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_set.Tpo $(DEPDIR)/test_main-test_iterators_set.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_set.cpp' object='test_main-test_iterators_set.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_set.obj `if test -f 'test_iterators_set.cpp'; then $(CYGPATH_W) 'test_iterators_set.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_set.cpp'; fi` + +test_main-test_iterators_set_empty.o: test_iterators_set_empty.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_set_empty.o -MD -MP -MF $(DEPDIR)/test_main-test_iterators_set_empty.Tpo -c -o test_main-test_iterators_set_empty.o `test -f 'test_iterators_set_empty.cpp' || echo '$(srcdir)/'`test_iterators_set_empty.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_set_empty.Tpo $(DEPDIR)/test_main-test_iterators_set_empty.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_set_empty.cpp' object='test_main-test_iterators_set_empty.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_set_empty.o `test -f 'test_iterators_set_empty.cpp' || echo '$(srcdir)/'`test_iterators_set_empty.cpp + +test_main-test_iterators_set_empty.obj: test_iterators_set_empty.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_set_empty.obj -MD -MP -MF $(DEPDIR)/test_main-test_iterators_set_empty.Tpo -c -o test_main-test_iterators_set_empty.obj `if test -f 'test_iterators_set_empty.cpp'; then $(CYGPATH_W) 'test_iterators_set_empty.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_set_empty.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_set_empty.Tpo $(DEPDIR)/test_main-test_iterators_set_empty.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_set_empty.cpp' object='test_main-test_iterators_set_empty.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_set_empty.obj `if test -f 'test_iterators_set_empty.cpp'; then $(CYGPATH_W) 'test_iterators_set_empty.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_set_empty.cpp'; fi` + +test_main-test_misc.o: test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_misc.o -MD -MP -MF $(DEPDIR)/test_main-test_misc.Tpo -c -o test_main-test_misc.o `test -f 'test_misc.cpp' || echo '$(srcdir)/'`test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_misc.Tpo $(DEPDIR)/test_main-test_misc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_misc.cpp' object='test_main-test_misc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_misc.o `test -f 'test_misc.cpp' || echo '$(srcdir)/'`test_misc.cpp + +test_main-test_misc.obj: test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_misc.obj -MD -MP -MF $(DEPDIR)/test_main-test_misc.Tpo -c -o test_main-test_misc.obj `if test -f 'test_misc.cpp'; then $(CYGPATH_W) 'test_misc.cpp'; else $(CYGPATH_W) '$(srcdir)/test_misc.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_misc.Tpo $(DEPDIR)/test_main-test_misc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_misc.cpp' object='test_main-test_misc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_misc.obj `if test -f 'test_misc.cpp'; then $(CYGPATH_W) 'test_misc.cpp'; else $(CYGPATH_W) '$(srcdir)/test_misc.cpp'; fi` + +test_main-test_position.o: test_position.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_position.o -MD -MP -MF $(DEPDIR)/test_main-test_position.Tpo -c -o test_main-test_position.o `test -f 'test_position.cpp' || echo '$(srcdir)/'`test_position.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_position.Tpo $(DEPDIR)/test_main-test_position.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_position.cpp' object='test_main-test_position.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_position.o `test -f 'test_position.cpp' || echo '$(srcdir)/'`test_position.cpp + +test_main-test_position.obj: test_position.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_position.obj -MD -MP -MF $(DEPDIR)/test_main-test_position.Tpo -c -o test_main-test_position.obj `if test -f 'test_position.cpp'; then $(CYGPATH_W) 'test_position.cpp'; else $(CYGPATH_W) '$(srcdir)/test_position.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_position.Tpo $(DEPDIR)/test_main-test_position.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_position.cpp' object='test_main-test_position.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_position.obj `if test -f 'test_position.cpp'; then $(CYGPATH_W) 'test_position.cpp'; else $(CYGPATH_W) '$(srcdir)/test_position.cpp'; fi` + +test_main-test_set.o: test_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_set.o -MD -MP -MF $(DEPDIR)/test_main-test_set.Tpo -c -o test_main-test_set.o `test -f 'test_set.cpp' || echo '$(srcdir)/'`test_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_set.Tpo $(DEPDIR)/test_main-test_set.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_set.cpp' object='test_main-test_set.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_set.o `test -f 'test_set.cpp' || echo '$(srcdir)/'`test_set.cpp + +test_main-test_set.obj: test_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_set.obj -MD -MP -MF $(DEPDIR)/test_main-test_set.Tpo -c -o test_main-test_set.obj `if test -f 'test_set.cpp'; then $(CYGPATH_W) 'test_set.cpp'; else $(CYGPATH_W) '$(srcdir)/test_set.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_set.Tpo $(DEPDIR)/test_main-test_set.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_set.cpp' object='test_main-test_set.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_set.obj `if test -f 'test_set.cpp'; then $(CYGPATH_W) 'test_set.cpp'; else $(CYGPATH_W) '$(srcdir)/test_set.cpp'; fi` + +test_main-test_swap_range.o: test_swap_range.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap_range.o -MD -MP -MF $(DEPDIR)/test_main-test_swap_range.Tpo -c -o test_main-test_swap_range.o `test -f 'test_swap_range.cpp' || echo '$(srcdir)/'`test_swap_range.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap_range.Tpo $(DEPDIR)/test_main-test_swap_range.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap_range.cpp' object='test_main-test_swap_range.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap_range.o `test -f 'test_swap_range.cpp' || echo '$(srcdir)/'`test_swap_range.cpp + +test_main-test_swap_range.obj: test_swap_range.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap_range.obj -MD -MP -MF $(DEPDIR)/test_main-test_swap_range.Tpo -c -o test_main-test_swap_range.obj `if test -f 'test_swap_range.cpp'; then $(CYGPATH_W) 'test_swap_range.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap_range.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap_range.Tpo $(DEPDIR)/test_main-test_swap_range.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap_range.cpp' object='test_main-test_swap_range.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap_range.obj `if test -f 'test_swap_range.cpp'; then $(CYGPATH_W) 'test_swap_range.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap_range.cpp'; fi` + +test_main-test_transfer.o: test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_transfer.o -MD -MP -MF $(DEPDIR)/test_main-test_transfer.Tpo -c -o test_main-test_transfer.o `test -f 'test_transfer.cpp' || echo '$(srcdir)/'`test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_transfer.Tpo $(DEPDIR)/test_main-test_transfer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_transfer.cpp' object='test_main-test_transfer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_transfer.o `test -f 'test_transfer.cpp' || echo '$(srcdir)/'`test_transfer.cpp + +test_main-test_transfer.obj: test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_transfer.obj -MD -MP -MF $(DEPDIR)/test_main-test_transfer.Tpo -c -o test_main-test_transfer.obj `if test -f 'test_transfer.cpp'; then $(CYGPATH_W) 'test_transfer.cpp'; else $(CYGPATH_W) '$(srcdir)/test_transfer.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_transfer.Tpo $(DEPDIR)/test_main-test_transfer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_transfer.cpp' object='test_main-test_transfer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_transfer.obj `if test -f 'test_transfer.cpp'; then $(CYGPATH_W) 'test_transfer.cpp'; else $(CYGPATH_W) '$(srcdir)/test_transfer.cpp'; fi` + +test_main-test_main.o: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.o -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp + +test_main-test_main.obj: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.obj -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` + +$(top_builddir)/test/test_main-test_global.o: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.o -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp + +$(top_builddir)/test/test_main-test_global.obj: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.obj -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_basic.Po + -rm -f ./$(DEPDIR)/test_main-test_construction.Po + -rm -f ./$(DEPDIR)/test_main-test_empty_cells.Po + -rm -f ./$(DEPDIR)/test_main-test_erase.Po + -rm -f ./$(DEPDIR)/test_main-test_hints.Po + -rm -f ./$(DEPDIR)/test_main-test_insert.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_insert.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_set.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_set_empty.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_misc.Po + -rm -f ./$(DEPDIR)/test_main-test_position.Po + -rm -f ./$(DEPDIR)/test_main-test_set.Po + -rm -f ./$(DEPDIR)/test_main-test_swap_range.Po + -rm -f ./$(DEPDIR)/test_main-test_transfer.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_basic.Po + -rm -f ./$(DEPDIR)/test_main-test_construction.Po + -rm -f ./$(DEPDIR)/test_main-test_empty_cells.Po + -rm -f ./$(DEPDIR)/test_main-test_erase.Po + -rm -f ./$(DEPDIR)/test_main-test_hints.Po + -rm -f ./$(DEPDIR)/test_main-test_insert.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_insert.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_set.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_set_empty.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_misc.Po + -rm -f ./$(DEPDIR)/test_main-test_position.Po + -rm -f ./$(DEPDIR)/test_main-test_set.Po + -rm -f ./$(DEPDIR)/test_main-test_swap_range.Po + -rm -f ./$(DEPDIR)/test_main-test_transfer.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/default/aos/test_basic.cpp b/test/multi_type_vector/default/aos/test_basic.cpp new file mode 100644 index 0000000..8857d98 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_basic.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "basic.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_construction.cpp b/test/multi_type_vector/default/aos/test_construction.cpp new file mode 100644 index 0000000..f36f423 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_construction.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "construction.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_empty_cells.cpp b/test/multi_type_vector/default/aos/test_empty_cells.cpp new file mode 100644 index 0000000..1750687 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_empty_cells.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "empty_cells.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_erase.cpp b/test/multi_type_vector/default/aos/test_erase.cpp new file mode 100644 index 0000000..d1734c3 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_erase.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "erase.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_hints.cpp b/test/multi_type_vector/default/aos/test_hints.cpp new file mode 100644 index 0000000..daa4a0f --- /dev/null +++ b/test/multi_type_vector/default/aos/test_hints.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "hints.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_insert.cpp b/test/multi_type_vector/default/aos/test_insert.cpp new file mode 100644 index 0000000..22c3d6f --- /dev/null +++ b/test/multi_type_vector/default/aos/test_insert.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "insert.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_iterators.cpp b/test/multi_type_vector/default/aos/test_iterators.cpp new file mode 100644 index 0000000..3db4bd1 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_iterators.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "iterators.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_iterators_insert.cpp b/test/multi_type_vector/default/aos/test_iterators_insert.cpp new file mode 100644 index 0000000..414620e --- /dev/null +++ b/test/multi_type_vector/default/aos/test_iterators_insert.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "iterators_insert.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_iterators_set.cpp b/test/multi_type_vector/default/aos/test_iterators_set.cpp new file mode 100644 index 0000000..d03489c --- /dev/null +++ b/test/multi_type_vector/default/aos/test_iterators_set.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "iterators_set.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_iterators_set_empty.cpp b/test/multi_type_vector/default/aos/test_iterators_set_empty.cpp new file mode 100644 index 0000000..c3bd67f --- /dev/null +++ b/test/multi_type_vector/default/aos/test_iterators_set_empty.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "iterators_set_empty.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_main.cpp b/test/multi_type_vector/default/aos/test_main.cpp new file mode 100644 index 0000000..3e7ad27 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_main.cpp @@ -0,0 +1,82 @@ +/************************************************************************* + * + * Copyright (c) 2011-2018 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +int main() +{ + try + { + mtv_test_construction(); + mtv_test_basic(); + mtv_test_basic_numeric(); + mtv_test_empty_cells(); + mtv_test_misc_types(); + mtv_test_misc_swap(); + mtv_test_misc_equality(); + mtv_test_misc_clone(); + mtv_test_misc_resize(); + mtv_test_misc_value_type(); + mtv_test_misc_block_identifier(); + mtv_test_misc_push_back(); + mtv_test_misc_capacity(); + mtv_test_misc_position_type_end_position(); + mtv_test_misc_block_pos_adjustments(); + mtv_test_erase(); + mtv_test_insert_empty(); + mtv_test_set_cells(); + mtv_test_insert_cells(); + mtv_test_iterators(); + mtv_test_iterators_element_block(); + mtv_test_iterators_mutable_element_block(); + mtv_test_iterators_private_data(); + mtv_test_iterators_set(); + mtv_test_iterators_set_2(); + mtv_test_iterators_insert(); + mtv_test_iterators_insert_empty(); + mtv_test_iterators_set_empty(); + mtv_test_hints_set(); + mtv_test_hints_set_cells(); + mtv_test_hints_insert_cells(); + mtv_test_hints_set_empty(); + mtv_test_hints_insert_empty(); + mtv_test_position(); + mtv_test_position_next(); + mtv_test_position_advance(); + mtv_test_swap_range(); + mtv_test_transfer(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} diff --git a/test/multi_type_vector/default/aos/test_main.hpp b/test/multi_type_vector/default/aos/test_main.hpp new file mode 100644 index 0000000..fc4adb1 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_main.hpp @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/aos/main.hpp> + +#include <cassert> +#include <sstream> +#include <vector> +#include <deque> + +using mtv_type = mdds::mtv::aos::multi_type_vector<mdds::mtv::standard_element_blocks_traits>; + +template<typename _ValT> +bool test_cell_insertion(mtv_type& col_db, std::size_t row, _ValT val) +{ + _ValT test; + col_db.set(row, val); + col_db.get(row, test); + + if (val == test) + return true; + + std::cout << "row " << row << ": value stored = " << val << "; value retrieved = " << test << std::endl; + return false; +} + +void mtv_test_construction(); +void mtv_test_basic(); +void mtv_test_basic_numeric(); +void mtv_test_empty_cells(); +void mtv_test_misc_types(); +void mtv_test_misc_swap(); +void mtv_test_misc_equality(); +void mtv_test_misc_clone(); +void mtv_test_misc_resize(); +void mtv_test_misc_value_type(); +void mtv_test_misc_block_identifier(); +void mtv_test_misc_push_back(); +void mtv_test_misc_capacity(); +void mtv_test_misc_position_type_end_position(); +void mtv_test_misc_block_pos_adjustments(); +void mtv_test_erase(); +void mtv_test_insert_empty(); +void mtv_test_set_cells(); +void mtv_test_insert_cells(); +void mtv_test_iterators(); +void mtv_test_iterators_element_block(); +void mtv_test_iterators_mutable_element_block(); +void mtv_test_iterators_private_data(); +void mtv_test_iterators_set(); +void mtv_test_iterators_set_2(); +void mtv_test_iterators_insert(); +void mtv_test_iterators_insert_empty(); +void mtv_test_iterators_set_empty(); +void mtv_test_hints_set(); +void mtv_test_hints_set_cells(); +void mtv_test_hints_insert_cells(); +void mtv_test_hints_set_empty(); +void mtv_test_hints_insert_empty(); +void mtv_test_position(); +void mtv_test_position_next(); +void mtv_test_position_advance(); +void mtv_test_swap_range(); +void mtv_test_transfer(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_misc.cpp b/test/multi_type_vector/default/aos/test_misc.cpp new file mode 100644 index 0000000..b8589e2 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_misc.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "misc.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_position.cpp b/test/multi_type_vector/default/aos/test_position.cpp new file mode 100644 index 0000000..ca6b514 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_position.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "position.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_set.cpp b/test/multi_type_vector/default/aos/test_set.cpp new file mode 100644 index 0000000..22de12d --- /dev/null +++ b/test/multi_type_vector/default/aos/test_set.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "set.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_swap_range.cpp b/test/multi_type_vector/default/aos/test_swap_range.cpp new file mode 100644 index 0000000..c3e7fe4 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_swap_range.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "swap_range.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/aos/test_transfer.cpp b/test/multi_type_vector/default/aos/test_transfer.cpp new file mode 100644 index 0000000..cc53440 --- /dev/null +++ b/test/multi_type_vector/default/aos/test_transfer.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "transfer.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/Makefile.am b/test/multi_type_vector/default/soa/Makefile.am new file mode 100644 index 0000000..106f5b7 --- /dev/null +++ b/test/multi_type_vector/default/soa/Makefile.am @@ -0,0 +1,36 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_construction.cpp \ + test_basic.cpp \ + test_empty_cells.cpp \ + test_erase.cpp \ + test_hints.cpp \ + test_insert.cpp \ + test_iterators.cpp \ + test_iterators_insert.cpp \ + test_iterators_set.cpp \ + test_iterators_set_empty.cpp \ + test_misc.cpp \ + test_position.cpp \ + test_set.cpp \ + test_swap_range.cpp \ + test_transfer.cpp \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/default/soa/Makefile.in b/test/multi_type_vector/default/soa/Makefile.in new file mode 100644 index 0000000..75454d9 --- /dev/null +++ b/test/multi_type_vector/default/soa/Makefile.in @@ -0,0 +1,1327 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/multi_type_vector/default/soa +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main-test_construction.$(OBJEXT) \ + test_main-test_basic.$(OBJEXT) \ + test_main-test_empty_cells.$(OBJEXT) \ + test_main-test_erase.$(OBJEXT) test_main-test_hints.$(OBJEXT) \ + test_main-test_insert.$(OBJEXT) \ + test_main-test_iterators.$(OBJEXT) \ + test_main-test_iterators_insert.$(OBJEXT) \ + test_main-test_iterators_set.$(OBJEXT) \ + test_main-test_iterators_set_empty.$(OBJEXT) \ + test_main-test_misc.$(OBJEXT) \ + test_main-test_position.$(OBJEXT) test_main-test_set.$(OBJEXT) \ + test_main-test_swap_range.$(OBJEXT) \ + test_main-test_transfer.$(OBJEXT) \ + test_main-test_main.$(OBJEXT) \ + $(top_builddir)/test/test_main-test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po \ + ./$(DEPDIR)/test_main-test_basic.Po \ + ./$(DEPDIR)/test_main-test_construction.Po \ + ./$(DEPDIR)/test_main-test_empty_cells.Po \ + ./$(DEPDIR)/test_main-test_erase.Po \ + ./$(DEPDIR)/test_main-test_hints.Po \ + ./$(DEPDIR)/test_main-test_insert.Po \ + ./$(DEPDIR)/test_main-test_iterators.Po \ + ./$(DEPDIR)/test_main-test_iterators_insert.Po \ + ./$(DEPDIR)/test_main-test_iterators_set.Po \ + ./$(DEPDIR)/test_main-test_iterators_set_empty.Po \ + ./$(DEPDIR)/test_main-test_main.Po \ + ./$(DEPDIR)/test_main-test_misc.Po \ + ./$(DEPDIR)/test_main-test_position.Po \ + ./$(DEPDIR)/test_main-test_set.Po \ + ./$(DEPDIR)/test_main-test_swap_range.Po \ + ./$(DEPDIR)/test_main-test_transfer.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_construction.cpp \ + test_basic.cpp \ + test_empty_cells.cpp \ + test_erase.cpp \ + test_hints.cpp \ + test_insert.cpp \ + test_iterators.cpp \ + test_iterators_insert.cpp \ + test_iterators_set.cpp \ + test_iterators_set_empty.cpp \ + test_misc.cpp \ + test_position.cpp \ + test_set.cpp \ + test_swap_range.cpp \ + test_transfer.cpp \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/default/soa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/default/soa/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_main-test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_basic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_construction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_empty_cells.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_erase.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_hints.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_insert.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_iterators.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_iterators_insert.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_iterators_set.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_iterators_set_empty.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_misc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_position.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_set.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_swap_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_transfer.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_main-test_construction.o: test_construction.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_construction.o -MD -MP -MF $(DEPDIR)/test_main-test_construction.Tpo -c -o test_main-test_construction.o `test -f 'test_construction.cpp' || echo '$(srcdir)/'`test_construction.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_construction.Tpo $(DEPDIR)/test_main-test_construction.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_construction.cpp' object='test_main-test_construction.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_construction.o `test -f 'test_construction.cpp' || echo '$(srcdir)/'`test_construction.cpp + +test_main-test_construction.obj: test_construction.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_construction.obj -MD -MP -MF $(DEPDIR)/test_main-test_construction.Tpo -c -o test_main-test_construction.obj `if test -f 'test_construction.cpp'; then $(CYGPATH_W) 'test_construction.cpp'; else $(CYGPATH_W) '$(srcdir)/test_construction.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_construction.Tpo $(DEPDIR)/test_main-test_construction.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_construction.cpp' object='test_main-test_construction.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_construction.obj `if test -f 'test_construction.cpp'; then $(CYGPATH_W) 'test_construction.cpp'; else $(CYGPATH_W) '$(srcdir)/test_construction.cpp'; fi` + +test_main-test_basic.o: test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_basic.o -MD -MP -MF $(DEPDIR)/test_main-test_basic.Tpo -c -o test_main-test_basic.o `test -f 'test_basic.cpp' || echo '$(srcdir)/'`test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_basic.Tpo $(DEPDIR)/test_main-test_basic.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_basic.cpp' object='test_main-test_basic.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_basic.o `test -f 'test_basic.cpp' || echo '$(srcdir)/'`test_basic.cpp + +test_main-test_basic.obj: test_basic.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_basic.obj -MD -MP -MF $(DEPDIR)/test_main-test_basic.Tpo -c -o test_main-test_basic.obj `if test -f 'test_basic.cpp'; then $(CYGPATH_W) 'test_basic.cpp'; else $(CYGPATH_W) '$(srcdir)/test_basic.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_basic.Tpo $(DEPDIR)/test_main-test_basic.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_basic.cpp' object='test_main-test_basic.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_basic.obj `if test -f 'test_basic.cpp'; then $(CYGPATH_W) 'test_basic.cpp'; else $(CYGPATH_W) '$(srcdir)/test_basic.cpp'; fi` + +test_main-test_empty_cells.o: test_empty_cells.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_empty_cells.o -MD -MP -MF $(DEPDIR)/test_main-test_empty_cells.Tpo -c -o test_main-test_empty_cells.o `test -f 'test_empty_cells.cpp' || echo '$(srcdir)/'`test_empty_cells.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_empty_cells.Tpo $(DEPDIR)/test_main-test_empty_cells.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_empty_cells.cpp' object='test_main-test_empty_cells.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_empty_cells.o `test -f 'test_empty_cells.cpp' || echo '$(srcdir)/'`test_empty_cells.cpp + +test_main-test_empty_cells.obj: test_empty_cells.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_empty_cells.obj -MD -MP -MF $(DEPDIR)/test_main-test_empty_cells.Tpo -c -o test_main-test_empty_cells.obj `if test -f 'test_empty_cells.cpp'; then $(CYGPATH_W) 'test_empty_cells.cpp'; else $(CYGPATH_W) '$(srcdir)/test_empty_cells.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_empty_cells.Tpo $(DEPDIR)/test_main-test_empty_cells.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_empty_cells.cpp' object='test_main-test_empty_cells.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_empty_cells.obj `if test -f 'test_empty_cells.cpp'; then $(CYGPATH_W) 'test_empty_cells.cpp'; else $(CYGPATH_W) '$(srcdir)/test_empty_cells.cpp'; fi` + +test_main-test_erase.o: test_erase.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_erase.o -MD -MP -MF $(DEPDIR)/test_main-test_erase.Tpo -c -o test_main-test_erase.o `test -f 'test_erase.cpp' || echo '$(srcdir)/'`test_erase.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_erase.Tpo $(DEPDIR)/test_main-test_erase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_erase.cpp' object='test_main-test_erase.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_erase.o `test -f 'test_erase.cpp' || echo '$(srcdir)/'`test_erase.cpp + +test_main-test_erase.obj: test_erase.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_erase.obj -MD -MP -MF $(DEPDIR)/test_main-test_erase.Tpo -c -o test_main-test_erase.obj `if test -f 'test_erase.cpp'; then $(CYGPATH_W) 'test_erase.cpp'; else $(CYGPATH_W) '$(srcdir)/test_erase.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_erase.Tpo $(DEPDIR)/test_main-test_erase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_erase.cpp' object='test_main-test_erase.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_erase.obj `if test -f 'test_erase.cpp'; then $(CYGPATH_W) 'test_erase.cpp'; else $(CYGPATH_W) '$(srcdir)/test_erase.cpp'; fi` + +test_main-test_hints.o: test_hints.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_hints.o -MD -MP -MF $(DEPDIR)/test_main-test_hints.Tpo -c -o test_main-test_hints.o `test -f 'test_hints.cpp' || echo '$(srcdir)/'`test_hints.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_hints.Tpo $(DEPDIR)/test_main-test_hints.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_hints.cpp' object='test_main-test_hints.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_hints.o `test -f 'test_hints.cpp' || echo '$(srcdir)/'`test_hints.cpp + +test_main-test_hints.obj: test_hints.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_hints.obj -MD -MP -MF $(DEPDIR)/test_main-test_hints.Tpo -c -o test_main-test_hints.obj `if test -f 'test_hints.cpp'; then $(CYGPATH_W) 'test_hints.cpp'; else $(CYGPATH_W) '$(srcdir)/test_hints.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_hints.Tpo $(DEPDIR)/test_main-test_hints.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_hints.cpp' object='test_main-test_hints.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_hints.obj `if test -f 'test_hints.cpp'; then $(CYGPATH_W) 'test_hints.cpp'; else $(CYGPATH_W) '$(srcdir)/test_hints.cpp'; fi` + +test_main-test_insert.o: test_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_insert.o -MD -MP -MF $(DEPDIR)/test_main-test_insert.Tpo -c -o test_main-test_insert.o `test -f 'test_insert.cpp' || echo '$(srcdir)/'`test_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_insert.Tpo $(DEPDIR)/test_main-test_insert.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_insert.cpp' object='test_main-test_insert.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_insert.o `test -f 'test_insert.cpp' || echo '$(srcdir)/'`test_insert.cpp + +test_main-test_insert.obj: test_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_insert.obj -MD -MP -MF $(DEPDIR)/test_main-test_insert.Tpo -c -o test_main-test_insert.obj `if test -f 'test_insert.cpp'; then $(CYGPATH_W) 'test_insert.cpp'; else $(CYGPATH_W) '$(srcdir)/test_insert.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_insert.Tpo $(DEPDIR)/test_main-test_insert.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_insert.cpp' object='test_main-test_insert.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_insert.obj `if test -f 'test_insert.cpp'; then $(CYGPATH_W) 'test_insert.cpp'; else $(CYGPATH_W) '$(srcdir)/test_insert.cpp'; fi` + +test_main-test_iterators.o: test_iterators.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators.o -MD -MP -MF $(DEPDIR)/test_main-test_iterators.Tpo -c -o test_main-test_iterators.o `test -f 'test_iterators.cpp' || echo '$(srcdir)/'`test_iterators.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators.Tpo $(DEPDIR)/test_main-test_iterators.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators.cpp' object='test_main-test_iterators.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators.o `test -f 'test_iterators.cpp' || echo '$(srcdir)/'`test_iterators.cpp + +test_main-test_iterators.obj: test_iterators.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators.obj -MD -MP -MF $(DEPDIR)/test_main-test_iterators.Tpo -c -o test_main-test_iterators.obj `if test -f 'test_iterators.cpp'; then $(CYGPATH_W) 'test_iterators.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators.Tpo $(DEPDIR)/test_main-test_iterators.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators.cpp' object='test_main-test_iterators.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators.obj `if test -f 'test_iterators.cpp'; then $(CYGPATH_W) 'test_iterators.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators.cpp'; fi` + +test_main-test_iterators_insert.o: test_iterators_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_insert.o -MD -MP -MF $(DEPDIR)/test_main-test_iterators_insert.Tpo -c -o test_main-test_iterators_insert.o `test -f 'test_iterators_insert.cpp' || echo '$(srcdir)/'`test_iterators_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_insert.Tpo $(DEPDIR)/test_main-test_iterators_insert.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_insert.cpp' object='test_main-test_iterators_insert.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_insert.o `test -f 'test_iterators_insert.cpp' || echo '$(srcdir)/'`test_iterators_insert.cpp + +test_main-test_iterators_insert.obj: test_iterators_insert.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_insert.obj -MD -MP -MF $(DEPDIR)/test_main-test_iterators_insert.Tpo -c -o test_main-test_iterators_insert.obj `if test -f 'test_iterators_insert.cpp'; then $(CYGPATH_W) 'test_iterators_insert.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_insert.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_insert.Tpo $(DEPDIR)/test_main-test_iterators_insert.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_insert.cpp' object='test_main-test_iterators_insert.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_insert.obj `if test -f 'test_iterators_insert.cpp'; then $(CYGPATH_W) 'test_iterators_insert.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_insert.cpp'; fi` + +test_main-test_iterators_set.o: test_iterators_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_set.o -MD -MP -MF $(DEPDIR)/test_main-test_iterators_set.Tpo -c -o test_main-test_iterators_set.o `test -f 'test_iterators_set.cpp' || echo '$(srcdir)/'`test_iterators_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_set.Tpo $(DEPDIR)/test_main-test_iterators_set.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_set.cpp' object='test_main-test_iterators_set.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_set.o `test -f 'test_iterators_set.cpp' || echo '$(srcdir)/'`test_iterators_set.cpp + +test_main-test_iterators_set.obj: test_iterators_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_set.obj -MD -MP -MF $(DEPDIR)/test_main-test_iterators_set.Tpo -c -o test_main-test_iterators_set.obj `if test -f 'test_iterators_set.cpp'; then $(CYGPATH_W) 'test_iterators_set.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_set.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_set.Tpo $(DEPDIR)/test_main-test_iterators_set.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_set.cpp' object='test_main-test_iterators_set.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_set.obj `if test -f 'test_iterators_set.cpp'; then $(CYGPATH_W) 'test_iterators_set.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_set.cpp'; fi` + +test_main-test_iterators_set_empty.o: test_iterators_set_empty.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_set_empty.o -MD -MP -MF $(DEPDIR)/test_main-test_iterators_set_empty.Tpo -c -o test_main-test_iterators_set_empty.o `test -f 'test_iterators_set_empty.cpp' || echo '$(srcdir)/'`test_iterators_set_empty.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_set_empty.Tpo $(DEPDIR)/test_main-test_iterators_set_empty.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_set_empty.cpp' object='test_main-test_iterators_set_empty.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_set_empty.o `test -f 'test_iterators_set_empty.cpp' || echo '$(srcdir)/'`test_iterators_set_empty.cpp + +test_main-test_iterators_set_empty.obj: test_iterators_set_empty.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_iterators_set_empty.obj -MD -MP -MF $(DEPDIR)/test_main-test_iterators_set_empty.Tpo -c -o test_main-test_iterators_set_empty.obj `if test -f 'test_iterators_set_empty.cpp'; then $(CYGPATH_W) 'test_iterators_set_empty.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_set_empty.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_iterators_set_empty.Tpo $(DEPDIR)/test_main-test_iterators_set_empty.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_iterators_set_empty.cpp' object='test_main-test_iterators_set_empty.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_iterators_set_empty.obj `if test -f 'test_iterators_set_empty.cpp'; then $(CYGPATH_W) 'test_iterators_set_empty.cpp'; else $(CYGPATH_W) '$(srcdir)/test_iterators_set_empty.cpp'; fi` + +test_main-test_misc.o: test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_misc.o -MD -MP -MF $(DEPDIR)/test_main-test_misc.Tpo -c -o test_main-test_misc.o `test -f 'test_misc.cpp' || echo '$(srcdir)/'`test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_misc.Tpo $(DEPDIR)/test_main-test_misc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_misc.cpp' object='test_main-test_misc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_misc.o `test -f 'test_misc.cpp' || echo '$(srcdir)/'`test_misc.cpp + +test_main-test_misc.obj: test_misc.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_misc.obj -MD -MP -MF $(DEPDIR)/test_main-test_misc.Tpo -c -o test_main-test_misc.obj `if test -f 'test_misc.cpp'; then $(CYGPATH_W) 'test_misc.cpp'; else $(CYGPATH_W) '$(srcdir)/test_misc.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_misc.Tpo $(DEPDIR)/test_main-test_misc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_misc.cpp' object='test_main-test_misc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_misc.obj `if test -f 'test_misc.cpp'; then $(CYGPATH_W) 'test_misc.cpp'; else $(CYGPATH_W) '$(srcdir)/test_misc.cpp'; fi` + +test_main-test_position.o: test_position.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_position.o -MD -MP -MF $(DEPDIR)/test_main-test_position.Tpo -c -o test_main-test_position.o `test -f 'test_position.cpp' || echo '$(srcdir)/'`test_position.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_position.Tpo $(DEPDIR)/test_main-test_position.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_position.cpp' object='test_main-test_position.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_position.o `test -f 'test_position.cpp' || echo '$(srcdir)/'`test_position.cpp + +test_main-test_position.obj: test_position.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_position.obj -MD -MP -MF $(DEPDIR)/test_main-test_position.Tpo -c -o test_main-test_position.obj `if test -f 'test_position.cpp'; then $(CYGPATH_W) 'test_position.cpp'; else $(CYGPATH_W) '$(srcdir)/test_position.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_position.Tpo $(DEPDIR)/test_main-test_position.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_position.cpp' object='test_main-test_position.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_position.obj `if test -f 'test_position.cpp'; then $(CYGPATH_W) 'test_position.cpp'; else $(CYGPATH_W) '$(srcdir)/test_position.cpp'; fi` + +test_main-test_set.o: test_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_set.o -MD -MP -MF $(DEPDIR)/test_main-test_set.Tpo -c -o test_main-test_set.o `test -f 'test_set.cpp' || echo '$(srcdir)/'`test_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_set.Tpo $(DEPDIR)/test_main-test_set.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_set.cpp' object='test_main-test_set.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_set.o `test -f 'test_set.cpp' || echo '$(srcdir)/'`test_set.cpp + +test_main-test_set.obj: test_set.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_set.obj -MD -MP -MF $(DEPDIR)/test_main-test_set.Tpo -c -o test_main-test_set.obj `if test -f 'test_set.cpp'; then $(CYGPATH_W) 'test_set.cpp'; else $(CYGPATH_W) '$(srcdir)/test_set.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_set.Tpo $(DEPDIR)/test_main-test_set.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_set.cpp' object='test_main-test_set.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_set.obj `if test -f 'test_set.cpp'; then $(CYGPATH_W) 'test_set.cpp'; else $(CYGPATH_W) '$(srcdir)/test_set.cpp'; fi` + +test_main-test_swap_range.o: test_swap_range.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap_range.o -MD -MP -MF $(DEPDIR)/test_main-test_swap_range.Tpo -c -o test_main-test_swap_range.o `test -f 'test_swap_range.cpp' || echo '$(srcdir)/'`test_swap_range.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap_range.Tpo $(DEPDIR)/test_main-test_swap_range.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap_range.cpp' object='test_main-test_swap_range.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap_range.o `test -f 'test_swap_range.cpp' || echo '$(srcdir)/'`test_swap_range.cpp + +test_main-test_swap_range.obj: test_swap_range.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap_range.obj -MD -MP -MF $(DEPDIR)/test_main-test_swap_range.Tpo -c -o test_main-test_swap_range.obj `if test -f 'test_swap_range.cpp'; then $(CYGPATH_W) 'test_swap_range.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap_range.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap_range.Tpo $(DEPDIR)/test_main-test_swap_range.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap_range.cpp' object='test_main-test_swap_range.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap_range.obj `if test -f 'test_swap_range.cpp'; then $(CYGPATH_W) 'test_swap_range.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap_range.cpp'; fi` + +test_main-test_transfer.o: test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_transfer.o -MD -MP -MF $(DEPDIR)/test_main-test_transfer.Tpo -c -o test_main-test_transfer.o `test -f 'test_transfer.cpp' || echo '$(srcdir)/'`test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_transfer.Tpo $(DEPDIR)/test_main-test_transfer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_transfer.cpp' object='test_main-test_transfer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_transfer.o `test -f 'test_transfer.cpp' || echo '$(srcdir)/'`test_transfer.cpp + +test_main-test_transfer.obj: test_transfer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_transfer.obj -MD -MP -MF $(DEPDIR)/test_main-test_transfer.Tpo -c -o test_main-test_transfer.obj `if test -f 'test_transfer.cpp'; then $(CYGPATH_W) 'test_transfer.cpp'; else $(CYGPATH_W) '$(srcdir)/test_transfer.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_transfer.Tpo $(DEPDIR)/test_main-test_transfer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_transfer.cpp' object='test_main-test_transfer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_transfer.obj `if test -f 'test_transfer.cpp'; then $(CYGPATH_W) 'test_transfer.cpp'; else $(CYGPATH_W) '$(srcdir)/test_transfer.cpp'; fi` + +test_main-test_main.o: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.o -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp + +test_main-test_main.obj: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.obj -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` + +$(top_builddir)/test/test_main-test_global.o: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.o -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp + +$(top_builddir)/test/test_main-test_global.obj: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.obj -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_basic.Po + -rm -f ./$(DEPDIR)/test_main-test_construction.Po + -rm -f ./$(DEPDIR)/test_main-test_empty_cells.Po + -rm -f ./$(DEPDIR)/test_main-test_erase.Po + -rm -f ./$(DEPDIR)/test_main-test_hints.Po + -rm -f ./$(DEPDIR)/test_main-test_insert.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_insert.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_set.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_set_empty.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_misc.Po + -rm -f ./$(DEPDIR)/test_main-test_position.Po + -rm -f ./$(DEPDIR)/test_main-test_set.Po + -rm -f ./$(DEPDIR)/test_main-test_swap_range.Po + -rm -f ./$(DEPDIR)/test_main-test_transfer.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_basic.Po + -rm -f ./$(DEPDIR)/test_main-test_construction.Po + -rm -f ./$(DEPDIR)/test_main-test_empty_cells.Po + -rm -f ./$(DEPDIR)/test_main-test_erase.Po + -rm -f ./$(DEPDIR)/test_main-test_hints.Po + -rm -f ./$(DEPDIR)/test_main-test_insert.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_insert.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_set.Po + -rm -f ./$(DEPDIR)/test_main-test_iterators_set_empty.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_misc.Po + -rm -f ./$(DEPDIR)/test_main-test_position.Po + -rm -f ./$(DEPDIR)/test_main-test_set.Po + -rm -f ./$(DEPDIR)/test_main-test_swap_range.Po + -rm -f ./$(DEPDIR)/test_main-test_transfer.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/default/soa/test_basic.cpp b/test/multi_type_vector/default/soa/test_basic.cpp new file mode 100644 index 0000000..8857d98 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_basic.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "basic.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_construction.cpp b/test/multi_type_vector/default/soa/test_construction.cpp new file mode 100644 index 0000000..f36f423 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_construction.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "construction.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_empty_cells.cpp b/test/multi_type_vector/default/soa/test_empty_cells.cpp new file mode 100644 index 0000000..1750687 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_empty_cells.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "empty_cells.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_erase.cpp b/test/multi_type_vector/default/soa/test_erase.cpp new file mode 100644 index 0000000..d1734c3 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_erase.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "erase.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_hints.cpp b/test/multi_type_vector/default/soa/test_hints.cpp new file mode 100644 index 0000000..daa4a0f --- /dev/null +++ b/test/multi_type_vector/default/soa/test_hints.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "hints.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_insert.cpp b/test/multi_type_vector/default/soa/test_insert.cpp new file mode 100644 index 0000000..22c3d6f --- /dev/null +++ b/test/multi_type_vector/default/soa/test_insert.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "insert.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_iterators.cpp b/test/multi_type_vector/default/soa/test_iterators.cpp new file mode 100644 index 0000000..3db4bd1 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_iterators.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "iterators.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_iterators_insert.cpp b/test/multi_type_vector/default/soa/test_iterators_insert.cpp new file mode 100644 index 0000000..414620e --- /dev/null +++ b/test/multi_type_vector/default/soa/test_iterators_insert.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "iterators_insert.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_iterators_set.cpp b/test/multi_type_vector/default/soa/test_iterators_set.cpp new file mode 100644 index 0000000..d03489c --- /dev/null +++ b/test/multi_type_vector/default/soa/test_iterators_set.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "iterators_set.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_iterators_set_empty.cpp b/test/multi_type_vector/default/soa/test_iterators_set_empty.cpp new file mode 100644 index 0000000..c3bd67f --- /dev/null +++ b/test/multi_type_vector/default/soa/test_iterators_set_empty.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "iterators_set_empty.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_main.cpp b/test/multi_type_vector/default/soa/test_main.cpp new file mode 100644 index 0000000..9700b31 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_main.cpp @@ -0,0 +1,84 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +int main() +{ + try + { + mtv_test_construction(); + mtv_test_basic(); + mtv_test_basic_numeric(); + mtv_test_empty_cells(); + mtv_test_misc_types(); + mtv_test_misc_swap(); + mtv_test_misc_equality(); + mtv_test_misc_clone(); + mtv_test_misc_resize(); + mtv_test_misc_value_type(); + mtv_test_misc_block_identifier(); + mtv_test_misc_push_back(); + mtv_test_misc_capacity(); + mtv_test_misc_position_type_end_position(); + mtv_test_misc_block_pos_adjustments(); + mtv_test_erase(); + mtv_test_insert_empty(); + mtv_test_set_cells(); + mtv_test_insert_cells(); + mtv_test_iterators(); + mtv_test_iterators_element_block(); + mtv_test_iterators_mutable_element_block(); + mtv_test_iterators_set(); + mtv_test_iterators_set_2(); + mtv_test_iterators_insert(); + mtv_test_iterators_insert_empty(); + mtv_test_iterators_set_empty(); + mtv_test_hints_set(); + mtv_test_hints_set_cells(); + mtv_test_hints_insert_cells(); + mtv_test_hints_set_empty(); + mtv_test_hints_insert_empty(); + mtv_test_position(); + mtv_test_position_next(); + mtv_test_position_advance(); + mtv_test_swap_range(); + mtv_test_transfer(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_main.hpp b/test/multi_type_vector/default/soa/test_main.hpp new file mode 100644 index 0000000..ed6ab59 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_main.hpp @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/soa/main.hpp> +#include <mdds/multi_type_vector/types.hpp> + +#include <deque> + +using mtv_type = mdds::mtv::soa::multi_type_vector<mdds::mtv::standard_element_blocks_traits>; + +template<typename _ValT> +bool test_cell_insertion(mtv_type& col_db, std::size_t row, _ValT val) +{ + _ValT test; + col_db.set(row, val); + col_db.get(row, test); + + if (val == test) + return true; + + std::cout << "row " << row << ": value stored = " << val << "; value retrieved = " << test << std::endl; + return false; +} + +void mtv_test_construction(); +void mtv_test_basic(); +void mtv_test_basic_numeric(); +void mtv_test_empty_cells(); +void mtv_test_misc_types(); +void mtv_test_misc_swap(); +void mtv_test_misc_equality(); +void mtv_test_misc_clone(); +void mtv_test_misc_resize(); +void mtv_test_misc_value_type(); +void mtv_test_misc_block_identifier(); +void mtv_test_misc_push_back(); +void mtv_test_misc_capacity(); +void mtv_test_misc_position_type_end_position(); +void mtv_test_misc_block_pos_adjustments(); +void mtv_test_erase(); +void mtv_test_insert_empty(); +void mtv_test_set_cells(); +void mtv_test_insert_cells(); +void mtv_test_iterators(); +void mtv_test_iterators_element_block(); +void mtv_test_iterators_mutable_element_block(); +void mtv_test_iterators_set(); +void mtv_test_iterators_set_2(); +void mtv_test_iterators_insert(); +void mtv_test_iterators_insert_empty(); +void mtv_test_iterators_set_empty(); +void mtv_test_hints_set(); +void mtv_test_hints_set_cells(); +void mtv_test_hints_insert_cells(); +void mtv_test_hints_set_empty(); +void mtv_test_hints_insert_empty(); +void mtv_test_position(); +void mtv_test_position_next(); +void mtv_test_position_advance(); +void mtv_test_swap_range(); +void mtv_test_transfer(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_misc.cpp b/test/multi_type_vector/default/soa/test_misc.cpp new file mode 100644 index 0000000..b8589e2 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_misc.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "misc.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_position.cpp b/test/multi_type_vector/default/soa/test_position.cpp new file mode 100644 index 0000000..ca6b514 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_position.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "position.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_set.cpp b/test/multi_type_vector/default/soa/test_set.cpp new file mode 100644 index 0000000..22de12d --- /dev/null +++ b/test/multi_type_vector/default/soa/test_set.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "set.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_swap_range.cpp b/test/multi_type_vector/default/soa/test_swap_range.cpp new file mode 100644 index 0000000..c3e7fe4 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_swap_range.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "swap_range.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/soa/test_transfer.cpp b/test/multi_type_vector/default/soa/test_transfer.cpp new file mode 100644 index 0000000..cc53440 --- /dev/null +++ b/test/multi_type_vector/default/soa/test_transfer.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "transfer.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/Makefile.am b/test/multi_type_vector/default/tc/Makefile.am new file mode 100644 index 0000000..eced27f --- /dev/null +++ b/test/multi_type_vector/default/tc/Makefile.am @@ -0,0 +1,17 @@ +EXTRA_DIST = \ + basic.inl \ + empty_cells.inl \ + hints.inl \ + iterators.inl \ + iterators_set_empty.inl \ + misc.inl \ + set.inl \ + transfer.inl \ + construction.inl \ + erase.inl \ + insert.inl \ + iterators_insert.inl \ + iterators_set.inl \ + position.inl \ + swap_range.inl + diff --git a/test/multi_type_vector/default/tc/Makefile.in b/test/multi_type_vector/default/tc/Makefile.in new file mode 100644 index 0000000..740217e --- /dev/null +++ b/test/multi_type_vector/default/tc/Makefile.in @@ -0,0 +1,476 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/default/tc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +EXTRA_DIST = \ + basic.inl \ + empty_cells.inl \ + hints.inl \ + iterators.inl \ + iterators_set_empty.inl \ + misc.inl \ + set.inl \ + transfer.inl \ + construction.inl \ + erase.inl \ + insert.inl \ + iterators_insert.inl \ + iterators_set.inl \ + position.inl \ + swap_range.inl + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/default/tc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/default/tc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am check-valgrind-am \ + check-valgrind-drd-am check-valgrind-drd-local \ + check-valgrind-helgrind-am check-valgrind-helgrind-local \ + check-valgrind-local check-valgrind-memcheck-am \ + check-valgrind-memcheck-local check-valgrind-sgcheck-am \ + check-valgrind-sgcheck-local clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/default/tc/basic.inl b/test/multi_type_vector/default/tc/basic.inl new file mode 100644 index 0000000..4acd299 --- /dev/null +++ b/test/multi_type_vector/default/tc/basic.inl @@ -0,0 +1,669 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_basic() +{ + stack_printer __stack_printer__(__FUNCTION__); + + bool res; + { + // Single column instance with only one row. + mtv_type col_db(1); + + double test = -999.0; + + // Empty cell has a numeric value of 0.0. + col_db.get(0, test); + assert(test == 0.0); + + // Basic value setting and retrieval. + res = test_cell_insertion(col_db, 0, 2.0); + assert(res); + } + + { + // Insert first value into the top row. + mtv_type col_db(2); + double test = -999.0; + + // Test empty cell values. + col_db.get(0, test); + assert(test == 0.0); + test = 1.0; + col_db.get(1, test); + assert(test == 0.0); + + res = test_cell_insertion(col_db, 0, 5.0); + assert(res); + + col_db.get(1, test); + assert(test == 0.0); // should be empty. + + // Insert a new value to an empty row right below a non-empty one. + res = test_cell_insertion(col_db, 1, 7.5); + assert(res); + } + + { + mtv_type col_db(3); + res = test_cell_insertion(col_db, 0, 4.5); + assert(res); + res = test_cell_insertion(col_db, 1, 5.1); + assert(res); + res = test_cell_insertion(col_db, 2, 34.2); + assert(res); + } + + { + // Insert first value into the bottom row. + mtv_type col_db(3); + + res = test_cell_insertion(col_db, 2, 5.0); // Insert into the last row. + assert(res); + + double test = 9; + col_db.get(1, test); + assert(test == 0.0); // should be empty. + + res = test_cell_insertion(col_db, 0, 2.5); + assert(res); + + col_db.get(1, test); + assert(test == 0.0); // should be empty. + + res = test_cell_insertion(col_db, 1, 1.2); + assert(res); + } + + { + // This time insert from bottom up one by one. + mtv_type col_db(3); + res = test_cell_insertion(col_db, 2, 1.2); + assert(res); + res = test_cell_insertion(col_db, 1, 0.2); + assert(res); + res = test_cell_insertion(col_db, 0, 23.1); + assert(res); + } + + { + mtv_type col_db(4); + long order[] = {3, 1, 2, 0}; + double val = 1.0; + for (size_t i = 0; i < 4; ++i, ++val) + { + res = test_cell_insertion(col_db, order[i], val); + assert(res); + } + } + + { + mtv_type col_db(4); + long order[] = {0, 3, 1, 2}; + double val = 1.0; + for (size_t i = 0; i < 4; ++i, ++val) + { + res = test_cell_insertion(col_db, order[i], val); + assert(res); + } + } + + { + mtv_type col_db(4); + long order[] = {0, 2, 3, 1}; + double val = 1.0; + for (size_t i = 0; i < 4; ++i, ++val) + { + res = test_cell_insertion(col_db, order[i], val); + assert(res); + } + } + + { + mtv_type col_db(5); + long order[] = {0, 4, 3, 2, 1}; + double val = 1.0; + for (size_t i = 0; i < 5; ++i, ++val) + { + res = test_cell_insertion(col_db, order[i], val); + assert(res); + } + } + + { + // Insert first value into a middle row. + mtv_type col_db(10); + res = test_cell_insertion(col_db, 5, 5.0); + assert(res); + std::string str = "test"; + res = test_cell_insertion(col_db, 4, str); + assert(res); + } + + { + mtv_type col_db(3); + res = test_cell_insertion(col_db, 0, 5.0); + assert(res); + std::string str = "test"; + res = test_cell_insertion(col_db, 2, str); + assert(res); + res = test_cell_insertion(col_db, 1, 2.0); + assert(res); + } + + { + mtv_type col_db(2); + res = test_cell_insertion(col_db, 0, 5.0); + assert(res); + std::string str = "test"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + } + + { + mtv_type col_db(3); + res = test_cell_insertion(col_db, 0, 5.0); + assert(res); + std::string str = "test"; + res = test_cell_insertion(col_db, 2, str); + assert(res); + str = "foo"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + } + + { + mtv_type col_db(3); + res = test_cell_insertion(col_db, 0, 5.0); + assert(res); + res = test_cell_insertion(col_db, 2, 2.0); + assert(res); + std::string str = "foo"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + } + + { + mtv_type col_db(3); + res = test_cell_insertion(col_db, 0, 5.0); + assert(res); + std::string str = "foo"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + str = "test"; + res = test_cell_insertion(col_db, 2, str); + assert(res); + } + + { + mtv_type col_db(4); + res = test_cell_insertion(col_db, 0, 5.0); + assert(res); + std::string str = "foo"; + res = test_cell_insertion(col_db, 3, str); + assert(res); + + res = test_cell_insertion(col_db, 2, 2.0); + assert(res); + std::string test; + col_db.get(3, test); // Check the cell below. + assert(test == "foo"); + + res = test_cell_insertion(col_db, 1, -2.0); + assert(res); + test = "hmm"; + col_db.get(3, test); + assert(test == "foo"); + + res = test_cell_insertion(col_db, 0, 7.5); // overwrite. + assert(res); + + str = "bah"; + res = test_cell_insertion(col_db, 0, str); // overwrite with different type. + assert(res); + double val = -999; + col_db.get(1, val); // Check the cell below. + assert(val == -2.0); + + str = "alpha"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + col_db.get(2, val); // Check the cell below. + assert(val == 2.0); + + col_db.get(3, test); + assert(test == "foo"); + + str = "beta"; + res = test_cell_insertion(col_db, 2, str); + assert(res); + } + + { + mtv_type col_db(1); + res = test_cell_insertion(col_db, 0, 2.0); + assert(res); + std::string str = "foo"; + res = test_cell_insertion(col_db, 0, str); + assert(res); + res = test_cell_insertion(col_db, 0, 3.0); + assert(res); + } + + { + mtv_type col_db(2); + res = test_cell_insertion(col_db, 0, 2.0); + assert(res); + std::string str = "foo"; + res = test_cell_insertion(col_db, 0, str); + assert(res); + res = test_cell_insertion(col_db, 0, 3.0); + assert(res); + res = test_cell_insertion(col_db, 1, str); + assert(res); + str = "alpha"; + res = test_cell_insertion(col_db, 0, str); + assert(res); + std::string test; + col_db.get(1, test); + assert(test == "foo"); + } + + { + mtv_type col_db(3); + std::string str = "alpha"; + col_db.set(2, str); + res = test_cell_insertion(col_db, 2, 5.0); + assert(res); + + res = test_cell_insertion(col_db, 0, 1.0); + assert(res); + res = test_cell_insertion(col_db, 1, 2.0); + assert(res); + + // At this point it contains one numeric block with 3 values. + + str = "beta"; + res = test_cell_insertion(col_db, 2, str); + assert(res); + res = test_cell_insertion(col_db, 2, 3.0); + assert(res); + double test; + col_db.get(0, test); + assert(test == 1.0); + col_db.get(1, test); + assert(test == 2.0); + col_db.get(2, test); + assert(test == 3.0); + } + + { + mtv_type col_db(3); + res = test_cell_insertion(col_db, 1, 5.0); + assert(res); + std::string str = "alpha"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + + res = test_cell_insertion(col_db, 0, 4.0); + assert(res); + res = test_cell_insertion(col_db, 1, 3.0); + assert(res); + double test; + col_db.get(0, test); + assert(test == 4.0); + + // The top 2 cells are numeric and the bottom cell is still empty. + + str = "beta"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + col_db.get(0, test); + assert(test == 4.0); + + res = test_cell_insertion(col_db, 1, 6.5); + assert(res); + col_db.get(0, test); + assert(test == 4.0); + + str = "gamma"; + res = test_cell_insertion(col_db, 2, str); + assert(res); + col_db.get(0, test); + assert(test == 4.0); + col_db.get(1, test); + assert(test == 6.5); + + // The top 2 cells are numeric and the bottom cell is std::string. + + str = "delta"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + } + + { + mtv_type col_db(4); + col_db.set(0, 1.0); + std::string str = "foo"; + col_db.set(1, str); + col_db.set(2, str); + col_db.set(3, 4.0); + + res = test_cell_insertion(col_db, 2, 3.0); + assert(res); + double test; + col_db.get(3, test); + assert(test == 4.0); + } + + { + mtv_type col_db(4); + col_db.set(0, 1.0); + std::string str = "foo"; + col_db.set(1, str); + col_db.set(2, str); + col_db.set(3, str); + + res = test_cell_insertion(col_db, 3, 3.0); + assert(res); + } + + { + mtv_type col_db(4); + col_db.set(0, 1.0); + std::string str = "foo"; + col_db.set(1, str); + col_db.set(2, str); + + res = test_cell_insertion(col_db, 2, 3.0); + assert(res); + + // Next cell should still be empty. + double test_val; + col_db.get(3, test_val); + assert(test_val == 0.0); + std::string test_str; + col_db.get(3, test_str); + assert(test_str.empty()); + } + + { + mtv_type col_db(4); + col_db.set(0, 1.0); + col_db.set(1, 1.0); + col_db.set(2, 1.0); + col_db.set(3, 1.0); + std::string str = "alpha"; + res = test_cell_insertion(col_db, 2, str); + assert(res); + } + + { + mtv_type col_db(3); + col_db.set(0, 1.0); + col_db.set(1, 1.0); + std::string str = "foo"; + col_db.set(2, str); + uint64_t index = 5; + test_cell_insertion(col_db, 2, index); + } + + { + mtv_type col_db(3); + col_db.set(1, 1.0); + std::string str = "foo"; + col_db.set(2, str); + str = "bah"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + res = test_cell_insertion(col_db, 1, 2.0); + assert(res); + uint64_t index = 2; + res = test_cell_insertion(col_db, 1, index); + assert(res); + std::string test; + col_db.get(2, test); + assert(test == "foo"); + str = "alpha"; + res = test_cell_insertion(col_db, 0, str); + assert(res); + double val = 3.5; + res = test_cell_insertion(col_db, 1, val); + assert(res); + index = 3; + res = test_cell_insertion(col_db, 2, index); + assert(res); + + // At this point cells 1, 2, 3 all contain different data types. + + str = "beta"; + res = test_cell_insertion(col_db, 1, str); + assert(res); + + // Reset. + val = 4.5; + res = test_cell_insertion(col_db, 1, val); + assert(res); + + index = 4; + res = test_cell_insertion(col_db, 1, index); + assert(res); + } + + { + mtv_type col_db(3); + col_db.set(0, 1.0); + std::string str = "alpha"; + col_db.set(1, str); + str = "beta"; + col_db.set(2, str); + uint64_t index = 1; + res = test_cell_insertion(col_db, 1, index); + assert(res); + std::string test; + col_db.get(2, test); + assert(test == "beta"); + } + + { + mtv_type col_db(3); + + // Insert 3 cells of 3 different types. + res = test_cell_insertion(col_db, 0, true); + assert(res); + res = test_cell_insertion(col_db, 1, 1.2); + assert(res); + std::string str = "foo"; + res = test_cell_insertion(col_db, 2, str); + assert(res); + + // Now, insert a cell of the 4th type to the middle spot. + uint64_t index = 2; + res = test_cell_insertion(col_db, 1, index); + assert(res); + } + + { + // set_cell() to merge 3 blocks. + mtv_type db(6); + db.set(0, static_cast<uint64_t>(12)); + db.set(1, 1.0); + db.set(2, 2.0); + db.set(3, std::string("foo")); + db.set(4, 3.0); + db.set(5, 4.0); + assert(db.block_size() == 4); + assert(db.get<uint64_t>(0) == 12); + assert(db.get<double>(1) == 1.0); + assert(db.get<double>(2) == 2.0); + assert(db.get<std::string>(3) == "foo"); + assert(db.get<double>(4) == 3.0); + assert(db.get<double>(5) == 4.0); + + db.set(3, 5.0); // merge blocks. + assert(db.block_size() == 2); + assert(db.get<uint64_t>(0) == 12); + assert(db.get<double>(1) == 1.0); + assert(db.get<double>(2) == 2.0); + assert(db.get<double>(3) == 5.0); + assert(db.get<double>(4) == 3.0); + assert(db.get<double>(5) == 4.0); + } + + { + mtv_type db(25); + db.set(0, 1.2); + db.set(5, std::string("test")); + db.set(1, std::string("foo")); + db.set(6, true); + assert(db.get<double>(0) == 1.2); + assert(db.get<std::string>(5) == "test"); + assert(db.get<std::string>(1) == "foo"); + assert(db.get<bool>(6) == true); + } + + { + // Test various integer types. + mtv_type db(7); + db.set(0, static_cast<int64_t>(-10)); + db.set(1, static_cast<uint64_t>(10)); + db.set(2, static_cast<int32_t>(-10)); + db.set(3, static_cast<uint32_t>(10)); + db.set(4, static_cast<int16_t>(-10)); + db.set(5, static_cast<uint16_t>(10)); + db.set(6, true); + assert(db.block_size() == 7); + assert(db.get_type(0) == mdds::mtv::element_type_int64); + assert(db.get_type(1) == mdds::mtv::element_type_uint64); + assert(db.get_type(2) == mdds::mtv::element_type_int32); + assert(db.get_type(3) == mdds::mtv::element_type_uint32); + assert(db.get_type(4) == mdds::mtv::element_type_int16); + assert(db.get_type(5) == mdds::mtv::element_type_uint16); + assert(db.get_type(6) == mdds::mtv::element_type_boolean); + } + + { + mtv_type db(10); + db.set(0, 1.1); + db.set(1, 1.2); + db.set(2, true); + db.set(3, false); + db.set(8, std::string("A")); + db.set(9, std::string("B")); + db.set(7, 2.1); + assert(db.block_size() == 5); + assert(db.get_type(7) == mdds::mtv::element_type_double); + assert(db.get<double>(7) == 2.1); + } + + { + mtv_type db(8, true); + std::vector<double> vals(3, 1.2); + db.set(4, vals.begin(), vals.end()); + db.set(3, 4.1); + assert(db.get<bool>(0) == true); + assert(db.get<bool>(1) == true); + assert(db.get<bool>(2) == true); + assert(db.get<double>(3) == 4.1); + assert(db.get<double>(4) == 1.2); + assert(db.get<double>(5) == 1.2); + assert(db.get<double>(6) == 1.2); + assert(db.get<bool>(7) == true); + } + + { + mtv_type db(10, false); + db.set<int8_t>(0, 'a'); + db.set<int8_t>(1, 'b'); + db.set<int8_t>(2, 'c'); + + db.set<uint8_t>(3, 'd'); + db.set<uint8_t>(4, 'e'); + db.set<uint8_t>(5, 'f'); + + assert(db.block_size() == 3); + db.set<int8_t>(0, 'r'); // overwrite. + db.set<uint8_t>(5, 'z'); // overwrite + + assert(db.block_size() == 3); + mtv_type::const_iterator it = db.begin(); + assert(it != db.end()); + assert(it->type == mdds::mtv::element_type_int8); + { + const int8_t* p = &mdds::mtv::int8_element_block::at(*it->data, 0); + assert(*p == 'r'); + ++p; + assert(*p == 'b'); + ++p; + assert(*p == 'c'); + } + + ++it; + assert(it != db.end()); + assert(it->type == mdds::mtv::element_type_uint8); + { + const uint8_t* p = mdds::mtv::uint8_element_block::data(*it->data); + assert(*p == 'd'); + ++p; + assert(*p == 'e'); + ++p; + assert(*p == 'z'); + } + } +} + +/** + * Ensure that float and double types are treated as different types. + */ +void mtv_test_basic_numeric() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_type db; + + db.push_back<double>(0.0); + db.push_back<double>(1.0); + db.push_back<double>(2.0); + + assert(db.size() == 3); + assert(db.block_size() == 1); + + db.set<float>(1, 4.0f); + assert(db.size() == 3); + assert(db.block_size() == 3); + + db.set<float>(0, 3.5f); + assert(db.size() == 3); + assert(db.block_size() == 2); + + db.set<float>(2, 4.5f); + assert(db.size() == 3); + assert(db.block_size() == 1); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/construction.inl b/test/multi_type_vector/default/tc/construction.inl new file mode 100644 index 0000000..0c0a28d --- /dev/null +++ b/test/multi_type_vector/default/tc/construction.inl @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_construction() +{ + stack_printer __stack_printer__(__FUNCTION__); + + { + mtv_type db; // default constructor. + assert(db.size() == 0); + assert(db.empty()); + assert(db.block_size() == 0); + } + + { + // Create an empty segment of size 7. + mtv_type db(7); + assert(db.size() == 7); + assert(db.block_size() == 1); + } + + { + // Create with initial value and size. + mtv_type db(10, 1.0); + assert(db.size() == 10); + assert(db.block_size() == 1); + assert(db.get<double>(0) == 1.0); + assert(db.get<double>(9) == 1.0); + } + + { + // Create with initial value and size. + mtv_type db(10, std::string("foo")); + assert(db.size() == 10); + assert(db.block_size() == 1); + assert(db.get<std::string>(0) == "foo"); + assert(db.get<std::string>(9) == "foo"); + } + + { + // Create with an array of values. + std::vector<double> vals; + vals.push_back(1.1); + vals.push_back(1.2); + vals.push_back(1.3); + mtv_type db(vals.size(), vals.begin(), vals.end()); + assert(db.size() == 3); + assert(db.block_size() == 1); + assert(db.get<double>(0) == 1.1); + assert(db.get<double>(1) == 1.2); + assert(db.get<double>(2) == 1.3); + } + + { + std::vector<std::string> vals; + mtv_type db_empty(0, vals.begin(), vals.end()); + assert(db_empty.size() == 0); + assert(db_empty.block_size() == 0); + + vals.push_back("Andy"); + vals.push_back("Bruce"); + + mtv_type db(2, vals.begin(), vals.end()); + assert(db.size() == 2); + assert(db.block_size() == 1); + assert(db.get<std::string>(0) == "Andy"); + assert(db.get<std::string>(1) == "Bruce"); + } + + { + std::vector<int32_t> vals(10, 1); + try + { + mtv_type db(20, vals.begin(), vals.end()); + assert(!"This construction should have failed due to incorrect initial array size."); + } + catch (const mdds::invalid_arg_error&) + { + // good. + } + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/empty_cells.inl b/test/multi_type_vector/default/tc/empty_cells.inl new file mode 100644 index 0000000..293f77b --- /dev/null +++ b/test/multi_type_vector/default/tc/empty_cells.inl @@ -0,0 +1,449 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_empty_cells() +{ + stack_printer __stack_printer__(__FUNCTION__); + + { + mtv_type db(3); + + assert(db.is_empty(0)); + assert(db.is_empty(2)); + + // These won't change the state of the container since it's already empty. + db.set_empty(0, 0); + db.set_empty(1, 1); + db.set_empty(2, 2); + db.set_empty(0, 2); + + db.set(0, 1.0); + db.set(2, 5.0); + assert(!db.is_empty(0)); + assert(!db.is_empty(2)); + assert(db.is_empty(1)); + + db.set(1, 2.3); + assert(!db.is_empty(1)); + + // Container contains a single block of numeric cells at this point. + + // Set the whole block empty. + db.set_empty(0, 2); + + // Reset. + db.set(0, 1.0); + db.set(1, 2.0); + db.set(2, 4.0); + + // Set the upper part of the block empty. + db.set_empty(0, 1); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(!db.is_empty(2)); + + double test; + db.get(2, test); + assert(test == 4.0); + + // Reset. + db.set(0, 5.0); + db.set(1, 5.1); + db.set(2, 5.2); + + // Set the lower part of the block empty. + db.set_empty(1, 2); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + + db.get(0, test); + assert(test == 5.0); + + // Reset. + db.set(0, 3.0); + db.set(1, 3.1); + db.set(2, 3.2); + + // Set the middle part of the block empty. + db.set_empty(1, 1); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(!db.is_empty(2)); + db.get(0, test); + assert(test == 3.0); + db.get(2, test); + assert(test == 3.2); + + bool res = test_cell_insertion(db, 1, 4.3); + assert(res); + } + + { + // Empty multiple cells at the middle part of a block. + mtv_type db(4); + for (size_t i = 0; i < 4; ++i) + db.set(i, static_cast<double>(i + 1)); + + for (size_t i = 0; i < 4; ++i) + { + assert(!db.is_empty(i)); + } + + db.set_empty(1, 2); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(!db.is_empty(3)); + + double test; + db.get(0, test); + assert(test == 1.0); + db.get(3, test); + assert(test == 4.0); + } + + { + // Empty multiple blocks. + mtv_type db(2); + db.set(0, 1.0); + db.set(1, std::string("foo")); + assert(!db.is_empty(0)); + assert(!db.is_empty(1)); + + db.set_empty(0, 1); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + } + + { + // Empty multiple blocks, part 2 - from middle block to middle block. + mtv_type db(6); + db.set(0, 1.0); + db.set(1, 2.0); + std::string str = "foo"; + db.set(2, str); + db.set(3, str); + uint64_t index = 1; + db.set(4, index); + index = 100; + db.set(5, index); + + db.set_empty(1, 4); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + assert(!db.is_empty(5)); + double val; + db.get(0, val); + assert(val == 1.0); + uint64_t index_test; + db.get(5, index_test); + assert(index_test == 100); + } + + { + // Empty multiple blocks, part 3 - from top block to middle block. + mtv_type db(6); + db.set(0, 1.0); + db.set(1, 2.0); + std::string str = "foo"; + db.set(2, str); + db.set(3, str); + uint64_t index = 1; + db.set(4, index); + index = 50; + db.set(5, index); + + db.set_empty(0, 4); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + assert(!db.is_empty(5)); + uint64_t test; + db.get(5, test); + assert(test == 50); + } + + { + // Empty multiple blocks, part 4 - from middle block to bottom block. + mtv_type db(6); + db.set(0, 1.0); + db.set(1, 2.0); + std::string str = "foo"; + db.set(2, str); + db.set(3, str); + uint64_t index = 1; + db.set(4, index); + db.set(5, index); + + db.set_empty(1, 5); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + assert(db.is_empty(5)); + double test; + db.get(0, test); + assert(test == 1.0); + } + + { + // Empty multiple blocks, part 5 - from middle empty block to middle non-empty block. + mtv_type db(6); + db.set(2, 1.0); + db.set(3, 2.0); + std::string str = "foo"; + db.set(4, str); + str = "baa"; + db.set(5, str); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(!db.is_empty(2)); + assert(!db.is_empty(3)); + assert(!db.is_empty(4)); + assert(!db.is_empty(5)); + assert(db.block_size() == 3); + + db.set_empty(1, 4); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + assert(!db.is_empty(5)); + assert(db.block_size() == 2); + std::string test; + db.get(5, test); + assert(test == "baa"); + } + + { + // Empty multiple blocks, part 6 - from middle non-empty block to middle empty block. + mtv_type db(6); + db.set(0, 1.0); + db.set(1, 2.0); + db.set(2, std::string("foo")); + db.set(3, std::string("baa")); + assert(!db.is_empty(0)); + assert(!db.is_empty(1)); + assert(!db.is_empty(2)); + assert(!db.is_empty(3)); + assert(db.is_empty(4)); + assert(db.is_empty(5)); + + db.set_empty(1, 4); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + assert(db.is_empty(5)); + double test; + db.get(0, test); + assert(test == 1.0); + assert(db.block_size() == 2); + } + + { + // Empty multiple blocks, part 7 - from middle empty block to middle empty block. + mtv_type db(6); + db.set(2, 1.0); + db.set(3, std::string("foo")); + assert(db.block_size() == 4); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(!db.is_empty(2)); + assert(!db.is_empty(3)); + assert(db.is_empty(4)); + assert(db.is_empty(5)); + + // This should set the whole range empty. + db.set_empty(1, 4); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + assert(db.is_empty(5)); + assert(db.block_size() == 1); + } + + { + // Set empty on 2nd block. Presence of first block causes an offset + // on index in the 2nd block. + mtv_type db(5); + db.set(0, 1.0); + db.set(1, static_cast<uint64_t>(1)); + db.set(2, static_cast<uint64_t>(2)); + db.set(3, static_cast<uint64_t>(3)); + db.set(4, static_cast<uint64_t>(4)); + + db.set_empty(2, 4); + assert(!db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + + db.set(2, static_cast<uint64_t>(5)); + db.set(3, static_cast<uint64_t>(6)); + db.set(4, static_cast<uint64_t>(7)); + db.set_empty(1, 2); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(!db.is_empty(3)); + assert(!db.is_empty(4)); + + db.set(3, static_cast<uint64_t>(8)); + db.set(4, static_cast<uint64_t>(9)); + db.set_empty(2, 3); + } + + { + // Set individual single elements empty. + cout << "Setting individual single elements empty..." << endl; + mtv_type db(15, 1.2); + cout << "setting 1 empty..." << endl; + db.set_empty(1, 1); + cout << "setting 4 empty..." << endl; + db.set_empty(4, 4); + cout << "setting 7 empty..." << endl; + db.set_empty(7, 7); + cout << "setting 10 empty..." << endl; + db.set_empty(10, 10); + cout << "setting 12 empty..." << endl; + db.set_empty(12, 12); + assert(!db.is_empty(0)); + assert(db.is_empty(1)); + assert(!db.is_empty(2)); + assert(!db.is_empty(3)); + assert(db.is_empty(4)); + assert(!db.is_empty(5)); + assert(!db.is_empty(6)); + assert(db.is_empty(7)); + assert(!db.is_empty(8)); + assert(!db.is_empty(9)); + assert(db.is_empty(10)); + assert(!db.is_empty(11)); + assert(db.is_empty(12)); + assert(!db.is_empty(13)); + assert(!db.is_empty(14)); + } + + { + mtv_type db(3, true); + assert(db.block_size() == 1); + db.set_empty(1, 1); + assert(db.get<bool>(0) == true); + assert(db.is_empty(1)); + assert(db.get<bool>(2) == true); + assert(db.block_size() == 3); + } + + { + mtv_type db(10); + assert(db.block_size() == 1); + + int16_t val = 12; + db.set(3, val); + assert(db.block_size() == 3); + assert(db.is_empty(2)); + assert(!db.is_empty(3)); + assert(db.is_empty(4)); + + db.set_empty(3, 3); // This should merge the top, middle and bottom blocks into one. + assert(db.block_size() == 1); + + db.set(9, val); + assert(db.block_size() == 2); + db.set_empty(9, 9); // Merge the block with the top one. + assert(db.block_size() == 1); + + db = mtv_type(10, true); + db.set(3, 1.1); + db.set(4, 1.2); + db.set(5, 1.3); + assert(db.block_size() == 3); + db.set_empty(3, 5); // No merging. + assert(db.block_size() == 3); + } + + { + mtv_type db(10); + db.set(0, 1.1); + assert(db.block_size() == 2); + db.set(1, 1.2); + assert(db.block_size() == 2); + db.set_empty(1, 1); // Merge with the next block. + assert(db.block_size() == 2); + db.set(1, 1.3); + + db = mtv_type(5); + db.set(3, 2.1); + db.set(4, 2.2); + assert(db.block_size() == 2); + db.set_empty(3, 3); // Merge with the previous block. + assert(db.block_size() == 2); + } + + { + mtv_type db(7); + db.set(0, 1.2); + db.set(2, true); + db.set(4, true); + db.set(5, static_cast<int32_t>(22)); + db.set(6, std::string("foo")); + assert(db.block_size() == 7); + db.set_empty(2, 4); // Merge with the previous block. + assert(db.block_size() == 4); + assert(db.get<double>(0) == 1.2); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.is_empty(4)); + assert(db.get<int32_t>(5) == 22); + assert(db.get<std::string>(6) == "foo"); + } + + { + mtv_type db(4); + db.set(0, true); + db.set(2, true); + assert(db.block_size() == 4); + db.set_empty(0, 2); // Merge with the next block. + cout << "block size: " << db.block_size() << endl; + assert(db.block_size() == 1); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/erase.inl b/test/multi_type_vector/default/tc/erase.inl new file mode 100644 index 0000000..15828c3 --- /dev/null +++ b/test/multi_type_vector/default/tc/erase.inl @@ -0,0 +1,360 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_erase() +{ + stack_printer __stack_printer__(__FUNCTION__); + { + // Single empty block. + mtv_type db(5); + db.erase(0, 2); // erase rows 0-2. + assert(db.size() == 2); + db.erase(0, 1); + assert(db.size() == 0); + assert(db.empty()); + } + + { + // Single empty block followed by a non-empty block. + mtv_type db(5); + db.push_back<int32_t>(-234); + + db.erase(0, 2); // erase rows 0-2. + assert(db.size() == 3); + db.erase(0, 1); + assert(db.size() == 1); + } + + { + // Single non-empty block. + mtv_type db(5); + for (long i = 0; i < 5; ++i) + db.set(i, static_cast<double>(i + 1)); + + assert(db.block_size() == 1); + assert(db.size() == 5); + + db.erase(0, 2); // erase rows 0-2 + assert(db.size() == 2); + double test; + db.get(0, test); + assert(test == 4.0); + db.get(1, test); + assert(test == 5.0); + + db.erase(0, 1); + assert(db.size() == 0); + assert(db.empty()); + } + + { + // Two blocks - non-empty to empty blocks. + mtv_type db(8); + for (long i = 0; i < 4; ++i) + db.set(i, static_cast<double>(i + 1)); + + assert(db.block_size() == 2); + assert(db.size() == 8); + assert(!db.is_empty(3)); + assert(db.is_empty(4)); + + // Erase across two blocks. + db.erase(3, 6); // 4 cells + assert(db.block_size() == 2); + assert(db.size() == 4); + + // Check the integrity of the data. + double test; + db.get(2, test); + assert(test == 3.0); + assert(db.is_empty(3)); + + // Empty it. + db.erase(0, 3); + assert(db.block_size() == 0); + assert(db.size() == 0); + assert(db.empty()); + } + + { + // Two blocks - non-empty to non-empty blocks. + mtv_type db(8); + for (long i = 0; i < 4; ++i) + db.set(i, static_cast<double>(i + 1)); + + for (long i = 4; i < 8; ++i) + db.set(i, static_cast<uint64_t>(i + 1)); + + assert(db.block_size() == 2); + assert(db.size() == 8); + + // Erase across two blocks. + db.erase(3, 6); // 4 cells + assert(db.block_size() == 2); + assert(db.size() == 4); + + // Check the integrity of the data. + double test; + db.get(2, test); + assert(test == 3.0); + + uint64_t test2; + db.get(3, test2); + assert(test2 == 8); + + // Empty it. + db.erase(0, 3); + assert(db.block_size() == 0); + assert(db.size() == 0); + assert(db.empty()); + } + + { + // 3 blocks, all non-empty. + mtv_type db(9); + for (long i = 0; i < 3; ++i) + db.set(i, static_cast<double>(i + 1)); + + for (long i = 3; i < 6; ++i) + db.set(i, static_cast<uint64_t>(i + 1)); + + for (long i = 6; i < 9; ++i) + { + std::ostringstream os; + os << i + 1; + db.set(i, os.str()); + } + + assert(db.block_size() == 3); + assert(db.size() == 9); + + db.erase(2, 7); + assert(db.block_size() == 2); + assert(db.size() == 3); + + // Check the integrity of the data. + double test1; + db.get(1, test1); + assert(test1 == 2.0); + std::string test2; + db.get(2, test2); + assert(test2 == "9"); + + db.erase(2, 2); // Erase only one-block. + assert(db.block_size() == 1); + assert(db.size() == 2); + test1 = -1.0; + db.get(1, test1); + assert(test1 == 2.0); + + db.erase(0, 1); + assert(db.size() == 0); + assert(db.empty()); + } + + { + // erase() to merge two blocks. + mtv_type db(4); + db.set(0, 1.1); + db.set(1, std::string("foo")); + db.set(2, static_cast<uint64_t>(2)); + db.set(3, std::string("baa")); + assert(db.block_size() == 4); + assert(db.size() == 4); + + db.erase(2, 2); + assert(db.block_size() == 2); + assert(db.size() == 3); + + // Try again, but this time merge two empty blocks. + db.resize(4); + db.set_empty(1, 3); + db.set(2, static_cast<uint64_t>(10)); + assert(db.get<double>(0) == 1.1); + assert(db.is_empty(1)); + assert(db.get<uint64_t>(2) == 10); + assert(db.is_empty(3)); + + db.erase(2, 2); + assert(db.block_size() == 2); + assert(db.size() == 3); + assert(db.get<double>(0) == 1.1); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + } + + { + mtv_type db(6); + db.set(0, 1.0); + db.set(1, 2.0); + db.set(2, std::string("A")); + db.set(3, std::string("B")); + db.set(4, 5.0); + db.set(5, 6.0); + assert(db.block_size() == 3); + assert(db.size() == 6); + assert(db.get<double>(0) == 1.0); + assert(db.get<double>(1) == 2.0); + assert(db.get<std::string>(2) == "A"); + assert(db.get<std::string>(3) == "B"); + assert(db.get<double>(4) == 5.0); + assert(db.get<double>(5) == 6.0); + db.erase(1, 4); + assert(db.block_size() == 1); + assert(db.size() == 2); + assert(db.get<double>(0) == 1.0); + assert(db.get<double>(1) == 6.0); + } + + { + mtv_type db(6); + db.set(0, 1.0); + db.set<int8_t>(4, 2); + db.set<int16_t>(5, 3); + db.erase(1, 3); + } + + { + mtv_type db; + + for (int i = 0; i < 3; ++i) + db.push_back<double>(1.0); + + for (int i = 0; i < 3; ++i) + db.push_back<int16_t>(3); + + for (int i = 0; i < 3; ++i) + db.push_back<int32_t>(9); + + db.erase(1, 3); + assert(db.block_size() == 3); + assert(db.size() == 6); + } + + { + mtv_type db; + + for (int i = 0; i < 3; ++i) + db.push_back<double>(1.0); + + for (int i = 0; i < 3; ++i) + db.push_back<int16_t>(3); + + for (int i = 0; i < 3; ++i) + db.push_back<double>(9); + + for (int i = 0; i < 3; ++i) + db.push_back<int32_t>(9); + + db.erase(1, 5); + assert(db.block_size() == 2); + assert(db.size() == 7); + } + + { + mtv_type db; + + for (int i = 0; i < 3; ++i) + db.push_back<double>(1.0); + + for (int i = 0; i < 3; ++i) + db.push_back<int16_t>(3); + + for (int i = 0; i < 3; ++i) + db.push_back<double>(9); + + for (int i = 0; i < 3; ++i) + db.push_back<int32_t>(9); + + db.erase(3, 5); + assert(db.block_size() == 2); + assert(db.size() == 9); + } + + { + mtv_type db; + + for (int i = 0; i < 3; ++i) + db.push_back<double>(1.0); + + for (int i = 0; i < 3; ++i) + db.push_back<int16_t>(3); + + for (int i = 0; i < 3; ++i) + db.push_back_empty(); + + for (int i = 0; i < 3; ++i) + db.push_back<int32_t>(9); + + db.erase(3, 5); + assert(db.block_size() == 3); + assert(db.size() == 9); + } + + { + mtv_type db; + + for (int i = 0; i < 3; ++i) + db.push_back_empty(); + + for (int i = 0; i < 3; ++i) + db.push_back<int16_t>(3); + + for (int i = 0; i < 3; ++i) + db.push_back<double>(1.23); + + for (int i = 0; i < 3; ++i) + db.push_back<int32_t>(9); + + db.erase(3, 5); + assert(db.block_size() == 3); + assert(db.size() == 9); + } + + { + mtv_type db; + + for (int i = 0; i < 3; ++i) + db.push_back_empty(); + + for (int i = 0; i < 3; ++i) + db.push_back<int16_t>(3); + + for (int i = 0; i < 3; ++i) + db.push_back_empty(); + + for (int i = 0; i < 3; ++i) + db.push_back<int32_t>(9); + + db.erase(3, 5); + assert(db.block_size() == 2); + assert(db.size() == 9); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/hints.inl b/test/multi_type_vector/default/tc/hints.inl new file mode 100644 index 0000000..5cf4b10 --- /dev/null +++ b/test/multi_type_vector/default/tc/hints.inl @@ -0,0 +1,186 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_hints_set() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(3); + db.set(db.begin(), 0, 23.4); + assert(db.get<double>(0) == 23.4); + db.set(db.end(), 0, std::string("test")); // passing end position should have no impact. + assert(db.get<std::string>(0) == "test"); + + mtv_type::iterator pos_hint = db.set(0, 1.2); + pos_hint = db.set(pos_hint, 1, 1.3); + pos_hint = db.set(pos_hint, 2, 1.4); + assert(db.get<double>(0) == 1.2); + assert(db.get<double>(1) == 1.3); + assert(db.get<double>(2) == 1.4); + + pos_hint = db.begin(); + pos_hint = db.set(pos_hint, 0, false); + pos_hint = db.set(pos_hint, 1, std::string("foo")); + pos_hint = db.set(pos_hint, 2, 34.5); + assert(db.get<bool>(0) == false); + assert(db.get<std::string>(1) == "foo"); + assert(db.get<double>(2) == 34.5); + + db.set(pos_hint, 0, int32_t(444)); // position hint does not precede the insertion position. + assert(db.get<int32_t>(0) == 444); // it should still work. +} + +void mtv_test_hints_set_cells() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(9); + + std::vector<int32_t> ints; + ints.push_back(1); + ints.push_back(2); + ints.push_back(3); + + std::vector<double> doubles; + doubles.push_back(1.1); + doubles.push_back(1.2); + doubles.push_back(1.3); + + std::vector<std::string> strings; + strings.push_back(std::string("A")); + strings.push_back(std::string("B")); + strings.push_back(std::string("C")); + + mtv_type::iterator pos_hint = db.begin(); + pos_hint = db.set(pos_hint, 0, ints.begin(), ints.end()); + pos_hint = db.set(pos_hint, 3, doubles.begin(), doubles.end()); + pos_hint = db.set(pos_hint, 6, strings.begin(), strings.end()); + + assert(db.get<int32_t>(0) == 1); + assert(db.get<int32_t>(1) == 2); + assert(db.get<int32_t>(2) == 3); + + assert(db.get<double>(3) == 1.1); + assert(db.get<double>(4) == 1.2); + assert(db.get<double>(5) == 1.3); + + assert(db.get<std::string>(6) == "A"); + assert(db.get<std::string>(7) == "B"); + assert(db.get<std::string>(8) == "C"); +} + +void mtv_test_hints_insert_cells() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_type db(1, true); // We need to have at least one element to be able to insert. + + std::vector<int32_t> ints; + ints.push_back(11); + ints.push_back(22); + + std::vector<double> doubles; + doubles.push_back(2.1); + doubles.push_back(3.2); + doubles.push_back(4.3); + + std::vector<std::string> strings; + strings.push_back(std::string("Andy")); + strings.push_back(std::string("Bruce")); + strings.push_back(std::string("Charlie")); + strings.push_back(std::string("David")); + + mtv_type::iterator pos_hint = db.insert(0, ints.begin(), ints.end()); + assert(db.get<int32_t>(0) == 11); + assert(db.get<int32_t>(1) == 22); + assert(db.get<bool>(2) == true); + + pos_hint = db.insert(pos_hint, 2, doubles.begin(), doubles.end()); + assert(db.get<int32_t>(0) == 11); + assert(db.get<int32_t>(1) == 22); + assert(db.get<double>(2) == 2.1); + assert(db.get<double>(3) == 3.2); + assert(db.get<double>(4) == 4.3); + assert(db.get<bool>(5) == true); + + pos_hint = db.insert(pos_hint, 4, strings.begin(), strings.end()); + assert(db.get<int32_t>(0) == 11); + assert(db.get<int32_t>(1) == 22); + assert(db.get<double>(2) == 2.1); + assert(db.get<double>(3) == 3.2); + assert(db.get<std::string>(4) == "Andy"); + assert(db.get<std::string>(5) == "Bruce"); + assert(db.get<std::string>(6) == "Charlie"); + assert(db.get<std::string>(7) == "David"); + assert(db.get<double>(8) == 4.3); + assert(db.get<bool>(9) == true); +} + +void mtv_test_hints_set_empty() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(20, true); + mtv_type::iterator pos_hint = db.set_empty(db.begin(), 2, 3); + pos_hint = db.set_empty(pos_hint, 5, 7); + pos_hint = db.set_empty(pos_hint, 9, 12); + pos_hint = db.set_empty(pos_hint, 14, 17); + + // Check the boundaries. + assert(!db.is_empty(0)); + assert(!db.is_empty(4)); + assert(db.is_empty(5)); + assert(db.is_empty(7)); + assert(!db.is_empty(8)); + assert(db.is_empty(9)); + assert(db.is_empty(12)); + assert(!db.is_empty(13)); + assert(db.is_empty(14)); + assert(db.is_empty(17)); + assert(!db.is_empty(18)); +} + +void mtv_test_hints_insert_empty() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(2, true); + mtv_type::iterator pos_hint = db.begin(); + pos_hint = db.insert_empty(pos_hint, 1, 3); // the size becomes 5. + pos_hint = db.insert_empty(pos_hint, 4, 2); // the size now becomes 7. + + mtv_type::iterator check = db.begin(); + assert(check->type == mdds::mtv::element_type_boolean); + assert(check->size == 1); + ++check; + assert(check->type == mdds::mtv::element_type_empty); + assert(check->size == 5); + ++check; + assert(check->type == mdds::mtv::element_type_boolean); + assert(check->size == 1); + ++check; + assert(check == db.end()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/insert.inl b/test/multi_type_vector/default/tc/insert.inl new file mode 100644 index 0000000..eb632fe --- /dev/null +++ b/test/multi_type_vector/default/tc/insert.inl @@ -0,0 +1,375 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_insert_empty() +{ + stack_printer __stack_printer__(__FUNCTION__); + { + mtv_type db(5); + db.insert_empty(0, 5); + assert(db.size() == 10); + assert(db.block_size() == 1); + + // Insert data from row 0 to 4. + for (long i = 0; i < 5; ++i) + db.set(i, static_cast<double>(i + 1)); + + assert(db.block_size() == 2); + assert(db.size() == 10); + + // Now, insert an empty block of size 2 at the top. + db.insert_empty(0, 2); + assert(db.block_size() == 3); + assert(db.size() == 12); + + double test; + db.get(2, test); + assert(test == 1.0); + + // Insert an empty cell into an empty block. This should shift the + // data block down by one. + db.insert_empty(1, 1); + assert(db.block_size() == 3); + assert(db.size() == 13); + db.get(4, test); + assert(test == 2.0); + } + + { + mtv_type db(5); + for (long i = 0; i < 5; ++i) + db.set(i, static_cast<double>(i + 1)); + + assert(db.block_size() == 1); + assert(db.size() == 5); + + // Insert an empty block into the middle of a non-empty block. + db.insert_empty(2, 2); + + assert(db.block_size() == 3); + assert(db.size() == 7); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + + double test; + db.get(0, test); + assert(test == 1.0); + db.get(1, test); + assert(test == 2.0); + + db.get(4, test); + assert(test == 3.0); + db.get(5, test); + assert(test == 4.0); + db.get(6, test); + assert(test == 5.0); + } + + { + mtv_type db(1); + db.set(0, 2.5); + db.insert_empty(0, 2); + assert(db.block_size() == 2); + assert(db.size() == 3); + assert(db.is_empty(1)); + assert(!db.is_empty(2)); + + double test; + db.get(2, test); + assert(test == 2.5); + } + + { + mtv_type db(2); + db.set(0, 1.2); + db.set(1, 2.3); + db.insert_empty(1, 1); + + assert(db.block_size() == 3); + assert(db.size() == 3); + double test; + db.get(0, test); + assert(test == 1.2); + db.get(2, test); + assert(test == 2.3); + } + + { + mtv_type db(2); + db.push_back<double>(12.0); + db.push_back<float>(13.0); + db.insert_empty(2, 2); + + assert(db.block_size() == 3); + assert(db.size() == 6); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.is_empty(2)); + assert(db.is_empty(3)); + assert(db.get<double>(4) == 12.0); + assert(db.get<float>(5) == 13.0); + } + + { + mtv_type db; + for (int32_t i = 0; i < 9; ++i) + db.push_back(i); + + db.push_back<int16_t>(123); + db.insert_empty(7, 3); + + assert(db.block_size() == 4); + assert(db.size() == 13); + } +} + +void mtv_test_insert_cells() +{ + stack_printer __stack_printer__(__FUNCTION__); + { + // Insert into non-empty block of the same type. + mtv_type db(1); + db.set(0, 1.1); + assert(db.block_size() == 1); + assert(db.size() == 1); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.insert(0, p, p + 3); + assert(db.block_size() == 1); + assert(db.size() == 4); + assert(db.get<double>(0) == 2.1); + assert(db.get<double>(1) == 2.2); + assert(db.get<double>(2) == 2.3); + assert(db.get<double>(3) == 1.1); + } + + { + // Insert into an existing empty block. + mtv_type db(1); + assert(db.block_size() == 1); + assert(db.size() == 1); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.insert(0, p, p + 3); + assert(db.block_size() == 2); + assert(db.size() == 4); + assert(db.get<double>(0) == 2.1); + assert(db.get<double>(1) == 2.2); + assert(db.get<double>(2) == 2.3); + assert(db.is_empty(3)); + } + + { + mtv_type db(2); + db.set(0, 1.1); + assert(db.block_size() == 2); + assert(db.size() == 2); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.insert(1, p, p + 3); + assert(db.block_size() == 2); + assert(db.size() == 5); + assert(db.get<double>(0) == 1.1); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 2.3); + assert(db.is_empty(4)); + } + + { + mtv_type db(2); + db.set(0, static_cast<uint64_t>(23)); + assert(db.block_size() == 2); + assert(db.size() == 2); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.insert(1, p, p + 3); + assert(db.block_size() == 3); + assert(db.size() == 5); + assert(db.get<uint64_t>(0) == 23); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 2.3); + assert(db.is_empty(4)); + } + + { + mtv_type db(2); + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.insert(1, p, p + 3); + assert(db.block_size() == 3); + assert(db.size() == 5); + assert(db.is_empty(0)); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 2.3); + assert(db.is_empty(4)); + } + + { + mtv_type db(2); + db.set(0, 1.1); + db.set(1, static_cast<uint64_t>(23)); + assert(db.block_size() == 2); + assert(db.size() == 2); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.insert(1, p, p + 3); + assert(db.block_size() == 2); + assert(db.size() == 5); + assert(db.get<double>(0) == 1.1); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 2.3); + assert(db.get<uint64_t>(4) == 23); + } + + { + mtv_type db(2); + db.set(0, true); + db.set(1, static_cast<uint64_t>(23)); + assert(db.block_size() == 2); + assert(db.size() == 2); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.insert(1, p, p + 3); + assert(db.block_size() == 3); + assert(db.size() == 5); + assert(db.get<bool>(0) == true); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 2.3); + assert(db.get<uint64_t>(4) == 23); + } + + { + mtv_type db(2); + db.set(0, static_cast<uint64_t>(12)); + db.set(1, static_cast<uint64_t>(23)); + assert(db.block_size() == 1); + assert(db.size() == 2); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.insert(1, p, p + 3); + assert(db.block_size() == 3); + assert(db.size() == 5); + assert(db.get<uint64_t>(0) == 12); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 2.3); + assert(db.get<uint64_t>(4) == 23); + } + + { + mtv_type db(3); + db.set(0, 1.0); + db.set(1, std::string("foo")); + db.set(2, std::string("baa")); + assert(db.size() == 3); + assert(db.block_size() == 2); + double vals[] = {2.1}; + const double* p = &vals[0]; + db.insert(2, p, p + 1); + assert(db.size() == 4); + assert(db.block_size() == 4); + } + + { + mtv_type db(2); + db.set(0, static_cast<uint64_t>(11)); + db.set(1, static_cast<uint64_t>(12)); + double vals[] = {1.2}; + const double* p = &vals[0]; + db.insert(1, p, p + 1); + assert(db.block_size() == 3); + + // Append value to the top block. + uint64_t vals2[] = {22}; + const uint64_t* p2 = &vals2[0]; + db.insert(1, p2, p2 + 1); + assert(db.block_size() == 3); + assert(db.get<uint64_t>(0) == 11); + assert(db.get<uint64_t>(1) == 22); + assert(db.get<double>(2) == 1.2); + assert(db.get<uint64_t>(3) == 12); + } + + { + mtv_type db(5); + db.push_back<double>(1.1); + db.push_back<double>(1.2); + + double vals[] = {2.1, 2.2, 2.3}; + const double* p = vals; + db.insert(2, p, p + 3); + assert(db.block_size() == 4); + assert(db.size() == 10); + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.get<double>(2) == 2.1); + assert(db.get<double>(3) == 2.2); + assert(db.get<double>(4) == 2.3); + assert(db.is_empty(5)); + assert(db.is_empty(6)); + assert(db.is_empty(7)); + assert(db.get<double>(8) == 1.1); + assert(db.get<double>(9) == 1.2); + } + + { + mtv_type db(5, int16_t(222)); + db.push_back<int32_t>(12); + db.push_back<int32_t>(34); + + int16_t vals[] = {5, 6, 7}; + const int16_t* p = vals; + db.insert(1, p, p + 3); + assert(db.block_size() == 2); + assert(db.size() == 10); + assert(db.get<int16_t>(0) == 222); + assert(db.get<int16_t>(1) == 5); + assert(db.get<int16_t>(2) == 6); + assert(db.get<int16_t>(3) == 7); + assert(db.get<int16_t>(4) == 222); + assert(db.get<int16_t>(5) == 222); + assert(db.get<int16_t>(6) == 222); + assert(db.get<int16_t>(7) == 222); + assert(db.get<int32_t>(8) == 12); + assert(db.get<int32_t>(9) == 34); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/iterators.inl b/test/multi_type_vector/default/tc/iterators.inl new file mode 100644 index 0000000..3418e8f --- /dev/null +++ b/test/multi_type_vector/default/tc/iterators.inl @@ -0,0 +1,363 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_iterators() +{ + stack_printer __stack_printer__(__FUNCTION__); + { + mtv_type db(5); + mtv_type::const_iterator it; + it = db.begin(); + mtv_type::const_iterator it_end = db.end(); + size_t len = std::distance(it, it_end); + assert(len == 1); + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 5); + const mtv_type::const_iterator::value_type& val = *it; + assert(val.type == it->type); + assert(val.size == it->size); + + ++it; + assert(it == it_end); + } + + { + mtv_type db(6); + db.set(0, 1.1); + db.set(1, 2.2); + db.set(4, std::string("boo")); + db.set(5, std::string("hoo")); + assert(db.block_size() == 3); + { + // Forward iterator + mtv_type::const_iterator it = db.begin(), it_end = db.end(); + size_t len = std::distance(it, it_end); + assert(len == 3); + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 2); + + ++it; + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 2); + + ++it; + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 2); + + ++it; + assert(it == it_end); + } + + { + // Reverse iterator + mtv_type::const_reverse_iterator it = db.rbegin(), it_end = db.rend(); + size_t len = std::distance(it, it_end); + assert(len == 3); + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 2); + + ++it; + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 2); + + ++it; + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 2); + + ++it; + assert(it == it_end); + } + + { + // Reverse iterator (C++11) + mtv_type::const_reverse_iterator it = db.crbegin(), it_end = db.crend(); + size_t len = std::distance(it, it_end); + assert(len == 3); + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 2); + + ++it; + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 2); + + ++it; + assert(it != it_end); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 2); + + ++it; + assert(it == it_end); + } + } + + { + // Make sure that decrementing the iterator calculates the position correctly. + mtv_type db(10); + db.set(0, true); + mtv_type::const_iterator it = db.begin(); + assert(it->position == 0); + assert(it->size == 1); + ++it; + assert(it->position == 1); + assert(it->size == 9); + --it; + assert(it->position == 0); + assert(it->size == 1); + assert(it == db.begin()); + } +} + +void mtv_test_iterators_element_block() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_type db(10); + db.set(0, 1.1); + db.set(1, 1.2); + db.set(2, 1.3); + db.set(4, std::string("A")); + db.set(5, std::string("B")); + db.set(6, std::string("C")); + db.set(7, std::string("D")); + mtv_type::const_iterator it_blk = db.begin(), it_blk_end = db.end(); + + // First block is a numeric block. + assert(it_blk != it_blk_end); + assert(it_blk->type == mdds::mtv::element_type_double); + assert(it_blk->size == 3); + assert(it_blk->data); + { + mdds::mtv::double_element_block::const_iterator it_data = mdds::mtv::double_element_block::begin(*it_blk->data); + mdds::mtv::double_element_block::const_iterator it_data_end = + mdds::mtv::double_element_block::end(*it_blk->data); + assert(it_data != it_data_end); + assert(*it_data == 1.1); + ++it_data; + assert(*it_data == 1.2); + ++it_data; + assert(*it_data == 1.3); + ++it_data; + assert(it_data == it_data_end); + + assert(mdds::mtv::double_element_block::at(*it_blk->data, 0) == 1.1); + assert(mdds::mtv::double_element_block::at(*it_blk->data, 1) == 1.2); + assert(mdds::mtv::double_element_block::at(*it_blk->data, 2) == 1.3); + + // Access the underlying data array directly. + const double* array = &mdds::mtv::double_element_block::at(*it_blk->data, 0); + assert(*array == 1.1); + ++array; + assert(*array == 1.2); + ++array; + assert(*array == 1.3); + } + + // Next block is empty. + ++it_blk; + assert(it_blk->type == mdds::mtv::element_type_empty); + assert(it_blk->size == 1); + assert(it_blk->data == nullptr); + + // Next block is a string block. + ++it_blk; + assert(it_blk->type == mdds::mtv::element_type_string); + assert(it_blk->size == 4); + assert(it_blk->data); + { + mdds::mtv::string_element_block::const_reverse_iterator it_data = + mdds::mtv::string_element_block::rbegin(*it_blk->data); + mdds::mtv::string_element_block::const_reverse_iterator it_data_end = + mdds::mtv::string_element_block::rend(*it_blk->data); + assert(it_data != it_data_end); + assert(*it_data == "D"); + ++it_data; + assert(*it_data == "C"); + ++it_data; + assert(*it_data == "B"); + ++it_data; + assert(*it_data == "A"); + ++it_data; + assert(it_data == it_data_end); + } + + { + // Test crbegin() and crend() too, which should be identical to the + // const variants of rbegin() and rend() from above. + mdds::mtv::string_element_block::const_reverse_iterator it_data = + mdds::mtv::string_element_block::crbegin(*it_blk->data); + mdds::mtv::string_element_block::const_reverse_iterator it_data_end = + mdds::mtv::string_element_block::crend(*it_blk->data); + assert(it_data != it_data_end); + assert(*it_data == "D"); + ++it_data; + assert(*it_data == "C"); + ++it_data; + assert(*it_data == "B"); + ++it_data; + assert(*it_data == "A"); + ++it_data; + assert(it_data == it_data_end); + } + + // Another empty block follows. + ++it_blk; + assert(it_blk->type == mdds::mtv::element_type_empty); + assert(it_blk->size == 2); + assert(it_blk->data == nullptr); + + ++it_blk; + assert(it_blk == it_blk_end); +} + +void mtv_test_iterators_mutable_element_block() +{ + stack_printer __stack_printer__(__FUNCTION__); + + /** + * This function is just to ensure that even the non-const iterator can be + * dereferenced via const reference. + * + * @param it this is passed as a const reference, yet it should still allow + * being dereferenced as long as no data is modified. + */ + auto check_block_iterator = [](const mtv_type::iterator& it, mdds::mtv::element_t expected) { + mdds::mtv::element_t actual = it->type; + const mtv_type::element_block_type* data = (*it).data; + assert(actual == expected); + assert(data != nullptr); + }; + + mtv_type db(1); + db.set(0, 1.2); + mtv_type::iterator it_blk = db.begin(), it_blk_end = db.end(); + size_t n = std::distance(it_blk, it_blk_end); + assert(n == 1); + check_block_iterator(it_blk, mdds::mtv::element_type_double); + + mdds::mtv::double_element_block::iterator it = mdds::mtv::double_element_block::begin(*it_blk->data); + mdds::mtv::double_element_block::iterator it_end = mdds::mtv::double_element_block::end(*it_blk->data); + n = std::distance(it, it_end); + assert(n == 1); + assert(*it == 1.2); + + *it = 2.3; // write via iterator. + assert(db.get<double>(0) == 2.3); + + db.resize(3); + db.set(1, 2.4); + db.set(2, 2.5); + + it_blk = db.begin(); + it_blk_end = db.end(); + n = std::distance(it_blk, it_blk_end); + assert(n == 1); + check_block_iterator(it_blk, mdds::mtv::element_type_double); + + it = mdds::mtv::double_element_block::begin(*it_blk->data); + it_end = mdds::mtv::double_element_block::end(*it_blk->data); + n = std::distance(it, it_end); + assert(n == 3); + *it = 3.1; + ++it; + *it = 3.2; + ++it; + *it = 3.3; + + assert(db.get<double>(0) == 3.1); + assert(db.get<double>(1) == 3.2); + assert(db.get<double>(2) == 3.3); +} + +void mtv_test_iterators_private_data() +{ + stack_printer __stack_printer__(__FUNCTION__); + + // What the end position iterator stores in the private data area is + // intentionally undefined. + + mtv_type db(9); + + // With only a single block + + mtv_type::iterator it = db.begin(); + assert(it->position == 0); + assert(it->__private_data.block_index == 0); + + it = db.end(); + --it; + assert(it->position == 0); + assert(it->__private_data.block_index == 0); + + // With 3 blocks (sizes of 4, 3, and 2 in this order) + + db.set(4, 1.1); + db.set(5, 1.1); + db.set(6, 1.1); + + it = db.begin(); + assert(it->size == 4); + assert(it->position == 0); + assert(it->__private_data.block_index == 0); + ++it; + assert(it->size == 3); + assert(it->position == 4); + assert(it->__private_data.block_index == 1); + ++it; + assert(it->size == 2); + assert(it->position == 7); + assert(it->__private_data.block_index == 2); + + ++it; + assert(it == db.end()); // end position reached. + + // Go in reverse direction. + --it; + assert(it->size == 2); + assert(it->position == 7); + assert(it->__private_data.block_index == 2); + --it; + assert(it->size == 3); + assert(it->position == 4); + assert(it->__private_data.block_index == 1); + --it; + assert(it->size == 4); + assert(it->position == 0); + assert(it->__private_data.block_index == 0); + assert(it == db.begin()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/iterators_insert.inl b/test/multi_type_vector/default/tc/iterators_insert.inl new file mode 100644 index 0000000..2a351b5 --- /dev/null +++ b/test/multi_type_vector/default/tc/iterators_insert.inl @@ -0,0 +1,232 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_iterators_insert() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type::iterator it, check; + std::vector<double> doubles; + std::vector<bool> bools; + std::vector<std::string> strings; + std::vector<int32_t> ints; + + // Insert values into empty block. They are to be appended to the previous block. + mtv_type db(10); // start with empty set. + db.set(0, std::string("top")); + db.set(3, 0.9); + doubles.resize(4, 1.1); + it = db.insert(4, doubles.begin(), doubles.end()); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + assert(it->size == 5); + assert(it->position == 3); + ++it; + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 6); + ++it; + assert(it == db.end()); + + // Same as above, except that the values will not be appended to the previous block. + db = mtv_type(3); + db.set(0, std::string("top")); + doubles.resize(5, 3.3); + it = db.insert(1, doubles.begin(), doubles.end()); + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 2); + ++it; + assert(it == db.end()); + + // Insert into the middle of an empty block. + db = mtv_type(2); + doubles.resize(3, 1.2); + it = db.insert(1, doubles.begin(), doubles.end()); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_empty); + assert(check->size == 1); + ++check; + assert(check == it); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 3); + ++it; + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 1); + ++it; + assert(it == db.end()); + + // Insert into a block of the same type. + db = mtv_type(5, false); + db.set(0, std::string("top")); + db.set(4, std::string("bottom")); + bools.resize(3, true); + it = db.insert(2, bools.begin(), bools.end()); + check = db.begin(); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->size == 6); + std::advance(it, 2); + assert(it == db.end()); + + // Insert values which will be append to the previous block. + db = mtv_type(5, 1.1); + strings.resize(3, std::string("test")); + db.set(0, true); + db.set(2, strings.begin(), strings.end()); // 2 thru 4 + doubles.resize(2, 2.2); + it = db.insert(2, doubles.begin(), doubles.end()); + check = db.begin(); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 3); + ++it; + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 3); + ++it; + assert(it == db.end()); + + // Insert between blocks without merge. + db = mtv_type(3); + db.set(0, 1.1); + db.set(1, std::string("middle")); + db.set(2, int32_t(50)); + bools.resize(4, true); + it = db.insert(1, bools.begin(), bools.end()); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_double); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->size == 4); + ++it; + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 1); + ++it; + assert(it->type == mdds::mtv::element_type_int32); + assert(it->size == 1); + ++it; + assert(it == db.end()); + + // Insert values of differing type into middle of a block. + db = mtv_type(4, 0.01); + db.set(0, std::string("top")); + ints.resize(3, 55); + it = db.insert(2, ints.begin(), ints.end()); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_string); + assert(check->size == 1); + ++check; + assert(check->type == mdds::mtv::element_type_double); + assert(check->size == 1); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_int32); + assert(it->size == 3); + ++it; + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 2); + ++it; + assert(it == db.end()); +} + +void mtv_test_iterators_insert_empty() +{ + stack_printer __stack_printer__(__FUNCTION__); + + // Insert into an already empty spot. + mtv_type db(2); + db.set(1, 1.2); + mtv_type::iterator it = db.insert_empty(0, 3); + assert(it == db.begin()); + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 1); + ++it; + assert(it == db.end()); + + // Insert an empty range that will be tucked into the previous empty block. + db = mtv_type(4); + db.set(0, std::string("foo")); + db.set(2, 1.1); + db.set(3, 1.2); + it = db.insert_empty(2, 2); + mtv_type::iterator check = db.begin(); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 3); + ++it; + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 2); + ++it; + assert(it == db.end()); + + // Insert an empty range between non-empty blocks. + db = mtv_type(2, false); + db.set(0, 1.1); + it = db.insert_empty(1, 2); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_double); + assert(check->size == 1); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 2); + ++it; + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->size == 1); + ++it; + assert(it == db.end()); + + // Insert in the middle of a non-empty block. + db = mtv_type(3, std::string("foo")); + it = db.insert_empty(2, 4); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_string); + assert(check->size == 2); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 4); + ++it; + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 1); + ++it; + assert(it == db.end()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/iterators_set.inl b/test/multi_type_vector/default/tc/iterators_set.inl new file mode 100644 index 0000000..08df963 --- /dev/null +++ b/test/multi_type_vector/default/tc/iterators_set.inl @@ -0,0 +1,889 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +/** + * Test the variant of set() method that takes iterators. + */ +void mtv_test_iterators_set() +{ + stack_printer __stack_printer__(__FUNCTION__); + + // single element only + mtv_type db(1); + mtv_type::iterator it = db.set(0, 1.1); + assert(it == db.begin()); + + // Set value to the top of the only block. + db.clear(); + db.resize(3); + it = db.set(0, 1.2); + assert(it == db.begin()); + + // Set value to the bottom of the only block. + db.clear(); + db.resize(3); + it = db.set(2, 1.3); + mtv_type::iterator check = db.begin(); + ++check; + assert(it == check); + check = db.end(); + --check; + assert(it == check); + + // Set value to the middle of the only block. + db.clear(); + db.resize(3); + it = db.set(1, 1.4); + check = db.begin(); + ++check; + assert(it == check); + check = db.end(); + std::advance(check, -2); + assert(it == check); + assert(it->position == 1); + assert(it->__private_data.block_index == 1); + + // Set value to the top empty block of size 1 followed by a non-empty block. + db.clear(); + db.resize(2); + db.set(1, 2.1); + it = db.set(0, 2.2); // same type as that of the following block. + assert(it == db.begin()); + assert(it->size == 2); + assert(it->position == 0); + assert(it->__private_data.block_index == 0); + db.set_empty(0, 0); + it = db.set(0, true); // different type from that of the following block. + assert(it == db.begin()); + assert(it->size == 1); + assert(it->position == 0); + assert(it->__private_data.block_index == 0); + + // Set value to the top of the top empty block (not size 1) followed by a non-empty block. + db.clear(); + db.resize(3); + db.set(2, true); + it = db.set(0, 5.1); + assert(it == db.begin()); + + // Set value to the bottom of the top empty block (not size 1) followed by a non-empty block. + db.clear(); + db.resize(3); + db.set(2, 6.1); + it = db.set(1, 6.2); // same type as that of the following block. + check = db.begin(); + ++check; + assert(it == check); + check = db.end(); + --check; + assert(it == check); + assert(it->size == 2); + assert(it->position == 1); + assert(it->__private_data.block_index == 1); + db.set_empty(0, 1); + it = db.set(1, true); // different type from that of the following block. + check = db.begin(); + ++check; + assert(it == check); + check = db.end(); + std::advance(check, -2); + assert(it == check); + assert(it->size == 1); + assert(it->position == 1); + assert(it->__private_data.block_index == 1); + + // Set value to the middle of the top empty block (not size 1) followed by a non-empty block. + db.clear(); + db.resize(6); + db.set(5, 1.1); + it = db.set(3, 1.2); + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 1); + assert(it->position == 3); + assert(it->__private_data.block_index == 1); + + // Set value to an empty block of size 1 immediately below a non-empty block. + db.clear(); + db.resize(2); + db.set(0, true); + it = db.set(1, false); // same type as that of the previous block. + assert(it == db.begin()); + + // Set value to an empty block of size 1 between non-empty blocks of the same type. + db = mtv_type(3, true); + db.set_empty(1, 1); + it = db.set(1, false); + assert(it == db.begin()); + assert(it->size == 3); + ++it; + assert(it == db.end()); + + // Set value to an empty block of size 1 between non-empty blocks. The + // previous block is of the same type as that of the inserted value. + db = mtv_type(3, 1.1); + db.set_empty(0, 1); + db.set(0, true); + it = db.set(1, false); + assert(it == db.begin()); + assert(it->size == 2); + std::advance(it, 2); + assert(it == db.end()); + + // Set value to the top of an empty block (not of size 1) following a + // non-empty block of the same type. + db.clear(); + db.resize(3); + db.set(0, true); + it = db.set(1, false); + assert(it == db.begin()); + assert(it->size == 2); + + // Set value to an empty block of size 1, following a non-empty block of different type. + db = mtv_type(2); + db.set(0, true); + it = db.set(1, 1.1); + ++it; + assert(it == db.end()); + + // Set value to an empty block of size 1, following a non-empty block of + // different type and followed by a non-empty block of different type. + db = mtv_type(3, true); + db.set_empty(1, 1); + it = db.set(1, 2.1); + std::advance(it, 2); + assert(it == db.end()); + + // Set value to an empty block of size 1, following a non-empty block of + // different type but followed by a non-empty block of the same type. + db.clear(); + db.resize(3); + db.set(0, true); + it = db.set(2, 2.1); + ++it; + assert(it == db.end()); + it = db.set(1, 2.2); // same type as that of the following block. + assert(it->size == 2); + ++it; + assert(it == db.end()); + + // Set value to the top of an empty block (not of size 1) between + // non-empty blocks. The previous block is of different type. + db.clear(); + db.resize(4); + db.set(0, true); + db.set(3, false); + it = db.set(1, 2.2); + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 1); + assert(it->position == 1); + + // Set value to the bottom of an empty block (not of size 1) between + // non-empty blocks. + db = mtv_type(7, false); + db.set_empty(2, 4); + it = db.set(4, true); // Same type as that of the following block. + assert(it->size == 3); + assert(it->position == 4); + assert(it->__private_data.block_index == 2); + ++it; + assert(it == db.end()); + + db.set_empty(2, 4); + it = db.set(4, 1.1); // Different type from that of the following block. + assert(it->size == 1); + assert(it->position == 4); + assert(it->__private_data.block_index == 2); + std::advance(it, 2); + assert(it == db.end()); + + // Set value to the middle of an empty block between non-empty blocks. + db = mtv_type(12, true); + db.set_empty(3, 7); + it = db.set(5, 4.3); + assert(it->size == 1); + check = db.begin(); + std::advance(check, 2); + assert(check == it); + ++it; + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + // Set value to existing block of the same type. + it = db.set(5, 4.5); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + assert(it->size == 1); + std::advance(it, 3); + assert(it == db.end()); + + // Set value to the top of an existing topmost block of different type. + db = mtv_type(5, true); + it = db.set(0, 1.1); + assert(it == db.begin()); + std::advance(it, 2); + assert(it == db.end()); + + // Set value to the top of an existing block of different type. The block + // is below an empty block. + db = mtv_type(10, true); + db.set_empty(0, 4); + it = db.set(5, 2.1); + check = db.begin(); + ++check; + assert(it == check); + std::advance(it, 2); + assert(it == db.end()); + + // Set value to the top of an existing block of different type. The block + // is below a non-empty block. + db = mtv_type(10, true); + std::vector<double> doubles(3, 1.1); + db.set(2, doubles.begin(), doubles.end()); // set double's to 2 thru 4. + it = db.set(5, 2.1); // append to the previous block. + check = db.begin(); + ++check; + assert(it == check); + ++it; + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + db = mtv_type(10, true); + db.set(2, doubles.begin(), doubles.end()); // set double's to 2 thru 4. + it = db.set(5, std::string("foo")); // type different from that of the previous block. + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + std::advance(it, 2); + assert(it == db.end()); + + // Set value to the middle of an existing non-empty block. + db = mtv_type(10, true); + doubles.clear(); + doubles.resize(3, 2.3); + db.set(0, doubles.begin(), doubles.end()); // set double's to 0 thru 2. + it = db.set(6, std::string("text")); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + assert(it->position == 6); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + ++it; + assert(it->size == 3); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + // Set value to the bottom of the only block that's non-empty. + db = mtv_type(10, false); + it = db.set(9, 2.1); + check = db.begin(); + ++check; + assert(it == check); + ++it; + assert(it == db.end()); + + // Set value to the bottom of the topmost non-empty block which is + // followed by an empty block. + db = mtv_type(10, false); + db.set_empty(5, 9); + it = db.set(4, 1.1); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); + assert(it->position == 4); + check = db.begin(); + ++check; + assert(it == check); + ++it; + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db.end()); + + // This time the following block is not empty but is of different type + // than that of the value being set. + db = mtv_type(10, false); + doubles.clear(); + doubles.resize(5, 2.1); + db.set(5, doubles.begin(), doubles.end()); // numeric at 5 thru 9 + it = db.set(4, std::string("foo")); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + check = db.begin(); + ++check; + assert(it == check); + ++it; + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it == db.end()); + + // Same as before, but the value being set is of the same type as that of + // the following block. + db = mtv_type(10, false); + doubles.clear(); + doubles.resize(5, 2.1); + db.set(5, doubles.begin(), doubles.end()); // numeric at 5 thru 9 + it = db.set(4, 4.5); // same type as the following block. + assert(it->size == 6); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it == db.end()); + + // Set value to the bottom of the last non-empty block. + db = mtv_type(10, false); + doubles.clear(); + doubles.resize(4, 3.1); + db.set(6, doubles.begin(), doubles.end()); // numeric at 6 thru 9 + it = db.set(9, true); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + // Set value to the bottom of an non-empty block followed by an empty block. + db = mtv_type(10, false); + doubles.clear(); + doubles.resize(3, 3.3); + db.set(2, doubles.begin(), doubles.end()); // numeric at 2 thru 4. + db.set_empty(5, 9); + it = db.set(4, std::string("foo")); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + assert(it->position == 4); + assert(it->__private_data.block_index == 2); + ++it; + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db.end()); + + // Same as before, except the following block isn't empty but of different type. + db = mtv_type(10, false); + db.set(4, doubles.begin(), doubles.end()); // numeric at 4 thru 6. + it = db.set(6, std::string("foo")); // 7 thru 9 is boolean. + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + assert(it->position == 6); + assert(it->__private_data.block_index == 2); + ++it; + assert(it->size == 3); + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->position == 7); + ++it; + assert(it == db.end()); + + // Same as before, except the following block is now of the same type. + db = mtv_type(10, false); + db.set(4, doubles.begin(), doubles.end()); // numeric at 4 thru 6. + it = db.set(6, true); // 7 thru 9 is boolean. + + // Set value to the only block (non-empty) of size 1. + db = mtv_type(1, true); + it = db.set(0, 1.1); + assert(it == db.begin()); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); + + // Set value to the topmost non-empty block of size 1, followed by an empty block. + db.resize(5); + it = db.set(0, std::string("foo")); + assert(it == db.begin()); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + ++it; + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db.end()); + + // Set value to the topmost non-empty block of size 1, followed by a non-empty block. + db = mtv_type(5, true); + db.set(0, 1.1); + it = db.set(0, std::string("foo")); + assert(it == db.begin()); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + ++it; + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + // This time set value whose type is the same as that of the following block. + it = db.set(0, false); + assert(it == db.begin()); + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + // Set value to the topmost non-empty block of size 1, preceded by an empty block. + db = mtv_type(5); + db.set(4, true); + it = db.set(4, 1.2); + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it == db.end()); + + // This time the preceding block is not empty, but of different type. + db = mtv_type(5, false); + db.set(0, std::string("baa")); + db.set(4, std::string("foo")); + it = db.set(4, 1.2); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it == db.end()); + + it = db.set(4, true); // Now set value whose type is the same as that of the preceding block. + check = db.end(); + --check; + assert(it == check); + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_boolean); + --it; + assert(it == db.begin()); + + // Set value to a non-empty block of size 1 that lies between existing blocks. + db = mtv_type(10); + db.set(7, true); + it = db.set(7, 1.1); // Both preceding and following blocks are empty. + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); + check = db.begin(); + ++check; + assert(it == check); + ++it; + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db.end()); + + db = mtv_type(10, true); + doubles.clear(); + doubles.resize(8, 2.1); + db.set(2, doubles.begin(), doubles.end()); // Set 2 thru 9 numeric. + db.set(6, false); + it = db.set(6, std::string("foo")); // Both preceding and following blocks are non-empty. + check = db.end(); + std::advance(check, -2); + assert(it == check); + --it; + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_double); + assert(it->position == 2); + --it; + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->position == 0); + assert(it == db.begin()); + + it = db.set(6, 4.5); // Same type as those of the preceding and following blocks. + assert(it->size == 8); + assert(it->type == mdds::mtv::element_type_double); + assert(it->position == 2); + assert(it->__private_data.block_index == 1); + check = db.begin(); + ++check; + assert(it == check); + ++it; + assert(it == db.end()); + + db = mtv_type(10, true); + db.set(4, static_cast<int32_t>(34)); + doubles.resize(5, 2.3); + db.set(5, doubles.begin(), doubles.end()); + it = db.set(4, false); // Same type as that of the preceding block. + assert(it == db.begin()); + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_boolean); + std::advance(it, 2); + assert(it == db.end()); + + db.set(4, static_cast<int32_t>(35)); // Reset to previous state. + it = db.set(4, 4.5); // Same type as that of the following block. + assert(it->size == 6); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it == db.end()); + + db.set(4, static_cast<int32_t>(36)); // Reset again. + it = db.set(4, static_cast<int16_t>(28)); // Different type from either of the blocks. + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_int16); + assert(it->position == 4); + assert(it->__private_data.block_index == 1); + std::advance(it, 2); + assert(it == db.end()); + + // Preceding block is empty, and the following block is non-empty. + db = mtv_type(10); + doubles.resize(3, 1.1); + db.set(7, doubles.begin(), doubles.end()); // 7 thru 9 to be numeric. + db.set(6, static_cast<int32_t>(23)); + it = db.set(6, std::string("foo")); // Type different from that of the following block. + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + assert(it->position == 6); + ++it; + assert(it->size == 3); + assert(it->type == mdds::mtv::element_type_double); + assert(it->position == 7); + ++it; + assert(it == db.end()); + + db.set(6, static_cast<int32_t>(24)); // Reset. + it = db.set(6, 4.5); // This time the same type as that of the following block. + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it == db.end()); + + // Now, the preceding block is not empty while the following block is. + db = mtv_type(10, static_cast<uint16_t>(10)); + db.set_empty(4, 6); + db.set(3, 1.2); + it = db.set(3, static_cast<uint16_t>(11)); // Same as the previous block. + assert(it == db.begin()); + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_uint16); + std::advance(it, 3); + assert(it == db.end()); + + db.set(3, 1.3); // Reset + it = db.set(3, std::string("foo")); // This time, different from the previous block. + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + std::advance(it, 3); + assert(it == db.end()); +} + +/** + * Test the variant of set() method that takes iterators (part 2). + */ +void mtv_test_iterators_set_2() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type::iterator it, check; + std::vector<double> doubles(3, 1.1); + std::deque<bool> bools; + std::vector<std::string> strings; + + // simple overwrite. + mtv_type db(10, 2.3); + db.set(0, true); + db.set(1, std::string("foo")); + it = db.set(2, doubles.begin(), doubles.end()); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + ++it; + assert(it == db.end()); + + // Insert and merge with previous block. + db = mtv_type(10, true); + db.set(5, 1.1); + db.set(6, 1.2); + db.set(7, 1.3); + db.set(8, std::string("foo")); + bools.resize(3, false); + it = db.set(5, bools.begin(), bools.end()); + assert(it == db.begin()); + assert(it->size == 8); + assert(it->type == mdds::mtv::element_type_boolean); + std::advance(it, 3); + assert(it == db.end()); + + // Insert and merge with previous and next blocks. + db = mtv_type(10, true); + db.set(0, std::string("foo")); + db.set(5, 1.1); + db.set(6, 1.2); + db.set(7, 1.3); + it = db.set(5, bools.begin(), bools.end()); + assert(db.block_size() == 2); + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 9); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + // Insert and merge with next block only. + db = mtv_type(10); // start empty. + db.set(4, true); + db.set(5, true); + db.set(6, true); + db.set(7, 1.1); + db.set(8, 1.2); + db.set(9, 1.3); + doubles.resize(3, 2.2); + it = db.set(4, doubles.begin(), doubles.end()); + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 6); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it == db.end()); + + // Replace the upper part of a block and merge with previous block. + db = mtv_type(10, false); + db.set(3, 1.2); + db.set(4, 1.3); + db.set(5, 1.4); + db.set(6, 1.5); + db.set(7, 1.6); + bools.resize(3, true); + it = db.set(3, bools.begin(), bools.end()); + assert(it == db.begin()); + assert(it->size == 6); + assert(it->type == mdds::mtv::element_type_boolean); + std::advance(it, 3); + assert(it == db.end()); + + // Replace the upper part of a block but don't merge with previous block. + db = mtv_type(10, false); + db.set(3, std::string("A")); + db.set(4, std::string("B")); + db.set(5, std::string("C")); + db.set(6, std::string("D")); + db.set(7, std::string("E")); + doubles.resize(3, 1.1); + it = db.set(3, doubles.begin(), doubles.end()); + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 3); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_string); + ++it; + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + // Overwrite the lower part of a block and merge it with the next block. + db = mtv_type(10, false); + db.set(0, 2.2); + db.set(4, 1.1); + db.set(5, 1.2); + db.set(6, 1.3); + assert(db.block_size() == 4); + bools.resize(2, true); + it = db.set(5, bools.begin(), bools.end()); // 5 to 6 + check = db.begin(); + std::advance(check, 3); + assert(it == check); + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + // Overwrite the lower part of a block but don't merge it with the next block. + db = mtv_type(10, std::string("boo")); + db.set(0, 1.1); + db.set(5, true); + db.set(6, true); + db.set(7, true); + doubles.resize(2, 2.2); + it = db.set(6, doubles.begin(), doubles.end()); + check = db.begin(); + std::advance(check, 3); + assert(it == check); + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_double); + std::advance(it, 2); + assert(it == db.end()); + + // Overwrite the lower part of the last block. + db = mtv_type(10, std::string("boo")); + db.set(0, 1.1); + doubles.resize(3, 2.2); + it = db.set(7, doubles.begin(), doubles.end()); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + ++it; + assert(it->size == 3); + assert(it->type == mdds::mtv::element_type_double); + assert(it == db.end()); + + // Overwrite the middle part of a block. + db = mtv_type(10); + bools.resize(5, true); + it = db.set(3, bools.begin(), bools.end()); + check = db.begin(); + ++check; + assert(check == it); + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_boolean); + std::advance(it, 2); + assert(it == db.end()); + + // Overwrite multiple blocks with values whose type matches that of the top block. + int32_t int_val = 255; + db = mtv_type(10, int_val); + bools.resize(6, true); + db.set(4, bools.begin(), bools.end()); // set 4 thru 9 to bool. + db.set(5, 1.1); + db.set(7, std::string("foo")); + assert(db.block_size() == 6); + doubles.resize(4, 4.5); + it = db.set(5, doubles.begin(), doubles.end()); // 5 thrugh 8. + check = db.begin(); + assert(check->type == mdds::mtv::element_type_int32); + ++check; + assert(check->type == mdds::mtv::element_type_boolean); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 4); + std::advance(it, 2); + assert(it == db.end()); + + // The same scenario, except that the values also match that of the bottom block. + db = mtv_type(10, 1.1); + db.set(5, true); + assert(db.block_size() == 3); + doubles.resize(3, 2.3); + it = db.set(4, doubles.begin(), doubles.end()); + assert(db.block_size() == 1); + assert(it == db.begin()); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 10); + ++it; + assert(it == db.end()); + + // This time, the top block is of different type. + db = mtv_type(10, false); + doubles.resize(4, 4.5); + db.set(3, doubles.begin(), doubles.end()); // 3 thru 6 + db.set(0, int32_t(1)); + strings.resize(4, std::string("test")); + it = db.set(4, strings.begin(), strings.end()); // Overwrite the lower part of the top block. + check = db.begin(); + assert(check->type == mdds::mtv::element_type_int32); + ++check; + assert(check->type == mdds::mtv::element_type_boolean); + ++check; + assert(check->type == mdds::mtv::element_type_double); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 4); + ++it; + assert(it->type == mdds::mtv::element_type_boolean); + ++it; + assert(it == db.end()); + + db = mtv_type(10, false); + db.set(0, 1.1); + db.set(4, 1.2); + db.set(5, 1.3); + db.set(6, std::string("a")); + db.set(7, std::string("b")); + doubles.resize(3, 0.8); + it = db.set(6, doubles.begin(), doubles.end()); // Merge with the upper block. + check = db.begin(); + assert(check->type == mdds::mtv::element_type_double); + ++check; + assert(check->type == mdds::mtv::element_type_boolean); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 5); + ++it; + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->size == 1); + ++it; + assert(it == db.end()); + + // Make sure this also works in scenarios where the values merge with lower block. + db = mtv_type(20, false); + doubles.resize(4, 3.4); + db.set(5, doubles.begin(), doubles.end()); // 5 thru 8 + strings.resize(5, "expanded"); + db.set(11, strings.begin(), strings.end()); // 11 thru 15 + strings.clear(); + strings.resize(6, "overwriting"); + it = db.set(7, strings.begin(), strings.end()); // 7 thru 12 + + // At this point, 7 thru 15 should be strings. + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 9); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_boolean); + assert(check->size == 5); // 0 thru 4 + ++check; + assert(check->type == mdds::mtv::element_type_double); + assert(check->size == 2); // 5 thru 6 + ++check; + assert(it == check); + ++it; + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->size == 4); // 16 thru 19 + ++it; + assert(it == db.end()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/iterators_set_empty.inl b/test/multi_type_vector/default/tc/iterators_set_empty.inl new file mode 100644 index 0000000..91b72fa --- /dev/null +++ b/test/multi_type_vector/default/tc/iterators_set_empty.inl @@ -0,0 +1,215 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_iterators_set_empty() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type::iterator it, check; + + // Block is already empty. Calling the method does not do anything. + mtv_type db(10); + db.set(0, 1.1); + it = db.set_empty(6, 8); + check = db.begin(); + ++check; + assert(it == check); + + // Empty a whole block. + db = mtv_type(10, false); + db.set(0, 1.1); + db.set(1, std::string("A")); + it = db.set_empty(2, 9); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 8); + ++it; + assert(it == db.end()); + + // Empty the upper part of a block. + std::vector<int16_t> shorts(8, 23); + db.set(2, shorts.begin(), shorts.end()); + it = db.set_empty(2, 6); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 5); + ++it; + assert(it->type == mdds::mtv::element_type_int16); + assert(it->size == 3); + ++it; + assert(it == db.end()); + + // Empty the lower part of a block. + db = mtv_type(10, std::string("foo")); + it = db.set_empty(3, 9); + check = db.begin(); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 7); + ++it; + assert(it == db.end()); + + // Empty the middle part of a block. + db = mtv_type(10, std::string("baa")); + it = db.set_empty(3, 6); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_string); + assert(check->size == 3); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 4); + ++it; + assert(it->type == mdds::mtv::element_type_string); + assert(it->size == 3); + ++it; + assert(it == db.end()); + + // Empty multiple blocks. The first block is partially emptied. + db = mtv_type(10, false); + db.set(0, 1.1); + shorts.resize(3, 22); + db.set(4, shorts.begin(), shorts.end()); // 4 thru 6 + it = db.set_empty(5, 8); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_double); + assert(check->size == 1); + ++check; + assert(check->type == mdds::mtv::element_type_boolean); + assert(check->size == 3); + ++check; + assert(check->type == mdds::mtv::element_type_int16); + assert(check->size == 1); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 4); + ++it; + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->size == 1); + ++it; + assert(it == db.end()); + + // This time, the first block is completely emptied. + db = mtv_type(10, false); + db.set(0, 1.2); + shorts.resize(3, 42); + db.set(4, shorts.begin(), shorts.end()); // 4 thru 6 + it = db.set_empty(4, 7); + check = db.begin(); + assert(check->type == mdds::mtv::element_type_double); + assert(check->size == 1); + ++check; + assert(check->type == mdds::mtv::element_type_boolean); + assert(check->size == 3); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 4); + ++it; + assert(it->type == mdds::mtv::element_type_boolean); + assert(it->size == 2); + ++it; + assert(it == db.end()); + + // And this time, the first block is partially emptied but it's already an + // empty block to begin with. + db = mtv_type(10); + db.set(0, std::string("top")); + std::vector<double> doubles(5, 1.2); + db.set(5, doubles.begin(), doubles.end()); // 5 thru 9 + it = db.set_empty(3, 7); + check = db.begin(); + ++check; + assert(it == check); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 7); + ++it; + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 2); + ++it; + assert(it == db.end()); + + db = mtv_type(10); + db.set(0, true); + db.set(5, 1.1); + it = db.set_empty(5, 5); // Merge with previous and next blocks. + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 9); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->position == 1); + assert(it->__private_data.block_index == 1); + ++it; + assert(it == db.end()); + + doubles.resize(3, 32.3); + db.set(4, doubles.begin(), doubles.end()); // 4 thru 6 + assert(db.block_size() == 4); + it = db.set_empty(4, 5); // Merge with the previous block. + check = db.begin(); + ++check; + assert(it == check); + assert(it->size == 5); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->position == 1); + assert(it->__private_data.block_index == 1); + ++it; + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it->size == 3); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db.end()); + + db = mtv_type(10); + db.set(9, false); + db.set(3, 1.1); + db.set(4, 1.2); + db.set(5, 1.3); + assert(db.block_size() == 4); + it = db.set_empty(5, 5); // Merge with the next empty block. + assert(db.block_size() == 4); + check = db.begin(); + std::advance(check, 2); + assert(it == check); + assert(it->size == 4); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->__private_data.block_index == 2); + assert(it->position == 5); + std::advance(it, 2); + assert(it == db.end()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/misc.inl b/test/multi_type_vector/default/tc/misc.inl new file mode 100644 index 0000000..96d0b67 --- /dev/null +++ b/test/multi_type_vector/default/tc/misc.inl @@ -0,0 +1,556 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +enum test_mtv_type +{ + _mtv_bool, + _mtv_int8, + _mtv_uint8, + _mtv_int16, + _mtv_uint16, + _mtv_int32, + _mtv_uint32, + _mtv_int64, + _mtv_uint64, + _mtv_float, + _mtv_double, + _mtv_string, +}; + +#define TEST_TYPE(_type_, _type_enum_) \ + test_mtv_type test_type(_type_) \ + { \ + return _type_enum_; \ + } +TEST_TYPE(bool, _mtv_bool) +TEST_TYPE(int8_t, _mtv_int8) +TEST_TYPE(uint8_t, _mtv_uint8) +TEST_TYPE(int16_t, _mtv_int16) +TEST_TYPE(uint16_t, _mtv_uint16) +TEST_TYPE(int32_t, _mtv_int32) +TEST_TYPE(uint32_t, _mtv_uint32) +TEST_TYPE(int64_t, _mtv_int64) +TEST_TYPE(uint64_t, _mtv_uint64) +TEST_TYPE(float, _mtv_float) +TEST_TYPE(double, _mtv_double) +TEST_TYPE(std::string, _mtv_string) + +void mtv_test_misc_types() +{ + // Test function overloading of standard types. + + stack_printer __stack_printer__(__FUNCTION__); + { + bool val = false; + assert(test_type(val) == _mtv_bool); + cout << "bool is good" << endl; + } + { + int16_t val = 0; + assert(test_type(val) == _mtv_int16); + cout << "int16 is good" << endl; + } + { + uint16_t val = 0; + assert(test_type(val) == _mtv_uint16); + cout << "uint16 is good" << endl; + } + { + int32_t val = 0; + assert(test_type(val) == _mtv_int32); + cout << "int32 is good" << endl; + } + { + uint32_t val = 0; + assert(test_type(val) == _mtv_uint32); + cout << "uint32 is good" << endl; + } + { + int64_t val = 0; + assert(test_type(val) == _mtv_int64); + cout << "int64 is good" << endl; + } + { + uint64_t val = 0; + assert(test_type(val) == _mtv_uint64); + cout << "uint64 is good" << endl; + } + { + float val = 0; + assert(test_type(val) == _mtv_float); + cout << "float is good" << endl; + } + { + double val = 0; + assert(test_type(val) == _mtv_double); + cout << "double is good" << endl; + } + { + std::string val; + assert(test_type(val) == _mtv_string); + cout << "string is good" << endl; + } + { + int8_t val = 0; + assert(test_type(val) == _mtv_int8); + cout << "int8 is good" << endl; + } + { + uint8_t val = 0; + assert(test_type(val) == _mtv_uint8); + cout << "uint8 is good" << endl; + } +} + +void mtv_test_misc_swap() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db1(3), db2(5); + db1.set(0, 1.0); + db1.set(1, 2.0); + db1.set(2, 3.0); + + db2.set(0, 4.0); + db2.set(1, 5.0); + db2.set(4, std::string("foo")); + db1.swap(db2); + + assert(db1.size() == 5 && db1.block_size() == 3); + assert(db2.size() == 3 && db2.block_size() == 1); +} + +void mtv_test_misc_equality() +{ + stack_printer __stack_printer__(__FUNCTION__); + { + // Two columns of equal size. + mtv_type db1(3), db2(3); + assert(db1 == db2); + db1.set(0, 1.0); + assert(db1 != db2); + db2.set(0, 1.0); + assert(db1 == db2); + db2.set(0, 1.2); + assert(db1 != db2); + db1.set(0, 1.2); + assert(db1 == db2); + } + + { + // Two columns of different sizes. They are always non-equal no + // matter what. + mtv_type db1(3), db2(4); + assert(db1 != db2); + db1.set(0, 1.2); + db2.set(0, 1.2); + assert(db1 != db2); + + // Comparison to self. + assert(db1 == db1); + assert(db2 == db2); + } + + { + // Two containers both consisting of numeric - empty - numeric blocks, + // and the last numeric blocks differ. + + mtv_type db1(5), db2(5); + db1.set(0, 1.1); + db1.set(3, 2.1); + db1.set(4, 2.2); + + db2.set(0, 1.1); + db2.set(3, 2.1); + db2.set(4, 2.3); // different value + + assert(db1 != db2); + } + + { + mtv_type db1(2), db2(2); + db1.set(1, 10.1); + db2.set(1, 10.1); + assert(db1 == db2); + + db2.set(0, std::string("foo")); + assert(db1 != db2); + + db1.set(0, std::string("foo")); + assert(db1 == db2); + + db2.set_empty(0, 0); + assert(db1 != db2); + } +} + +void mtv_test_misc_clone() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db1(3); + db1.set(0, 3.4); + db1.set(1, std::string("foo")); + db1.set(2, true); + + // copy construction + + mtv_type db2(db1); + assert(db1.size() == db2.size()); + assert(db1.block_size() == db2.block_size()); + assert(db1 == db2); + + { + double test1, test2; + db1.get(0, test1); + db2.get(0, test2); + assert(test1 == test2); + } + { + std::string test1, test2; + db1.get(1, test1); + db2.get(1, test2); + assert(test1 == test2); + } + + { + bool test1, test2; + db1.get(2, test1); + db2.get(2, test2); + assert(test1 == test2); + } + + // assignment + + mtv_type db3 = db1; + assert(db3 == db1); + db3.set(0, std::string("alpha")); + assert(db3 != db1); + + mtv_type db4, db5; + db4 = db5 = db3; + assert(db4 == db5); + assert(db3 == db5); + assert(db3 == db4); +} + +void mtv_test_misc_resize() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(0); + assert(db.size() == 0); + assert(db.empty()); + + // Resize to create initial empty block. + db.resize(3); + assert(db.size() == 3); + assert(db.block_size() == 1); + + // Resize to increase the existing empty block. + db.resize(5); + assert(db.size() == 5); + assert(db.block_size() == 1); + + for (long row = 0; row < 5; ++row) + db.set(row, static_cast<double>(row)); + + assert(db.size() == 5); + assert(db.block_size() == 1); + + // Increase its size by one. This should append an empty cell block of size one. + db.resize(6); + assert(db.size() == 6); + assert(db.block_size() == 2); + assert(db.is_empty(5)); + + // Do it again. + db.resize(7); + assert(db.size() == 7); + assert(db.block_size() == 2); + + // Now, reduce its size to eliminate the last empty block. + db.resize(5); + assert(db.size() == 5); + assert(db.block_size() == 1); + + // Reset. + db.resize(7); + assert(db.size() == 7); + assert(db.block_size() == 2); + + // Now, resize across multiple blocks. + db.resize(4); + assert(db.size() == 4); + assert(db.block_size() == 1); + double test; + db.get(3, test); + assert(test == 3.0); + + // Empty it. + db.resize(0); + assert(db.size() == 0); + assert(db.block_size() == 0); + assert(db.empty()); +} + +void mtv_test_misc_value_type() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_type db(5); + db.set(0, 1.1); + db.set(1, std::string("A")); + db.set(2, std::string("B")); + db.set(3, int32_t(12)); + db.set(4, int16_t(8)); + + std::for_each(db.begin(), db.end(), [](const mtv_type::value_type& node) { + cout << "type: " << node.type << " size: " << node.size << " data: " << node.data << endl; + }); +} + +void mtv_test_misc_block_identifier() +{ + stack_printer __stack_printer__(__FUNCTION__); + assert(mdds::mtv::double_element_block::block_type == mdds::mtv::element_type_double); + assert(mdds::mtv::string_element_block::block_type == mdds::mtv::element_type_string); + assert(mdds::mtv::int16_element_block::block_type == mdds::mtv::element_type_int16); + assert(mdds::mtv::uint16_element_block::block_type == mdds::mtv::element_type_uint16); + assert(mdds::mtv::int32_element_block::block_type == mdds::mtv::element_type_int32); + assert(mdds::mtv::uint32_element_block::block_type == mdds::mtv::element_type_uint32); + assert(mdds::mtv::int64_element_block::block_type == mdds::mtv::element_type_int64); + assert(mdds::mtv::uint64_element_block::block_type == mdds::mtv::element_type_uint64); + assert(mdds::mtv::boolean_element_block::block_type == mdds::mtv::element_type_boolean); + assert(mdds::mtv::int8_element_block::block_type == mdds::mtv::element_type_int8); + assert(mdds::mtv::uint8_element_block::block_type == mdds::mtv::element_type_uint8); +} + +void mtv_test_misc_push_back() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_type db; + assert(db.size() == 0); + assert(db.block_size() == 0); + + // Append an empty element into an empty container. + mtv_type::iterator it = db.push_back_empty(); + assert(db.size() == 1); + assert(db.block_size() == 1); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->__private_data.block_index == 0); + assert(it == db.begin()); + ++it; + assert(it == db.end()); + + // ... and again. + it = db.push_back_empty(); + assert(db.size() == 2); + assert(db.block_size() == 1); + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->__private_data.block_index == 0); + assert(it == db.begin()); + ++it; + assert(it == db.end()); + + // Append non-empty this time. + it = db.push_back(1.1); + assert(db.size() == 3); + assert(db.block_size() == 2); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); + assert(it->__private_data.block_index == 1); + mtv_type::iterator check = it; + --check; + assert(check == db.begin()); + ++it; + assert(it == db.end()); + + // followed by an empty element again. + it = db.push_back_empty(); + assert(db.size() == 4); + assert(db.block_size() == 3); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->__private_data.block_index == 2); + check = it; + --check; + --check; + assert(check == db.begin()); + ++it; + assert(it == db.end()); + + // Check the values. + assert(db.is_empty(0)); + assert(db.is_empty(1)); + assert(db.get<double>(2) == 1.1); + assert(db.is_empty(3)); + + // Empty the container and push back a non-empty element. + db.clear(); + it = db.push_back(std::string("push me")); + assert(db.size() == 1); + assert(db.block_size() == 1); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_string); + assert(it->__private_data.block_index == 0); + assert(it == db.begin()); + ++it; + assert(it == db.end()); + assert(db.get<std::string>(0) == "push me"); + + // Push back a non-empty element of the same type. + it = db.push_back(std::string("again")); + assert(db.size() == 2); + assert(db.block_size() == 1); + assert(it->size == 2); + assert(it->type == mdds::mtv::element_type_string); + assert(it->__private_data.block_index == 0); + assert(it == db.begin()); + ++it; + assert(it == db.end()); + + assert(db.get<std::string>(0) == "push me"); + assert(db.get<std::string>(1) == "again"); + + // Push back another non-empty element of a different type. + it = db.push_back(23.4); + assert(db.size() == 3); + assert(db.block_size() == 2); + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); +} + +void mtv_test_misc_capacity() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(10, 1.1); + assert(db.block_size() == 1); + mtv_type::const_iterator it = db.begin(); + assert(it->type == mdds::mtv::element_type_double); + size_t cap = mdds::mtv::double_element_block::capacity(*it->data); + assert(cap == 10); + + db.set_empty(3, 3); + assert(db.block_size() == 3); + db.shrink_to_fit(); + it = db.begin(); + assert(it->type == mdds::mtv::element_type_double); + cap = mdds::mtv::double_element_block::capacity(*it->data); + assert(cap == 3); +} + +void mtv_test_misc_position_type_end_position() +{ + stack_printer __stack_printer__(__FUNCTION__); + + auto run = [](auto& db) { + auto pos1 = db.position(9); // last valid position. + pos1 = mtv_type::next_position(pos1); + auto pos2 = db.position(10); // end position - one position past the last valid position + assert(pos1 == pos2); + + // Move back from the end position by one. It should point to the last + // valid position. + pos2 = mtv_type::advance_position(pos2, -1); + pos1 = db.position(9); + assert(pos1 == pos2); + + // Try the variant of position() method that takes position hint as its first argument. + pos1 = db.position(db.begin(), 10); + pos1 = mtv_type::advance_position(pos1, -10); + pos2 = db.position(0); + assert(pos1 == pos2); + + // A position more than one past the last valid position is considered out-of-range. + + try + { + pos1 = db.position(11); + assert(!"No exceptions thrown, but one was expected to be thrown."); + } + catch (const std::out_of_range&) + { + // good. + cout << "Out of range exception was thrown as expected." << endl; + } + catch (...) + { + assert(!"An unexpected exception was thrown."); + } + + // Try again with the variant that takes a position hint. + + try + { + pos1 = db.position(db.begin(), 11); + assert(!"No exceptions thrown, but one was expected to be thrown."); + } + catch (const std::out_of_range&) + { + // good. + cout << "Out of range exception was thrown as expected." << endl; + } + catch (...) + { + assert(!"An unexpected exception was thrown."); + } + }; + + mtv_type db(10); + const mtv_type& cdb = db; + cout << "* position_type" << endl; + run(db); + cout << "* const_position_type" << endl; + run(cdb); +} + +/** + * Ensure that we test block adjustment case with adjusted block size + * greater than 8. + */ +void mtv_test_misc_block_pos_adjustments() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_type db(1); + + for (int i = 0; i < 20; ++i) + { + std::vector<double> vs(2, 1.1); + db.insert(0, vs.begin(), vs.end()); + + std::vector<int16_t> is(2, 34); + db.insert(0, is.begin(), is.end()); + } + + assert(db.size() == 81); + assert(db.block_size() == 41); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/position.inl b/test/multi_type_vector/default/tc/position.inl new file mode 100644 index 0000000..6c7d819 --- /dev/null +++ b/test/multi_type_vector/default/tc/position.inl @@ -0,0 +1,202 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_position() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(10, false); + mtv_type::iterator check; + mtv_type::const_iterator const_check; + db.set(6, 1.1); + db.set(7, 1.2); + db.set(8, 1.3); + db.set(9, 1.4); + + mtv_type::position_type pos = db.position(0); + assert(pos.first == db.begin()); + assert(pos.second == 0); + + pos = db.position(1); + assert(pos.first == db.begin()); + assert(pos.second == 1); + + pos = db.position(5); + assert(pos.first == db.begin()); + assert(pos.second == 5); + + check = db.begin(); + ++check; + + // These positions should be on the 2nd block. + + pos = db.position(6); + assert(pos.first == check); + assert(pos.second == 0); + + pos = db.position(7); + assert(pos.first == check); + assert(pos.second == 1); + + pos = db.position(9); + assert(pos.first == check); + assert(pos.second == 3); + + { + // Make sure you get the right element. + mtv_type::iterator it = pos.first; + assert(it->type == mdds::mtv::element_type_double); + assert(it->data); + mdds::mtv::double_element_block::iterator it_elem = mdds::mtv::double_element_block::begin(*it->data); + advance(it_elem, pos.second); + assert(*it_elem == 1.4); + } + + // Quick check for the const variant. + const mtv_type& db_ref = db; + mtv_type::const_position_type const_pos = db_ref.position(3); + assert(const_pos.first == db_ref.begin()); + assert(const_pos.second == 3); + const_pos = db_ref.position(const_pos.first, 7); + const_check = db_ref.begin(); + ++const_check; + assert(const_pos.first == const_check); + assert(const_pos.second == 1); + + // Check for the variant that takes position hint. + pos = db.position(0); + assert(pos.first == db.begin()); + assert(pos.second == 0); + + pos = db.position(pos.first, 6); + check = db.begin(); + ++check; + assert(pos.first == check); + assert(pos.second == 0); + + pos = db.position(pos.first, 7); + assert(pos.first == check); + assert(pos.second == 1); + + pos = db.position(pos.first, 9); + assert(pos.first == check); + assert(pos.second == 3); +} + +void mtv_test_position_next() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(10); + db.set(2, 1.1); + db.set(3, 1.2); + db.set(4, std::string("A")); + db.set(5, std::string("B")); + db.set(6, std::string("C")); + db.set(7, true); + db.set(8, false); + + mtv_type::position_type pos = db.position(0); + assert(mtv_type::logical_position(pos) == 0); + assert(pos.first->type == mdds::mtv::element_type_empty); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 1); + assert(pos.first->type == mdds::mtv::element_type_empty); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 2); + assert(pos.first->type == mdds::mtv::element_type_double); + assert(mtv_type::get<mdds::mtv::double_element_block>(pos) == 1.1); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 3); + assert(pos.first->type == mdds::mtv::element_type_double); + assert(mtv_type::get<mdds::mtv::double_element_block>(pos) == 1.2); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 4); + assert(pos.first->type == mdds::mtv::element_type_string); + assert(mtv_type::get<mdds::mtv::string_element_block>(pos) == "A"); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 5); + assert(pos.first->type == mdds::mtv::element_type_string); + assert(mtv_type::get<mdds::mtv::string_element_block>(pos) == "B"); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 6); + assert(pos.first->type == mdds::mtv::element_type_string); + assert(mtv_type::get<mdds::mtv::string_element_block>(pos) == "C"); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 7); + assert(pos.first->type == mdds::mtv::element_type_boolean); + assert(mtv_type::get<mdds::mtv::boolean_element_block>(pos) == true); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 8); + assert(pos.first->type == mdds::mtv::element_type_boolean); + assert(mtv_type::get<mdds::mtv::boolean_element_block>(pos) == false); + + pos = mtv_type::next_position(pos); + assert(mtv_type::logical_position(pos) == 9); + assert(pos.first->type == mdds::mtv::element_type_empty); + + pos = mtv_type::next_position(pos); + assert(pos.first == db.end()); +} + +void mtv_test_position_advance() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db(10); + db.set(2, 1.1); + db.set(3, 1.2); + db.set(4, std::string("A")); + db.set(5, std::string("B")); + db.set(6, std::string("C")); + + mtv_type::position_type pos = db.position(0); + assert(mtv_type::logical_position(pos) == 0); + + pos = mtv_type::advance_position(pos, 4); + assert(mtv_type::logical_position(pos) == 4); + + pos = mtv_type::advance_position(pos, 5); + assert(mtv_type::logical_position(pos) == 9); + + pos = mtv_type::advance_position(pos, -3); + assert(mtv_type::logical_position(pos) == 6); + + pos = mtv_type::advance_position(pos, -6); + assert(mtv_type::logical_position(pos) == 0); + + pos = mtv_type::advance_position(pos, 10); + assert(pos.first == db.end()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/set.inl b/test/multi_type_vector/default/tc/set.inl new file mode 100644 index 0000000..5e11bda --- /dev/null +++ b/test/multi_type_vector/default/tc/set.inl @@ -0,0 +1,652 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_set_cells() +{ + stack_printer __stack_printer__(__FUNCTION__); + { + mtv_type db(5); + + // Replace the whole block. + + { + std::vector<double> vals; + vals.reserve(5); + for (size_t i = 0; i < db.size(); ++i) + vals.push_back(double(i + 1)); + + db.set(0, vals.begin(), vals.end()); + + double test; + db.get(0, test); + assert(test == 1.0); + db.get(4, test); + assert(test == 5.0); + } + + { + std::vector<std::string> vals; + vals.reserve(5); + for (size_t i = 0; i < db.size(); ++i) + { + std::ostringstream os; + os << (i + 1); + vals.push_back(os.str()); + } + + db.set(0, vals.begin(), vals.end()); + + std::string test; + db.get(0, test); + assert(test == "1"); + db.get(4, test); + assert(test == "5"); + } + + { + double vals[] = {5.0, 6.0, 7.0, 8.0, 9.0}; + double* p = &vals[0]; + double* p_end = p + 5; + db.set(0, p, p_end); + double test; + db.get(0, test); + assert(test == 5.0); + db.get(4, test); + assert(test == 9.0); + } + + { + // Replace the whole block of the same type, which shouldn't + // delete the old data array. + double vals[] = {5.1, 6.1, 7.1, 8.1, 9.1}; + double* p = &vals[0]; + double* p_end = p + 5; + db.set(0, p, p_end); + double test; + db.get(0, test); + assert(test == 5.1); + db.get(4, test); + assert(test == 9.1); + + double vals2[] = {8.2, 9.2}; + p = &vals2[0]; + p_end = p + 2; + db.set(3, p, p_end); + db.get(3, test); + assert(test == 8.2); + db.get(4, test); + assert(test == 9.2); + } + + { + // Replace the upper part of a single block. + uint64_t vals[] = {1, 2, 3}; + uint64_t* p = &vals[0]; + uint64_t* p_end = p + 3; + db.set(0, p, p_end); + assert(db.block_size() == 2); + assert(db.size() == 5); + uint64_t test; + db.get(0, test); + assert(test == 1); + db.get(2, test); + assert(test == 3); + double test2; + db.get(3, test2); + assert(test2 == 8.2); + } + + { + // Merge with the previos block and erase the whole block. + uint64_t vals[] = {4, 5}; + uint64_t* p = &vals[0]; + uint64_t* p_end = p + 2; + db.set(3, p, p_end); + assert(db.block_size() == 1); + assert(db.size() == 5); + uint64_t test; + db.get(2, test); + assert(test == 3); + db.get(3, test); + assert(test == 4); + } + + { + // Merge with the previous block while keeping the lower part of + // the block. + uint64_t prev_value; + db.get(2, prev_value); + + double val = 2.3; + db.set(0, val); + assert(db.block_size() == 2); + val = 4.5; + double* p = &val; + double* p_end = p + 1; + db.set(1, p, p_end); + assert(db.block_size() == 2); + assert(db.size() == 5); + { + double test; + db.get(0, test); + assert(test == 2.3); + db.get(1, test); + assert(test == 4.5); + } + + uint64_t test; + db.get(2, test); + assert(test == prev_value); + } + } + + { + mtv_type db(5); + for (size_t i = 0; i < 5; ++i) + db.set(i, static_cast<double>(i + 1)); + + assert(db.block_size() == 1); + assert(db.size() == 5); + + { + uint64_t vals[] = {10, 11}; + uint64_t* p = &vals[0]; + uint64_t* p_end = p + 2; + db.set(3, p, p_end); + + assert(db.block_size() == 2); + assert(db.size() == 5); + + double test; + db.get(2, test); + assert(test == 3.0); + uint64_t test2; + db.get(3, test2); + assert(test2 == 10); + db.get(4, test2); + assert(test2 == 11); + + // Insertion into a single block but this time it needs to be + // merged with the subsequent block. + db.set(1, p, p_end); + + assert(db.block_size() == 2); + assert(db.size() == 5); + + db.get(1, test2); + assert(test2 == 10); + db.get(2, test2); + assert(test2 == 11); + db.get(3, test2); + assert(test2 == 10); + db.get(4, test2); + assert(test2 == 11); + } + } + + { + mtv_type db(6); + double vals_d[] = {1.0, 1.1, 1.2, 1.3, 1.4, 1.5}; + uint64_t vals_i[] = {12, 13, 14, 15}; + std::string vals_s[] = {"a", "b"}; + + { + double* p = &vals_d[0]; + double* p_end = p + 6; + db.set(0, p, p_end); + assert(db.block_size() == 1); + assert(db.size() == 6); + double test; + db.get(0, test); + assert(test == 1.0); + db.get(5, test); + assert(test == 1.5); + } + + { + uint64_t* p = &vals_i[0]; + uint64_t* p_end = p + 4; + db.set(0, p, p_end); + assert(db.block_size() == 2); + uint64_t test; + db.get(0, test); + assert(test == 12); + db.get(3, test); + assert(test == 15); + } + + { + std::string* p = &vals_s[0]; + std::string* p_end = p + 2; + db.set(2, p, p_end); + assert(db.block_size() == 3); + std::string test; + db.get(2, test); + assert(test == "a"); + db.get(3, test); + assert(test == "b"); + double test_d; + db.get(4, test_d); + assert(test_d == 1.4); + uint64_t test_i; + db.get(1, test_i); + assert(test_i == 13); + } + } + + { + mtv_type db(3); + { + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + double* p_end = p + 3; + db.set(0, p, p_end); + assert(db.block_size() == 1); + } + + { + uint64_t val_i = 23; + uint64_t* p = &val_i; + uint64_t* p_end = p + 1; + db.set(1, p, p_end); + assert(db.block_size() == 3); + uint64_t test; + db.get(1, test); + assert(test == 23); + double test_d; + db.get(0, test_d); + assert(test_d == 2.1); + db.get(2, test_d); + assert(test_d == 2.3); + } + } + + { + // Set cells over multiple blocks. Very simple case. + + mtv_type db(2); + db.set(0, static_cast<double>(1.1)); + db.set(1, std::string("foo")); + assert(db.block_size() == 2); + + double vals[] = {2.1, 2.2}; + double* p = &vals[0]; + double* p_end = p + 2; + db.set(0, p, p_end); + assert(db.block_size() == 1); + assert(db.size() == 2); + + double test; + db.get(0, test); + assert(test == 2.1); + db.get(1, test); + assert(test == 2.2); + } + + { + // Same as above, except that the last block is only partially replaced. + + mtv_type db(3); + db.set(0, static_cast<double>(1.1)); + db.set(1, std::string("foo")); + db.set(2, std::string("baa")); + + double vals[] = {2.1, 2.2}; + double* p = &vals[0]; + double* p_end = p + 2; + db.set(0, p, p_end); + assert(db.block_size() == 2); + assert(db.size() == 3); + + double test_val; + db.get(0, test_val); + assert(test_val == 2.1); + db.get(1, test_val); + assert(test_val == 2.2); + + std::string test_s; + db.get(2, test_s); + assert(test_s == "baa"); + } + + { + mtv_type db(3); + db.set(0, static_cast<double>(3.1)); + db.set(1, static_cast<double>(3.2)); + db.set(2, std::string("foo")); + assert(db.block_size() == 2); + assert(db.size() == 3); + + double vals[] = {2.1, 2.2}; + double* p = &vals[0]; + double* p_end = p + 2; + db.set(1, p, p_end); + assert(db.block_size() == 1); + double test; + db.get(0, test); + assert(test == 3.1); + db.get(1, test); + assert(test == 2.1); + db.get(2, test); + assert(test == 2.2); + } + + { + mtv_type db(5); + db.set(0, 1.1); + db.set(1, 1.2); + db.set(2, std::string("foo")); + db.set(3, 1.3); + db.set(4, 1.4); + assert(db.block_size() == 3); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + double* p_end = p + 3; + db.set(1, p, p_end); + assert(db.block_size() == 1); + assert(db.size() == 5); + assert(db.get<double>(0) == 1.1); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 2.3); + assert(db.get<double>(4) == 1.4); + } + + { + mtv_type db(4); + db.set(0, std::string("A")); + db.set(1, std::string("B")); + db.set(2, 1.1); + db.set(3, 1.2); + assert(db.block_size() == 2); + + double vals[] = {2.1, 2.2, 2.3}; + double* p = &vals[0]; + db.set(1, p, p + 3); + assert(db.block_size() == 2); + assert(db.get<std::string>(0) == std::string("A")); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 2.3); + } + + { + mtv_type db(4); + db.set(0, std::string("A")); + db.set(1, std::string("B")); + db.set(2, 1.1); + db.set(3, 1.2); + assert(db.block_size() == 2); + + double vals[] = {2.1, 2.2}; + double* p = &vals[0]; + db.set(1, p, p + 2); + assert(db.block_size() == 2); + assert(db.get<std::string>(0) == std::string("A")); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + assert(db.get<double>(3) == 1.2); + } + + { + mtv_type db(5); + db.set(0, std::string("A")); + db.set(1, std::string("B")); + db.set(2, 1.1); + db.set(3, 1.2); + db.set(4, static_cast<uint64_t>(12)); + assert(db.block_size() == 3); + + uint64_t vals[] = {21, 22, 23}; + uint64_t* p = &vals[0]; + db.set(1, p, p + 3); + assert(db.block_size() == 2); + assert(db.get<std::string>(0) == std::string("A")); + assert(db.get<uint64_t>(1) == 21); + assert(db.get<uint64_t>(2) == 22); + assert(db.get<uint64_t>(3) == 23); + assert(db.get<uint64_t>(4) == 12); + } + + { + mtv_type db(3); + db.set(0, std::string("A")); + db.set(1, 1.1); + db.set(2, 1.2); + assert(db.block_size() == 2); + + uint64_t vals[] = {11, 12}; + uint64_t* p = &vals[0]; + db.set(0, p, p + 2); + assert(db.block_size() == 2); + assert(db.get<uint64_t>(0) == 11); + assert(db.get<uint64_t>(1) == 12); + assert(db.get<double>(2) == 1.2); + } + + { + mtv_type db(4); + db.set(0, static_cast<uint64_t>(35)); + db.set(1, std::string("A")); + db.set(2, 1.1); + db.set(3, 1.2); + assert(db.block_size() == 3); + + uint64_t vals[] = {11, 12}; + uint64_t* p = &vals[0]; + db.set(1, p, p + 2); + assert(db.block_size() == 2); + assert(db.get<uint64_t>(0) == 35); + assert(db.get<uint64_t>(1) == 11); + assert(db.get<uint64_t>(2) == 12); + assert(db.get<double>(3) == 1.2); + } + + { + // Block 1 is empty. + + mtv_type db(2); + db.set(1, 1.2); + assert(db.block_size() == 2); + + double vals[] = {2.1, 2.2}; + double* p = &vals[0]; + db.set(0, p, p + 2); + assert(db.block_size() == 1); + assert(db.get<double>(0) == 2.1); + assert(db.get<double>(1) == 2.2); + } + + { + mtv_type db(3); + db.set(0, 1.1); + db.set(2, 1.2); + assert(db.block_size() == 3); + + double vals[] = {2.1, 2.2}; + double* p = &vals[0]; + db.set(1, p, p + 2); + assert(db.block_size() == 1); + assert(db.get<double>(0) == 1.1); + assert(db.get<double>(1) == 2.1); + assert(db.get<double>(2) == 2.2); + } + + { + mtv_type db(5); + db.set(2, std::string("A")); + db.set(3, std::string("B")); + db.set(4, std::string("C")); + assert(db.block_size() == 2); + + double vals[] = {1.1, 1.2, 1.3}; + double* p = &vals[0]; + db.set(1, p, p + 3); + assert(db.block_size() == 3); + + assert(db.is_empty(0)); + assert(db.get<double>(1) == 1.1); + assert(db.get<double>(2) == 1.2); + assert(db.get<double>(3) == 1.3); + assert(db.get<std::string>(4) == std::string("C")); + } + + { + mtv_type db(10, true); + std::vector<bool> bools(3, false); + db.set(3, 1.1); + db.set(4, 1.2); + db.set(5, 1.3); + assert(db.block_size() == 3); + + // This should replace the middle numeric block and merge with the top + // and bottom ones. + db.set(3, bools.begin(), bools.end()); + assert(db.block_size() == 1); + assert(db.size() == 10); + assert(db.get<bool>(0) == true); + assert(db.get<bool>(1) == true); + assert(db.get<bool>(2) == true); + assert(db.get<bool>(3) == false); + assert(db.get<bool>(4) == false); + assert(db.get<bool>(5) == false); + assert(db.get<bool>(6) == true); + assert(db.get<bool>(7) == true); + assert(db.get<bool>(8) == true); + assert(db.get<bool>(9) == true); + } + + { + mtv_type db(9); + db.set(0, 1.1); + db.set(1, 1.2); + db.set(2, true); + db.set(3, false); + db.set(4, true); + db.set(5, std::string("a")); + db.set(6, std::string("b")); + db.set(7, std::string("c")); + db.set(8, std::string("d")); + assert(db.block_size() == 3); + + std::vector<std::string> strings(3, std::string("foo")); + db.set(2, strings.begin(), strings.end()); // Merge with the next block. + assert(db.block_size() == 2); + assert(db.size() == 9); + assert(db.get<double>(0) == 1.1); + assert(db.get<double>(1) == 1.2); + assert(db.get<std::string>(2) == "foo"); + assert(db.get<std::string>(3) == "foo"); + assert(db.get<std::string>(4) == "foo"); + assert(db.get<std::string>(5) == "a"); + assert(db.get<std::string>(6) == "b"); + assert(db.get<std::string>(7) == "c"); + assert(db.get<std::string>(8) == "d"); + } + + { + mtv_type db; + + for (int i = 0; i < 3; ++i) + db.push_back<int16_t>(i); + + for (int i = 0; i < 3; ++i) + db.push_back<double>(i); + + for (int i = 0; i < 3; ++i) + db.push_back_empty(); + + std::vector<int16_t> data(5, 11); + db.set(2, data.begin(), data.end()); + + assert(db.block_size() == 2); + assert(db.size() == 9); + assert(db.get<int16_t>(0) == 0); + assert(db.get<int16_t>(1) == 1); + assert(db.get<int16_t>(2) == 11); + assert(db.get<int16_t>(3) == 11); + assert(db.get<int16_t>(4) == 11); + assert(db.get<int16_t>(5) == 11); + assert(db.get<int16_t>(6) == 11); + assert(db.is_empty(7)); + assert(db.is_empty(8)); + } + + { + mtv_type db; + + for (int i = 0; i < 2; ++i) + db.push_back<int16_t>(i); + + for (int i = 0; i < 2; ++i) + db.push_back<double>(i); + + for (int i = 0; i < 2; ++i) + db.push_back<int64_t>(i + 20); + + std::vector<int32_t> data(3, 15); + db.set(2, data.begin(), data.end()); + + assert(db.block_size() == 3); + assert(db.size() == 6); + assert(db.get<int16_t>(0) == 0); + assert(db.get<int16_t>(1) == 1); + assert(db.get<int32_t>(2) == 15); + assert(db.get<int32_t>(3) == 15); + assert(db.get<int32_t>(4) == 15); + assert(db.get<int64_t>(5) == 21); + } + + { + mtv_type db; + + for (int i = 0; i < 2; ++i) + db.push_back<int16_t>(i); + + for (int i = 0; i < 2; ++i) + db.push_back<double>(i); + + for (int i = 0; i < 2; ++i) + db.push_back<int64_t>(i + 20); + + std::vector<int32_t> data(3, 15); + db.set(1, data.begin(), data.end()); + + assert(db.block_size() == 3); + assert(db.size() == 6); + assert(db.get<int16_t>(0) == 0); + assert(db.get<int32_t>(1) == 15); + assert(db.get<int32_t>(2) == 15); + assert(db.get<int32_t>(3) == 15); + assert(db.get<int64_t>(4) == 20); + assert(db.get<int64_t>(5) == 21); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/swap_range.inl b/test/multi_type_vector/default/tc/swap_range.inl new file mode 100644 index 0000000..8736488 --- /dev/null +++ b/test/multi_type_vector/default/tc/swap_range.inl @@ -0,0 +1,551 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_swap_range() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db1(10), db2(10); + db1.set(2, 1.1); + db1.set(3, 1.2); + db1.set(4, 1.3); + + db2.set(2, 2.1); + db2.set(3, 2.2); + db2.set(4, 2.3); + + db1.swap(2, 4, db2, 2); + assert(db1.get<double>(2) == 2.1); + assert(db1.get<double>(3) == 2.2); + assert(db1.get<double>(4) == 2.3); + assert(db2.get<double>(2) == 1.1); + assert(db2.get<double>(3) == 1.2); + assert(db2.get<double>(4) == 1.3); + + // Source is empty but destination is not. + db1 = mtv_type(3); + db2 = mtv_type(3, 12.3); + db1.swap(1, 2, db2, 1); + assert(db1.is_empty(0)); + assert(db1.get<double>(1) == 12.3); + assert(db1.get<double>(2) == 12.3); + assert(db1.block_size() == 2); + assert(db2.get<double>(0) == 12.3); + assert(db2.is_empty(1)); + assert(db2.is_empty(2)); + assert(db2.block_size() == 2); + + // Go to the opposite direction. + db1.swap(1, 2, db2, 1); + assert(db1.block_size() == 1); + mtv_type::iterator it = db1.begin(); + assert(it->type == mdds::mtv::element_type_empty); + assert(it->size == 3); + it = db2.begin(); + assert(it->type == mdds::mtv::element_type_double); + assert(it->size == 3); + + int32_t int_val = 2; + int16_t short_val = 5; + db1 = mtv_type(5, int_val); + db2 = mtv_type(5, short_val); + db1.set(1, 2.3); + db1.set(2, 2.4); + db2.set(3, std::string("abc")); + db2.set(4, std::string("def")); + db1.swap(1, 2, db2, 3); // Swap 1-2 of source with 3-4 of destination. + assert(db1.get<int32_t>(0) == int_val); + assert(db1.get<std::string>(1) == "abc"); + assert(db1.get<std::string>(2) == "def"); + assert(db1.get<int32_t>(3) == int_val); + assert(db1.get<int32_t>(4) == int_val); + assert(db1.block_size() == 3); + + assert(db2.get<int16_t>(0) == short_val); + assert(db2.get<int16_t>(1) == short_val); + assert(db2.get<int16_t>(2) == short_val); + assert(db2.get<double>(3) == 2.3); + assert(db2.get<double>(4) == 2.4); + assert(db2.block_size() == 2); + + // Merge with the next block in the destination. + db1 = mtv_type(5, int_val); + db2 = mtv_type(5, 12.3); + db2.set(0, std::string("A")); + db2.set(1, std::string("B")); + db1.set(3, 1.1); + db1.set(4, 1.2); + db1.swap(3, 4, db2, 0); + assert(db1.get<int32_t>(0) == int_val); + assert(db1.get<int32_t>(1) == int_val); + assert(db1.get<int32_t>(2) == int_val); + assert(db1.get<std::string>(3) == "A"); + assert(db1.get<std::string>(4) == "B"); + assert(db1.block_size() == 2); + + assert(db2.get<double>(0) == 1.1); + assert(db2.get<double>(1) == 1.2); + assert(db2.get<double>(2) == 12.3); + assert(db2.get<double>(3) == 12.3); + assert(db2.get<double>(4) == 12.3); + assert(db2.block_size() == 1); + + // Merge with the previous block in the destination. + db1 = mtv_type(5, int_val); + db1.set(2, std::string("A")); + db1.set(3, std::string("B")); + + db2 = mtv_type(5, std::string("default")); + db2.set(3, short_val); + db2.set(4, short_val); + + db1.swap(2, 3, db2, 3); + assert(db1.get<int32_t>(0) == int_val); + assert(db1.get<int32_t>(1) == int_val); + assert(db1.get<int16_t>(2) == short_val); + assert(db1.get<int16_t>(3) == short_val); + assert(db1.get<int32_t>(4) == int_val); + assert(db1.block_size() == 3); + + assert(db2.get<std::string>(0) == "default"); + assert(db2.get<std::string>(1) == "default"); + assert(db2.get<std::string>(2) == "default"); + assert(db2.get<std::string>(3) == "A"); + assert(db2.get<std::string>(4) == "B"); + assert(db2.block_size() == 1); + + // Merge with both the previous and next blocks in the destination. + db1 = mtv_type(5, int_val); + db1.set(2, std::string("C")); + db1.set(3, std::string("D")); + + db2 = mtv_type(6, std::string("default")); + db2.set(3, short_val); + db2.set(4, short_val); + + db1.swap(2, 3, db2, 3); + assert(db1.get<int32_t>(0) == int_val); + assert(db1.get<int32_t>(1) == int_val); + assert(db1.get<int16_t>(2) == short_val); + assert(db1.get<int16_t>(3) == short_val); + assert(db1.get<int32_t>(4) == int_val); + assert(db1.block_size() == 3); + + assert(db2.get<std::string>(0) == "default"); + assert(db2.get<std::string>(1) == "default"); + assert(db2.get<std::string>(2) == "default"); + assert(db2.get<std::string>(3) == "C"); + assert(db2.get<std::string>(4) == "D"); + assert(db2.get<std::string>(5) == "default"); + assert(db2.block_size() == 1); + + // Set the new elements to the top of a block in the destination. + db1 = mtv_type(5, int_val); + db1.set(3, std::string("E")); + db1.set(4, std::string("F")); + db2 = mtv_type(5, short_val); + db1.swap(3, 4, db2, 0); + assert(db1.get<int32_t>(0) == int_val); + assert(db1.get<int32_t>(1) == int_val); + assert(db1.get<int32_t>(2) == int_val); + assert(db1.get<int16_t>(3) == short_val); + assert(db1.get<int16_t>(4) == short_val); + assert(db1.block_size() == 2); + assert(db2.get<std::string>(0) == "E"); + assert(db2.get<std::string>(1) == "F"); + assert(db2.get<int16_t>(2) == short_val); + assert(db2.get<int16_t>(3) == short_val); + assert(db2.get<int16_t>(4) == short_val); + assert(db2.block_size() == 2); + + // Do the same as before, but merge with the previous block. + db1 = mtv_type(5, int_val); + db1.set(3, std::string("G")); + db1.set(4, std::string("H")); + db2 = mtv_type(5, short_val); + db2.set(0, std::string("F")); + db1.swap(3, 4, db2, 1); + assert(db1.get<int32_t>(0) == int_val); + assert(db1.get<int32_t>(1) == int_val); + assert(db1.get<int32_t>(2) == int_val); + assert(db1.get<int16_t>(3) == short_val); + assert(db1.get<int16_t>(4) == short_val); + assert(db1.block_size() == 2); + assert(db2.get<std::string>(0) == "F"); + assert(db2.get<std::string>(1) == "G"); + assert(db2.get<std::string>(2) == "H"); + assert(db2.get<int16_t>(3) == short_val); + assert(db2.get<int16_t>(4) == short_val); + assert(db2.block_size() == 2); + + // Set the new element to the middle of a destination block. + db1 = mtv_type(5, int_val); + db1.set(3, std::string("I")); + db1.set(4, std::string("J")); + db2 = mtv_type(5, short_val); + db2.set(0, std::string("top")); + db1.swap(3, 4, db2, 2); + assert(db1.get<int32_t>(0) == int_val); + assert(db1.get<int32_t>(1) == int_val); + assert(db1.get<int32_t>(2) == int_val); + assert(db1.get<int16_t>(3) == short_val); + assert(db1.get<int16_t>(4) == short_val); + assert(db1.block_size() == 2); + + assert(db2.get<std::string>(0) == "top"); + assert(db2.get<int16_t>(1) == short_val); + assert(db2.get<std::string>(2) == "I"); + assert(db2.get<std::string>(3) == "J"); + assert(db2.get<int16_t>(4) == short_val); + assert(db2.block_size() == 4); + + // Set the new element to the lower part of a destination block. + db1 = mtv_type(5, int_val); + db1.set(0, std::string("A1")); + db1.set(1, std::string("A2")); + db2 = mtv_type(5, short_val); + db1.swap(0, 1, db2, 3); + + assert(db1.get<int16_t>(0) == short_val); + assert(db1.get<int16_t>(1) == short_val); + assert(db1.get<int32_t>(2) == int_val); + assert(db1.get<int32_t>(3) == int_val); + assert(db1.get<int32_t>(4) == int_val); + assert(db1.block_size() == 2); + + assert(db2.get<int16_t>(0) == short_val); + assert(db2.get<int16_t>(1) == short_val); + assert(db2.get<int16_t>(2) == short_val); + assert(db2.get<std::string>(3) == "A1"); + assert(db2.get<std::string>(4) == "A2"); + assert(db2.block_size() == 2); + + // Same as above, except that the new element will be merged with the next + // block in the destination. + db1 = mtv_type(5, int_val); + db1.set(0, std::string("A1")); + db1.set(1, std::string("A2")); + db2 = mtv_type(6, short_val); + db2.set(5, std::string("A3")); + db1.swap(0, 1, db2, 3); + + assert(db1.get<int16_t>(0) == short_val); + assert(db1.get<int16_t>(1) == short_val); + assert(db1.get<int32_t>(2) == int_val); + assert(db1.get<int32_t>(3) == int_val); + assert(db1.get<int32_t>(4) == int_val); + assert(db1.block_size() == 2); + + assert(db2.get<int16_t>(0) == short_val); + assert(db2.get<int16_t>(1) == short_val); + assert(db2.get<int16_t>(2) == short_val); + assert(db2.get<std::string>(3) == "A1"); + assert(db2.get<std::string>(4) == "A2"); + assert(db2.get<std::string>(5) == "A3"); + assert(db2.block_size() == 2); + + // Swap the top part of source block. + db1 = mtv_type(5, int_val); + db2 = mtv_type(5, short_val); + db1.swap(0, 1, db2, 0); + + assert(db1.get<int16_t>(0) == short_val); + assert(db1.get<int16_t>(1) == short_val); + assert(db1.get<int32_t>(2) == int_val); + assert(db1.get<int32_t>(3) == int_val); + assert(db1.get<int32_t>(4) == int_val); + + assert(db2.get<int32_t>(0) == int_val); + assert(db2.get<int32_t>(1) == int_val); + assert(db2.get<int16_t>(2) == short_val); + assert(db2.get<int16_t>(3) == short_val); + assert(db2.get<int16_t>(4) == short_val); + + // Do the same, and merge with the previous block in the source. + db1 = mtv_type(5, int_val); + db1.set(0, std::string("A")); + db2 = mtv_type(5, short_val); + db2.set(0, std::string("B")); + db2.set(1, std::string("C")); + db1.swap(1, 2, db2, 0); + + assert(db1.get<std::string>(0) == "A"); + assert(db1.get<std::string>(1) == "B"); + assert(db1.get<std::string>(2) == "C"); + assert(db1.get<int32_t>(3) == int_val); + assert(db1.get<int32_t>(4) == int_val); + assert(db1.block_size() == 2); + + assert(db2.get<int32_t>(0) == int_val); + assert(db2.get<int32_t>(1) == int_val); + assert(db2.get<int16_t>(2) == short_val); + assert(db2.get<int16_t>(3) == short_val); + assert(db2.get<int16_t>(4) == short_val); + assert(db2.block_size() == 2); + + // Replace the bottom part of existing source block. + db1 = mtv_type(2, true); + db2 = mtv_type(1, int_val); + db1.swap(1, 1, db2, 0); + assert(db1.get<bool>(0) == true); + assert(db1.get<int32_t>(1) == int_val); + assert(db2.get<bool>(0) == true); + + // Do the same, but merge with the next block in the source. + db1 = mtv_type(3, true); + db1.set<int32_t>(2, int_val + 1); + db2 = mtv_type(1, int_val); + db1.swap(1, 1, db2, 0); + assert(db1.get<bool>(0) == true); + assert(db1.get<int32_t>(1) == int_val); + assert(db1.get<int32_t>(2) == int_val + 1); + assert(db2.get<bool>(0) == true); + + // Replace the middle of existing source block. + db1 = mtv_type(5); + db1.set<int8_t>(0, 'a'); + db1.set<int8_t>(1, 'b'); + db1.set<int8_t>(2, 'c'); + db1.set<int8_t>(3, 'd'); + db1.set<int8_t>(4, 'e'); + db2 = mtv_type(2); + db2.set(0, 1.1); + db2.set(1, -1.1); + db1.swap(2, 3, db2, 0); + assert(db1.get<int8_t>(0) == 'a'); + assert(db1.get<int8_t>(1) == 'b'); + assert(db1.get<double>(2) == 1.1); + assert(db1.get<double>(3) == -1.1); + assert(db1.get<int8_t>(4) == 'e'); + assert(db1.block_size() == 3); + + assert(db2.get<int8_t>(0) == 'c'); + assert(db2.get<int8_t>(1) == 'd'); + assert(db2.block_size() == 1); + + // Swap single empty block with multiple destination blocks. + db1 = mtv_type(5); + db2 = mtv_type(5); + db2.set(0, 1.1); + db2.set(1, 2.1); + db2.set(2, 3.1); + db2.set(3, std::string("abc")); + db2.set(4, std::string("def")); + db1.swap(0, 3, db2, 1); + assert(db1.get<double>(0) == 2.1); + assert(db1.get<double>(1) == 3.1); + assert(db1.get<std::string>(2) == "abc"); + assert(db1.get<std::string>(3) == "def"); + assert(db1.is_empty(4)); + assert(db1.block_size() == 3); + assert(db2.get<double>(0) == 1.1); + assert(db2.is_empty(1)); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + assert(db2.is_empty(4)); + assert(db2.block_size() == 2); + + // Swap non-empty single block with multiple destination blocks. + db1 = mtv_type(4, int_val); + db2 = mtv_type(5); + db2.set(0, 1.1); + db2.set(1, 2.1); + db2.set(2, 3.1); + db2.set(3, std::string("abc")); + db2.set(4, std::string("def")); + db1.swap(0, 3, db2, 1); + assert(db1.get<double>(0) == 2.1); + assert(db1.get<double>(1) == 3.1); + assert(db1.get<std::string>(2) == "abc"); + assert(db1.get<std::string>(3) == "def"); + assert(db1.block_size() == 2); + assert(db2.get<double>(0) == 1.1); + assert(db2.get<int32_t>(1) == int_val); + assert(db2.get<int32_t>(2) == int_val); + assert(db2.get<int32_t>(3) == int_val); + assert(db2.get<int32_t>(4) == int_val); + assert(db2.block_size() == 2); + + // Another scenario. + db1 = mtv_type(2, short_val); + db2 = mtv_type(2); + db2.set(0, std::string("A")); + db2.set<int8_t>(1, 'A'); + db1.swap(0, 1, db2, 0); + assert(db1.get<std::string>(0) == "A"); + assert(db1.get<int8_t>(1) == 'A'); + assert(db2.get<int16_t>(0) == short_val); + assert(db2.get<int16_t>(1) == short_val); + + // Another scenario. + db1 = mtv_type(2, 3.14); + db2 = mtv_type(3); + db2.set(0, std::string("abc")); + db2.set<uint8_t>(1, 'z'); + db2.set<uint8_t>(2, 'y'); + db1.swap(0, 1, db2, 0); + assert(db1.get<std::string>(0) == "abc"); + assert(db1.get<uint8_t>(1) == 'z'); + assert(db2.get<double>(0) == 3.14); + assert(db2.get<double>(1) == 3.14); + assert(db2.get<uint8_t>(2) == 'y'); + + // Another scenario. + db1 = mtv_type(5); + db1.set<int32_t>(0, 1); + db1.set<int32_t>(1, 2); + db1.set<int32_t>(2, 3); + db1.set<int32_t>(3, 4); + db1.set<int32_t>(4, 5); + db2 = mtv_type(3); + db2.set(0, 2.3); + db2.set<int8_t>(1, 'B'); + db2.set<int64_t>(2, 123); + db1.swap(0, 2, db2, 0); + assert(db1.get<double>(0) == 2.3); + assert(db1.get<int8_t>(1) == 'B'); + assert(db1.get<int64_t>(2) == 123); + assert(db1.get<int32_t>(3) == 4); + assert(db1.get<int32_t>(4) == 5); + assert(db2.get<int32_t>(0) == 1); + assert(db2.get<int32_t>(1) == 2); + assert(db2.get<int32_t>(2) == 3); + assert(db2.block_size() == 1); + + // Another one. + db1 = mtv_type(3, std::string("test")); + db2 = mtv_type(2); + db2.set(0, -99.1); + db2.set(1, std::string("foo")); + db1.swap(1, 2, db2, 0); + assert(db1.get<std::string>(0) == "test"); + assert(db1.get<double>(1) == -99.1); + assert(db1.get<std::string>(2) == "foo"); + assert(db2.get<std::string>(0) == "test"); + assert(db2.get<std::string>(1) == "test"); + + // The source range is in the middle of a block. + db1 = mtv_type(8); + for (int32_t i = 0; i < 8; ++i) + db1.set<int32_t>(i, i + 2); + db2 = mtv_type(4); + db2.set<int32_t>(0, 12); + db2.set<int16_t>(1, 13); + db2.set<int64_t>(2, 14); + db2.set<double>(3, 15.0); + db1.swap(3, 5, db2, 1); + + assert(db1.get<int32_t>(0) == 2); + assert(db1.get<int32_t>(1) == 3); + assert(db1.get<int32_t>(2) == 4); + assert(db1.get<int16_t>(3) == 13); + assert(db1.get<int64_t>(4) == 14); + assert(db1.get<double>(5) == 15.0); + assert(db1.get<int32_t>(6) == 8); + assert(db1.get<int32_t>(7) == 9); + + assert(db2.get<int32_t>(0) == 12); + assert(db2.get<int32_t>(1) == 5); + assert(db2.get<int32_t>(2) == 6); + assert(db2.get<int32_t>(3) == 7); + assert(db2.block_size() == 1); + + // Try swapping in a multi-to-single block direction. + db1 = mtv_type(2); + db1.set(0, 1.2); + db1.set(1, std::string("123")); + db2 = mtv_type(10, short_val); + db1.swap(0, 1, db2, 4); + assert(db1.get<int16_t>(0) == short_val); + assert(db1.get<int16_t>(1) == short_val); + + assert(db2.get<int16_t>(0) == short_val); + assert(db2.get<int16_t>(1) == short_val); + assert(db2.get<int16_t>(2) == short_val); + assert(db2.get<int16_t>(3) == short_val); + assert(db2.get<double>(4) == 1.2); + assert(db2.get<std::string>(5) == "123"); + assert(db2.get<int16_t>(6) == short_val); + assert(db2.get<int16_t>(7) == short_val); + assert(db2.get<int16_t>(8) == short_val); + assert(db2.get<int16_t>(9) == short_val); + + // Multi-to-multi block swapping. Very simple case. + db1 = mtv_type(2); + db1.set(0, 2.1); + db1.set(1, std::string("test")); + db2 = mtv_type(2); + db2.set(0, int_val); + db2.set(1, short_val); + db1.swap(0, 1, db2, 0); + + assert(db1.get<int32_t>(0) == int_val); + assert(db1.get<int16_t>(1) == short_val); + assert(db2.get<double>(0) == 2.1); + assert(db2.get<std::string>(1) == "test"); + + // More complex case. + db1 = mtv_type(10); + db1.set<int32_t>(0, 2); + db1.set<int32_t>(1, 3); + db1.set<int32_t>(2, 4); + db1.set<std::string>(3, "A"); + db1.set<std::string>(4, "B"); + db1.set<std::string>(5, "C"); + // Leave some empty range. + db2 = mtv_type(10); + for (int32_t i = 0; i < 10; ++i) + db2.set<int32_t>(i, 10 + i); + db2.set<int8_t>(5, 'Z'); + db1.swap(1, 7, db2, 2); + + assert(db1.get<int32_t>(0) == 2); + assert(db1.get<int32_t>(1) == 12); + assert(db1.get<int32_t>(2) == 13); + assert(db1.get<int32_t>(3) == 14); + assert(db1.get<int8_t>(4) == 'Z'); + assert(db1.get<int32_t>(5) == 16); + assert(db1.get<int32_t>(6) == 17); + assert(db1.get<int32_t>(7) == 18); + assert(db1.is_empty(8)); + assert(db1.is_empty(9)); + assert(db1.block_size() == 4); + + assert(db2.get<int32_t>(0) == 10); + assert(db2.get<int32_t>(1) == 11); + assert(db2.get<int32_t>(2) == 3); + assert(db2.get<int32_t>(3) == 4); + assert(db2.get<std::string>(4) == "A"); + assert(db2.get<std::string>(5) == "B"); + assert(db2.get<std::string>(6) == "C"); + assert(db2.is_empty(7)); + assert(db2.is_empty(8)); + assert(db2.get<int32_t>(9) == 19); + assert(db2.block_size() == 4); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/default/tc/transfer.inl b/test/multi_type_vector/default/tc/transfer.inl new file mode 100644 index 0000000..52b9dd5 --- /dev/null +++ b/test/multi_type_vector/default/tc/transfer.inl @@ -0,0 +1,391 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void mtv_test_transfer() +{ + stack_printer __stack_printer__(__FUNCTION__); + mtv_type db1(5), db2(5); + db1.set(0, 1.0); + db1.set(1, 2.0); + mtv_type::iterator it = db1.transfer(1, 2, db2, 1); + + assert(db1.get<double>(0) == 1.0); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.is_empty(3)); + assert(db1.is_empty(4)); + + assert(db2.is_empty(0)); + assert(db2.get<double>(1) == 2.0); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + assert(db2.is_empty(4)); + + assert(it->size == 4); + assert(it->__private_data.block_index == 1); + assert(it->position == 1); + + // Reset and start over. + db1.clear(); + db1.resize(5); + db2.clear(); + db2.resize(5); + + db1.set(2, 1.2); + db1.set(3, 1.3); + + // Transfer 1:2 in db1 to 2:3 in db2. + it = db1.transfer(1, 2, db2, 2); + + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.get<double>(3) == 1.3); + assert(db1.is_empty(4)); + + assert(db2.is_empty(0)); + assert(db2.is_empty(1)); + assert(db2.is_empty(2)); + assert(db2.get<double>(3) == 1.2); + assert(db2.is_empty(4)); + + assert(it->size == 3); + assert(it->position == 0); + assert(it->__private_data.block_index == 0); + + // Reset and start over. + db1.clear(); + db1.resize(4); + db2.clear(); + db2.resize(4); + + db1.set(0, std::string("A")); + db1.set(1, std::string("B")); + db1.set(2, 11.1); + db1.set(3, 11.2); + + it = db1.transfer(1, 2, db2, 1); + + assert(db1.get<std::string>(0) == "A"); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.get<double>(3) == 11.2); + + assert(db2.is_empty(0)); + assert(db2.get<std::string>(1) == "B"); + assert(db2.get<double>(2) == 11.1); + assert(db2.is_empty(3)); + + assert(it->size == 2); + assert(it->position == 1); + assert(it->__private_data.block_index == 1); + + // Reset and start over. + db1.clear(); + db1.resize(4); + db2.clear(); + db2.resize(4); + + db1.set(2, 12.8); + it = db1.transfer(1, 2, db2, 1); + + // Reset and start over. + db1.clear(); + db1.resize(20); + db2.clear(); + db2.resize(20); + + db1.set(9, 1.1); + + db2.set(10, 1.2); + db2.set(11, 1.3); + + it = db1.transfer(9, 9, db2, 9); + + // The source should be entirely empty after the transfer. + assert(db1.block_size() == 1); + assert(it == db1.begin()); + assert(it->__private_data.block_index == 0); + assert(it->size == 20); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db1.end()); + + // Check the destination as well. + assert(db2.block_size() == 3); + it = db2.begin(); + assert(it->size == 9); + assert(it->__private_data.block_index == 0); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it->size == 3); + assert(it->__private_data.block_index == 1); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it->size == 8); + assert(it->__private_data.block_index == 2); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db2.end()); + assert(db2.get<double>(9) == 1.1); + assert(db2.get<double>(10) == 1.2); + assert(db2.get<double>(11) == 1.3); + + // Reset and start over. + db1.clear(); + db1.resize(20); + db2.clear(); + db2.resize(20); + + db1.set(8, 1.0); + db1.set(9, 1.1); + + db2.set(10, 1.2); + db2.set(11, 1.3); + + it = db1.transfer(9, 9, db2, 9); + assert(it->__private_data.block_index == 2); + assert(db1.block_size() == 3); + assert(db1.get<double>(8) == 1.0); + it = db1.begin(); + assert(it->size == 8); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it->size == 1); + assert(it->type == mdds::mtv::element_type_double); + ++it; + assert(it->size == 11); + assert(it->type == mdds::mtv::element_type_empty); + ++it; + assert(it == db1.end()); + + // Reset and start over. + db1.clear(); + db1.resize(8); + db2 = mtv_type(8, true); + + db1.transfer(0, 4, db2, 1); + + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.is_empty(3)); + assert(db1.is_empty(4)); + assert(db1.is_empty(5)); + assert(db1.is_empty(6)); + assert(db1.is_empty(7)); + + assert(db2.get<bool>(0) == true); + assert(db2.is_empty(1)); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + assert(db2.is_empty(4)); + assert(db2.is_empty(5)); + assert(db2.get<bool>(6) == true); + assert(db2.get<bool>(7) == true); + + // Start over. + db1 = mtv_type(8, int16_t(43)); + db2 = mtv_type(8); + db1.transfer(3, 5, db2, 0); + assert(db1.get<int16_t>(0) == 43); + assert(db1.get<int16_t>(1) == 43); + assert(db1.get<int16_t>(2) == 43); + assert(db1.is_empty(3)); + assert(db1.is_empty(4)); + assert(db1.is_empty(5)); + assert(db1.get<int16_t>(6) == 43); + assert(db1.get<int16_t>(7) == 43); + + assert(db2.get<int16_t>(0) == 43); + assert(db2.get<int16_t>(1) == 43); + assert(db2.get<int16_t>(2) == 43); + assert(db2.is_empty(3)); + assert(db2.is_empty(4)); + assert(db2.is_empty(5)); + assert(db2.is_empty(6)); + assert(db2.is_empty(7)); + + // Start over. + db1 = mtv_type(5); + db2 = mtv_type(5); + db1.set<double>(3, 1.1); + db1.set<double>(4, 1.2); + db2.set<int32_t>(0, 1); + db2.set<int32_t>(1, 1); + + db1.transfer(3, 4, db2, 0); + + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.is_empty(3)); + assert(db1.is_empty(4)); + + assert(db2.get<double>(0) == 1.1); + assert(db2.get<double>(1) == 1.2); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + assert(db2.is_empty(4)); + + // Start over. + db1 = mtv_type(5); + db2 = mtv_type(5); + db1.set<double>(3, 1.1); + db1.set<int32_t>(4, 892); + db2.set<int32_t>(0, 1); + db2.set<int32_t>(1, 1); + + db1.transfer(3, 4, db2, 0); + + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.is_empty(3)); + assert(db1.is_empty(4)); + + assert(db2.get<double>(0) == 1.1); + assert(db2.get<int32_t>(1) == 892); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + assert(db2.is_empty(4)); + + // Start over. + db1 = mtv_type(5, false); + db2 = mtv_type(5); + db1.set<int32_t>(4, 234); + db2.set<int8_t>(0, 32); + db2.set<uint16_t>(1, 11); + db2.set<uint16_t>(2, 22); + db2.set<int8_t>(3, 56); + + db1.transfer(3, 4, db2, 1); + + assert(db1.get<bool>(0) == false); + assert(db1.get<bool>(1) == false); + assert(db1.get<bool>(2) == false); + assert(db1.is_empty(3)); + assert(db1.is_empty(4)); + + assert(db2.get<int8_t>(0) == 32); + assert(db2.get<bool>(1) == false); + assert(db2.get<int32_t>(2) == 234); + assert(db2.get<int8_t>(3) == 56); + assert(db2.is_empty(4)); + + // Start over. + db1 = mtv_type(5, false); + db2 = mtv_type(6); + db1.set<int32_t>(4, 234); + db2.set<uint32_t>(0, 2345); + + db1.transfer(3, 4, db2, 4); + + assert(db1.get<bool>(0) == false); + assert(db1.get<bool>(1) == false); + assert(db1.get<bool>(2) == false); + assert(db1.is_empty(3)); + assert(db1.is_empty(4)); + + assert(db2.get<uint32_t>(0) == 2345); + assert(db2.is_empty(1)); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + assert(db2.get<bool>(4) == false); + assert(db2.get<int32_t>(5) == 234); + + // Start over + db1.clear(); + db2 = mtv_type(10); + db1.push_back<int8_t>(5); + db1.push_back<int16_t>(5); + db1.push_back<int32_t>(5); + db1.push_back<double>(5); + + db1.transfer(0, 3, db2, 6); + + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.is_empty(3)); + + assert(db2.is_empty(0)); + assert(db2.is_empty(1)); + assert(db2.is_empty(2)); + assert(db2.is_empty(3)); + assert(db2.is_empty(4)); + assert(db2.is_empty(5)); + assert(db2.get<int8_t>(6) == 5); + assert(db2.get<int16_t>(7) == 5); + assert(db2.get<int32_t>(8) == 5); + assert(db2.get<double>(9) == 5.0); + + // Start over. + db1 = mtv_type(5, true); + db2 = mtv_type(6); + + db1.transfer(0, 2, db2, 1); + + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.get<bool>(3) == true); + assert(db1.get<bool>(4) == true); + + assert(db2.is_empty(0)); + assert(db2.get<bool>(1) == true); + assert(db2.get<bool>(2) == true); + assert(db2.get<bool>(3) == true); + assert(db2.is_empty(4)); + assert(db2.is_empty(5)); + + // Start over. + db1 = mtv_type(5, int32_t(987)); + db1.set(3, 1.1); + db1.set(4, 1.2); + + db2 = mtv_type(5); + db2.set(0, true); + db2.set(1, false); + + db1.transfer(0, 2, db2, 2); + + assert(db1.is_empty(0)); + assert(db1.is_empty(1)); + assert(db1.is_empty(2)); + assert(db1.get<double>(3) == 1.1); + assert(db1.get<double>(4) == 1.2); + + assert(db2.get<bool>(0) == true); + assert(db2.get<bool>(1) == false); + assert(db2.get<int32_t>(2) == 987); + assert(db2.get<int32_t>(3) == 987); + assert(db2.get<int32_t>(4) == 987); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/Makefile.am b/test/multi_type_vector/element-blocks/Makefile.am new file mode 100644 index 0000000..db48655 --- /dev/null +++ b/test/multi_type_vector/element-blocks/Makefile.am @@ -0,0 +1,35 @@ + +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include + +check_PROGRAMS = test test-soa test-aos + +test_SOURCES = \ + test_main.cpp \ + test_basic.cpp \ + test_std_vector_bool.cpp \ + test_store_types.cpp \ + test_functions.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_soa_SOURCES = \ + test_soa.cpp \ + test_no_standard_blocks_soa.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_aos_SOURCES = \ + test_aos.cpp \ + test_no_standard_blocks_aos.cpp \ + $(top_srcdir)/test/test_global.cpp + +EXTRA_DIST = \ + no_standard_blocks_defs.inl \ + no_standard_blocks_funcs.inl \ + test_soa.hpp \ + test_aos.hpp \ + test_main.hpp + +TESTS = test test-soa test-aos + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/element-blocks/Makefile.in b/test/multi_type_vector/element-blocks/Makefile.in new file mode 100644 index 0000000..9a032d1 --- /dev/null +++ b/test/multi_type_vector/element-blocks/Makefile.in @@ -0,0 +1,1073 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test$(EXEEXT) test-soa$(EXEEXT) test-aos$(EXEEXT) +TESTS = test$(EXEEXT) test-soa$(EXEEXT) test-aos$(EXEEXT) +subdir = test/multi_type_vector/element-blocks +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_OBJECTS = test_main.$(OBJEXT) test_basic.$(OBJEXT) \ + test_std_vector_bool.$(OBJEXT) test_store_types.$(OBJEXT) \ + test_functions.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_OBJECTS = $(am_test_OBJECTS) +test_LDADD = $(LDADD) +am_test_aos_OBJECTS = test_aos.$(OBJEXT) \ + test_no_standard_blocks_aos.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_aos_OBJECTS = $(am_test_aos_OBJECTS) +test_aos_LDADD = $(LDADD) +am_test_soa_OBJECTS = test_soa.$(OBJEXT) \ + test_no_standard_blocks_soa.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_soa_OBJECTS = $(am_test_soa_OBJECTS) +test_soa_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_aos.Po ./$(DEPDIR)/test_basic.Po \ + ./$(DEPDIR)/test_functions.Po ./$(DEPDIR)/test_main.Po \ + ./$(DEPDIR)/test_no_standard_blocks_aos.Po \ + ./$(DEPDIR)/test_no_standard_blocks_soa.Po \ + ./$(DEPDIR)/test_soa.Po ./$(DEPDIR)/test_std_vector_bool.Po \ + ./$(DEPDIR)/test_store_types.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_SOURCES) $(test_aos_SOURCES) $(test_soa_SOURCES) +DIST_SOURCES = $(test_SOURCES) $(test_aos_SOURCES) $(test_soa_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include + +test_SOURCES = \ + test_main.cpp \ + test_basic.cpp \ + test_std_vector_bool.cpp \ + test_store_types.cpp \ + test_functions.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_soa_SOURCES = \ + test_soa.cpp \ + test_no_standard_blocks_soa.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_aos_SOURCES = \ + test_aos.cpp \ + test_no_standard_blocks_aos.cpp \ + $(top_srcdir)/test/test_global.cpp + +EXTRA_DIST = \ + no_standard_blocks_defs.inl \ + no_standard_blocks_funcs.inl \ + test_soa.hpp \ + test_aos.hpp \ + test_main.hpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/element-blocks/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/element-blocks/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) + @rm -f test$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + +test-aos$(EXEEXT): $(test_aos_OBJECTS) $(test_aos_DEPENDENCIES) $(EXTRA_test_aos_DEPENDENCIES) + @rm -f test-aos$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_aos_OBJECTS) $(test_aos_LDADD) $(LIBS) + +test-soa$(EXEEXT): $(test_soa_OBJECTS) $(test_soa_DEPENDENCIES) $(EXTRA_test_soa_DEPENDENCIES) + @rm -f test-soa$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_soa_OBJECTS) $(test_soa_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_aos.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_basic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_functions.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_no_standard_blocks_aos.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_no_standard_blocks_soa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_soa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_std_vector_bool.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_store_types.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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.log: test$(EXEEXT) + @p='test$(EXEEXT)'; \ + b='test'; \ + $(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-soa.log: test-soa$(EXEEXT) + @p='test-soa$(EXEEXT)'; \ + b='test-soa'; \ + $(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-aos.log: test-aos$(EXEEXT) + @p='test-aos$(EXEEXT)'; \ + b='test-aos'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_aos.Po + -rm -f ./$(DEPDIR)/test_basic.Po + -rm -f ./$(DEPDIR)/test_functions.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f ./$(DEPDIR)/test_no_standard_blocks_aos.Po + -rm -f ./$(DEPDIR)/test_no_standard_blocks_soa.Po + -rm -f ./$(DEPDIR)/test_soa.Po + -rm -f ./$(DEPDIR)/test_std_vector_bool.Po + -rm -f ./$(DEPDIR)/test_store_types.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_aos.Po + -rm -f ./$(DEPDIR)/test_basic.Po + -rm -f ./$(DEPDIR)/test_functions.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f ./$(DEPDIR)/test_no_standard_blocks_aos.Po + -rm -f ./$(DEPDIR)/test_no_standard_blocks_soa.Po + -rm -f ./$(DEPDIR)/test_soa.Po + -rm -f ./$(DEPDIR)/test_std_vector_bool.Po + -rm -f ./$(DEPDIR)/test_store_types.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/element-blocks/no_standard_blocks_defs.inl b/test/multi_type_vector/element-blocks/no_standard_blocks_defs.inl new file mode 100644 index 0000000..1d8b90f --- /dev/null +++ b/test/multi_type_vector/element-blocks/no_standard_blocks_defs.inl @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +// NB: Code in this file must be soa vs aos neutral, and occurs before the +// inclusion of the header that defines multi_type_vector. + +#include <mdds/global.hpp> +#include <mdds/multi_type_vector/block_funcs.hpp> +#include <mdds/multi_type_vector/util.hpp> +#include <mdds/multi_type_vector/macro.hpp> + +#include <deque> +#include <vector> +#include <type_traits> + +namespace mdds { namespace mtv { + +// These variables are defined in the header, so if it's included it should +// cause a compiler error. +constexpr element_t element_type_boolean = element_type_user_start; +constexpr element_t element_type_int32 = element_type_user_start + 1; +constexpr element_t element_type_uint32 = element_type_user_start + 2; + +using boolean_element_block = default_element_block<element_type_boolean, bool, std::deque>; +using int32_element_block = default_element_block<element_type_int32, std::int32_t, std::vector>; +using uint32_element_block = default_element_block<element_type_uint32, std::uint32_t, delayed_delete_vector>; + +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(bool, element_type_boolean, false, boolean_element_block) +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(std::int32_t, element_type_int32, 0, int32_element_block) +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(std::uint32_t, element_type_uint32, 0, uint32_element_block) + +struct standard_element_blocks_traits; +static_assert( + !mdds::detail::is_complete<standard_element_blocks_traits>::value, + "The standard_element_blocks_traits struct should not have been defined."); + +}} // namespace mdds::mtv + +static_assert(std::is_same_v<mdds::mtv::boolean_element_block::store_type, std::deque<bool>>); +static_assert(std::is_same_v<mdds::mtv::int32_element_block::store_type, std::vector<std::int32_t>>); +static_assert( + std::is_same_v<mdds::mtv::uint32_element_block::store_type, mdds::mtv::delayed_delete_vector<std::uint32_t>>); + +struct my_trait : mdds::mtv::default_traits +{ + using block_funcs = mdds::mtv::element_block_funcs< + mdds::mtv::boolean_element_block, mdds::mtv::int32_element_block, mdds::mtv::uint32_element_block>; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/no_standard_blocks_funcs.inl b/test/multi_type_vector/element-blocks/no_standard_blocks_funcs.inl new file mode 100644 index 0000000..84a1f88 --- /dev/null +++ b/test/multi_type_vector/element-blocks/no_standard_blocks_funcs.inl @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +void test_mtv_basic() +{ + using this_mtv_type = mtv_type<my_trait>; + + this_mtv_type db{}; + + db.push_back(true); + db.push_back(false); + db.push_back<std::int32_t>(123); + db.push_back<std::uint32_t>(456u); + + assert(db.size() == 4); + assert(db.block_size() == 3); + assert(db.get<bool>(0) == true); + assert(db.get<bool>(1) == false); + assert(db.get<std::int32_t>(2) == 123); + assert(db.get<std::uint32_t>(3) == 456u); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_aos.cpp b/test/multi_type_vector/element-blocks/test_aos.cpp new file mode 100644 index 0000000..cff3488 --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_aos.cpp @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_aos.hpp" + +int main() +{ + test_mtv_basic(); + + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_aos.hpp b/test/multi_type_vector/element-blocks/test_aos.hpp new file mode 100644 index 0000000..496a0ed --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_aos.hpp @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#include "test_global.hpp" // This must be the first header to be included. + +void test_mtv_basic(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_basic.cpp b/test/multi_type_vector/element-blocks/test_basic.cpp new file mode 100644 index 0000000..0d69a3a --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_basic.cpp @@ -0,0 +1,46 @@ + +#include "test_main.hpp" + +#include <mdds/multi_type_vector/types.hpp> +#include <mdds/multi_type_vector.hpp> + +constexpr mdds::mtv::element_t type_1 = mdds::mtv::element_type_user_start; +constexpr mdds::mtv::element_t type_2 = mdds::mtv::element_type_user_start + 1; +constexpr mdds::mtv::element_t type_3 = mdds::mtv::element_type_user_start + 2; +constexpr mdds::mtv::element_t type_4 = mdds::mtv::element_type_user_start + 3; + +struct my_type_1 +{ +}; +struct my_type_2 +{ +}; +struct my_type_3 +{ +}; + +// Make sure these three block types can be instantiated without compile errors. +using my_block1 = mdds::mtv::default_element_block<type_1, my_type_1>; +using my_block2 = mdds::mtv::managed_element_block<type_2, my_type_2>; +using my_block3 = mdds::mtv::noncopyable_managed_element_block<type_3, my_type_3>; + +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(my_type_1, type_1, my_type_1{}, my_block1) +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS_PTR(my_type_2, type_2, nullptr, my_block2) +MDDS_MTV_DEFINE_ELEMENT_CALLBACKS_PTR(my_type_3, type_3, nullptr, my_block3) + +struct my_trait : mdds::mtv::default_traits +{ + using block_funcs = mdds::mtv::element_block_funcs<my_block1, my_block2, my_block3>; +}; + +using mtv_type = mdds::multi_type_vector<my_trait>; + +void mtv_test_element_blocks_buildability() +{ + stack_printer __stack_printer__(__func__); + + mtv_type con(20); + con.set(0, my_type_1{}); + con.set(1, new my_type_2); + con.set(2, new my_type_3); +} diff --git a/test/multi_type_vector/element-blocks/test_functions.cpp b/test/multi_type_vector/element-blocks/test_functions.cpp new file mode 100644 index 0000000..7dc8aae --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_functions.cpp @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2023 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_main.hpp" + +#include <mdds/multi_type_vector/types.hpp> + +#include <vector> +#include <iostream> + +void mtv_test_element_blocks_range() +{ + stack_printer __stack_printer__(__func__); + + constexpr mdds::mtv::element_t element_type_int32 = mdds::mtv::element_type_user_start + 2; + using block_type = mdds::mtv::default_element_block<element_type_int32, std::int32_t, std::vector>; + + const std::vector<std::int8_t> values = {1, 2, 3, 4, 5}; + auto blk = block_type(values.begin(), values.end()); + const auto& crblk = blk; + + assert(block_type::size(blk) == 5u); + + { + auto it = block_type::begin(blk), it_end = block_type::end(blk); + assert(std::distance(it, it_end) == 5u); + assert(*it++ == 1); + assert(*it++ == 2); + assert(*it++ == 3); + assert(*it++ == 4); + assert(*it++ == 5); + assert(it == it_end); + } + + { + // immutable range access + auto it = block_type::begin(crblk); + for (auto v : block_type::range(crblk)) + { + std::cout << "v=" << v << std::endl; + assert(v == *it++); + } + + assert(it == block_type::end(crblk)); + } + + { + // mutable range access + auto it = block_type::begin(blk); + for (auto v : block_type::range(blk)) + { + std::cout << "v=" << v << std::endl; + assert(v == *it); + *it = v + 2; + ++it; + } + + assert(it == block_type::end(blk)); + + it = block_type::begin(blk); + assert(*it++ == 3); + assert(*it++ == 4); + assert(*it++ == 5); + assert(*it++ == 6); + assert(*it++ == 7); + assert(it == block_type::end(blk)); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_main.cpp b/test/multi_type_vector/element-blocks/test_main.cpp new file mode 100644 index 0000000..b666679 --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_main.cpp @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_main.hpp" + +int main() +{ + try + { + mtv_test_element_blocks_buildability(); + mtv_test_element_blocks_std_vector(); + mtv_test_element_blocks_std_deque(); + mtv_test_element_blocks_std_vector_bool(); + mtv_test_element_blocks_std_deque_bool(); + mtv_test_element_blocks_delayed_delete_vector_bool(); + mtv_test_element_blocks_range(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_main.hpp b/test/multi_type_vector/element-blocks/test_main.hpp new file mode 100644 index 0000000..e926af2 --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_main.hpp @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#include "test_global.hpp" // This must be the first header to be included. + +// We don't include any multi_type_vector specific headers here in order to +// test features controlled by preprocessor defines. + +void mtv_test_element_blocks_buildability(); +void mtv_test_element_blocks_std_vector(); +void mtv_test_element_blocks_std_deque(); +void mtv_test_element_blocks_std_vector_bool(); +void mtv_test_element_blocks_std_deque_bool(); +void mtv_test_element_blocks_delayed_delete_vector_bool(); +void mtv_test_element_blocks_range(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_no_standard_blocks_aos.cpp b/test/multi_type_vector/element-blocks/test_no_standard_blocks_aos.cpp new file mode 100644 index 0000000..3612d0e --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_no_standard_blocks_aos.cpp @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "no_standard_blocks_defs.inl" + +// Settting this to 0 should make the multi_type_vector code to NOT include +// the header for the standard element blocks. +#define MDDS_MTV_USE_STANDARD_ELEMENT_BLOCKS 0 +#include <mdds/multi_type_vector/aos/main.hpp> + +template<typename... Ts> +using mtv_type = mdds::mtv::aos::multi_type_vector<Ts...>; + +#include "no_standard_blocks_funcs.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_no_standard_blocks_soa.cpp b/test/multi_type_vector/element-blocks/test_no_standard_blocks_soa.cpp new file mode 100644 index 0000000..e6eaedd --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_no_standard_blocks_soa.cpp @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "no_standard_blocks_defs.inl" + +// Settting this to 0 should make the multi_type_vector code to NOT include +// the header for the standard element blocks. +#define MDDS_MTV_USE_STANDARD_ELEMENT_BLOCKS 0 +#include <mdds/multi_type_vector/soa/main.hpp> + +template<typename... Ts> +using mtv_type = mdds::mtv::soa::multi_type_vector<Ts...>; + +#include "no_standard_blocks_funcs.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_soa.cpp b/test/multi_type_vector/element-blocks/test_soa.cpp new file mode 100644 index 0000000..e034ded --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_soa.cpp @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_soa.hpp" + +int main() +{ + test_mtv_basic(); + + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_soa.hpp b/test/multi_type_vector/element-blocks/test_soa.hpp new file mode 100644 index 0000000..496a0ed --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_soa.hpp @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#include "test_global.hpp" // This must be the first header to be included. + +void test_mtv_basic(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_std_vector_bool.cpp b/test/multi_type_vector/element-blocks/test_std_vector_bool.cpp new file mode 100644 index 0000000..f37b6e7 --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_std_vector_bool.cpp @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_main.hpp" + +#include <mdds/multi_type_vector/types.hpp> +#include <mdds/multi_type_vector/block_funcs.hpp> + +#include <vector> +#include <deque> + +void mtv_test_element_blocks_std_vector_bool() +{ + stack_printer __stack_printer__(__func__); + + constexpr mdds::mtv::element_t element_type_bool = mdds::mtv::element_type_user_start + 3; + using this_block = mdds::mtv::default_element_block<element_type_bool, bool, std::vector>; + + static_assert(this_block::block_type == element_type_bool); + static_assert(mdds::mtv::detail::has_std_vector_bool_store<this_block>::type::value); + + auto* blk = this_block::create_block(10); + + [[maybe_unused]] auto v = mdds::mtv::detail::get_block_element_at<this_block>(*blk, 2); + + this_block::delete_block(blk); +} + +void mtv_test_element_blocks_std_deque_bool() +{ + stack_printer __stack_printer__(__func__); + + constexpr mdds::mtv::element_t element_type_bool = mdds::mtv::element_type_user_start + 2; + using this_block = mdds::mtv::default_element_block<element_type_bool, bool, std::deque>; + + static_assert(this_block::block_type == element_type_bool); + static_assert(!mdds::mtv::detail::has_std_vector_bool_store<this_block>::type::value); + + auto* blk = this_block::create_block(10); + + [[maybe_unused]] auto v = mdds::mtv::detail::get_block_element_at<this_block>(*blk, 2); + + this_block::delete_block(blk); +} + +void mtv_test_element_blocks_delayed_delete_vector_bool() +{ + stack_printer __stack_printer__(__func__); + + constexpr mdds::mtv::element_t element_type_bool = mdds::mtv::element_type_user_start + 1; + using this_block = mdds::mtv::default_element_block<element_type_bool, bool, mdds::mtv::delayed_delete_vector>; + + static_assert(this_block::block_type == element_type_bool); + static_assert(mdds::mtv::detail::has_std_vector_bool_store<this_block>::type::value); + + auto* blk = this_block::create_block(10); + + [[maybe_unused]] auto v = mdds::mtv::detail::get_block_element_at<this_block>(*blk, 2); + + this_block::delete_block(blk); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/element-blocks/test_store_types.cpp b/test/multi_type_vector/element-blocks/test_store_types.cpp new file mode 100644 index 0000000..e98a1c9 --- /dev/null +++ b/test/multi_type_vector/element-blocks/test_store_types.cpp @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_main.hpp" + +#include <mdds/multi_type_vector/types.hpp> +#include <mdds/multi_type_vector/block_funcs.hpp> + +#include <vector> +#include <deque> +#include <type_traits> + +void mtv_test_element_blocks_std_vector() +{ + stack_printer __stack_printer__(__func__); + + constexpr mdds::mtv::element_t element_type_int8 = mdds::mtv::element_type_user_start + 2; + using this_block = mdds::mtv::default_element_block<element_type_int8, std::int8_t, std::vector>; + + static_assert(this_block::block_type == element_type_int8); + static_assert(std::is_same_v<this_block::store_type, std::vector<std::int8_t>>); + + auto* blk = this_block::create_block(10); + + assert(mdds::mtv::get_block_type(*blk) == this_block::block_type); + assert(this_block::size(*blk) == 10u); + + auto cap = this_block::capacity(*blk); + assert(cap >= 10u); + + this_block::reserve(*blk, 100u); + cap = this_block::capacity(*blk); + assert(cap >= 100u); + + this_block::shrink_to_fit(*blk); + + this_block::delete_block(blk); +} + +void mtv_test_element_blocks_std_deque() +{ + stack_printer __stack_printer__(__func__); + + constexpr mdds::mtv::element_t element_type_int8 = mdds::mtv::element_type_user_start + 20; + using this_block = mdds::mtv::default_element_block<element_type_int8, std::int8_t, std::deque>; + + static_assert(this_block::block_type == element_type_int8); + static_assert(std::is_same_v<this_block::store_type, std::deque<std::int8_t>>); + + auto* blk = this_block::create_block(10); + + assert(mdds::mtv::get_block_type(*blk) == this_block::block_type); + assert(this_block::size(*blk) == 10u); + + // std::deque does not have a capacity() method, but this should still compile. + [[maybe_unused]] auto cap = this_block::capacity(*blk); + + // std::deque does not have a reserve() method either. + this_block::reserve(*blk, 100u); + + // ditto with shrink_to_fit() + this_block::shrink_to_fit(*blk); + + this_block::delete_block(blk); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/Makefile.am b/test/multi_type_vector/event/Makefile.am new file mode 100644 index 0000000..ddfbe44 --- /dev/null +++ b/test/multi_type_vector/event/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = aos soa tc diff --git a/test/multi_type_vector/event/Makefile.in b/test/multi_type_vector/event/Makefile.in new file mode 100644 index 0000000..5d17fea --- /dev/null +++ b/test/multi_type_vector/event/Makefile.in @@ -0,0 +1,638 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/event +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +SUBDIRS = aos soa tc +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/event/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/event/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +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 + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-recursive + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-generic cscopelist-am ctags ctags-am distclean \ + distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/event/aos/Makefile.am b/test/multi_type_vector/event/aos/Makefile.am new file mode 100644 index 0000000..225da82 --- /dev/null +++ b/test/multi_type_vector/event/aos/Makefile.am @@ -0,0 +1,23 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + test_block_counter.cpp \ + test_block_init.cpp \ + test_swap.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/event/aos/Makefile.in b/test/multi_type_vector/event/aos/Makefile.in new file mode 100644 index 0000000..65d83ba --- /dev/null +++ b/test/multi_type_vector/event/aos/Makefile.in @@ -0,0 +1,1088 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/multi_type_vector/event/aos +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main-test_main.$(OBJEXT) \ + test_main-test_block_counter.$(OBJEXT) \ + test_main-test_block_init.$(OBJEXT) \ + test_main-test_swap.$(OBJEXT) \ + $(top_builddir)/test/test_main-test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po \ + ./$(DEPDIR)/test_main-test_block_counter.Po \ + ./$(DEPDIR)/test_main-test_block_init.Po \ + ./$(DEPDIR)/test_main-test_main.Po \ + ./$(DEPDIR)/test_main-test_swap.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + test_block_counter.cpp \ + test_block_init.cpp \ + test_swap.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/event/aos/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/event/aos/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_main-test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_block_counter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_block_init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_swap.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_main-test_main.o: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.o -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp + +test_main-test_main.obj: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.obj -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` + +test_main-test_block_counter.o: test_block_counter.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_block_counter.o -MD -MP -MF $(DEPDIR)/test_main-test_block_counter.Tpo -c -o test_main-test_block_counter.o `test -f 'test_block_counter.cpp' || echo '$(srcdir)/'`test_block_counter.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_block_counter.Tpo $(DEPDIR)/test_main-test_block_counter.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_block_counter.cpp' object='test_main-test_block_counter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_block_counter.o `test -f 'test_block_counter.cpp' || echo '$(srcdir)/'`test_block_counter.cpp + +test_main-test_block_counter.obj: test_block_counter.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_block_counter.obj -MD -MP -MF $(DEPDIR)/test_main-test_block_counter.Tpo -c -o test_main-test_block_counter.obj `if test -f 'test_block_counter.cpp'; then $(CYGPATH_W) 'test_block_counter.cpp'; else $(CYGPATH_W) '$(srcdir)/test_block_counter.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_block_counter.Tpo $(DEPDIR)/test_main-test_block_counter.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_block_counter.cpp' object='test_main-test_block_counter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_block_counter.obj `if test -f 'test_block_counter.cpp'; then $(CYGPATH_W) 'test_block_counter.cpp'; else $(CYGPATH_W) '$(srcdir)/test_block_counter.cpp'; fi` + +test_main-test_block_init.o: test_block_init.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_block_init.o -MD -MP -MF $(DEPDIR)/test_main-test_block_init.Tpo -c -o test_main-test_block_init.o `test -f 'test_block_init.cpp' || echo '$(srcdir)/'`test_block_init.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_block_init.Tpo $(DEPDIR)/test_main-test_block_init.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_block_init.cpp' object='test_main-test_block_init.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_block_init.o `test -f 'test_block_init.cpp' || echo '$(srcdir)/'`test_block_init.cpp + +test_main-test_block_init.obj: test_block_init.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_block_init.obj -MD -MP -MF $(DEPDIR)/test_main-test_block_init.Tpo -c -o test_main-test_block_init.obj `if test -f 'test_block_init.cpp'; then $(CYGPATH_W) 'test_block_init.cpp'; else $(CYGPATH_W) '$(srcdir)/test_block_init.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_block_init.Tpo $(DEPDIR)/test_main-test_block_init.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_block_init.cpp' object='test_main-test_block_init.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_block_init.obj `if test -f 'test_block_init.cpp'; then $(CYGPATH_W) 'test_block_init.cpp'; else $(CYGPATH_W) '$(srcdir)/test_block_init.cpp'; fi` + +test_main-test_swap.o: test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap.o -MD -MP -MF $(DEPDIR)/test_main-test_swap.Tpo -c -o test_main-test_swap.o `test -f 'test_swap.cpp' || echo '$(srcdir)/'`test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap.Tpo $(DEPDIR)/test_main-test_swap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap.cpp' object='test_main-test_swap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap.o `test -f 'test_swap.cpp' || echo '$(srcdir)/'`test_swap.cpp + +test_main-test_swap.obj: test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap.obj -MD -MP -MF $(DEPDIR)/test_main-test_swap.Tpo -c -o test_main-test_swap.obj `if test -f 'test_swap.cpp'; then $(CYGPATH_W) 'test_swap.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap.Tpo $(DEPDIR)/test_main-test_swap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap.cpp' object='test_main-test_swap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap.obj `if test -f 'test_swap.cpp'; then $(CYGPATH_W) 'test_swap.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap.cpp'; fi` + +$(top_builddir)/test/test_main-test_global.o: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.o -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp + +$(top_builddir)/test/test_main-test_global.obj: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.obj -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_block_counter.Po + -rm -f ./$(DEPDIR)/test_main-test_block_init.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_swap.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_block_counter.Po + -rm -f ./$(DEPDIR)/test_main-test_block_init.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_swap.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/event/aos/test_block_counter.cpp b/test/multi_type_vector/event/aos/test_block_counter.cpp new file mode 100644 index 0000000..dfe18e7 --- /dev/null +++ b/test/multi_type_vector/event/aos/test_block_counter.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "block_counter.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/aos/test_block_init.cpp b/test/multi_type_vector/event/aos/test_block_init.cpp new file mode 100644 index 0000000..c4fad26 --- /dev/null +++ b/test/multi_type_vector/event/aos/test_block_init.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "block_init.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/aos/test_main.cpp b/test/multi_type_vector/event/aos/test_main.cpp new file mode 100644 index 0000000..d3c2861 --- /dev/null +++ b/test/multi_type_vector/event/aos/test_main.cpp @@ -0,0 +1,47 @@ +/************************************************************************* + * + * Copyright (c) 2015 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +int main() +{ + try + { + mtv_test_block_counter(); + mtv_test_block_init(); + mtv_test_swap(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} diff --git a/test/multi_type_vector/event/aos/test_main.hpp b/test/multi_type_vector/event/aos/test_main.hpp new file mode 100644 index 0000000..24a26e0 --- /dev/null +++ b/test/multi_type_vector/event/aos/test_main.hpp @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/aos/main.hpp> + +#include <iostream> +#include <vector> + +template<typename Traits> +using mtv_template_type = mdds::mtv::aos::multi_type_vector<Traits>; + +void mtv_test_block_counter(); +void mtv_test_block_init(); +void mtv_test_swap(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/aos/test_swap.cpp b/test/multi_type_vector/event/aos/test_swap.cpp new file mode 100644 index 0000000..bc7ad88 --- /dev/null +++ b/test/multi_type_vector/event/aos/test_swap.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "swap.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/soa/Makefile.am b/test/multi_type_vector/event/soa/Makefile.am new file mode 100644 index 0000000..225da82 --- /dev/null +++ b/test/multi_type_vector/event/soa/Makefile.am @@ -0,0 +1,23 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + test_block_counter.cpp \ + test_block_init.cpp \ + test_swap.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/multi_type_vector/event/soa/Makefile.in b/test/multi_type_vector/event/soa/Makefile.in new file mode 100644 index 0000000..7679f69 --- /dev/null +++ b/test/multi_type_vector/event/soa/Makefile.in @@ -0,0 +1,1088 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/multi_type_vector/event/soa +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main-test_main.$(OBJEXT) \ + test_main-test_block_counter.$(OBJEXT) \ + test_main-test_block_init.$(OBJEXT) \ + test_main-test_swap.$(OBJEXT) \ + $(top_builddir)/test/test_main-test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po \ + ./$(DEPDIR)/test_main-test_block_counter.Po \ + ./$(DEPDIR)/test_main-test_block_init.Po \ + ./$(DEPDIR)/test_main-test_main.Po \ + ./$(DEPDIR)/test_main-test_swap.Po +am__mv = mv -f +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 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + test_block_counter.cpp \ + test_block_init.cpp \ + test_swap.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_CPPFLAGS = \ + -I$(srcdir)/../tc \ + $(AM_CPPFLAGS) + +EXTRA_DIST = test_main.hpp +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/event/soa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/event/soa/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_main-test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_block_counter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_block_init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main-test_swap.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_main-test_main.o: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.o -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.o `test -f 'test_main.cpp' || echo '$(srcdir)/'`test_main.cpp + +test_main-test_main.obj: test_main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_main.obj -MD -MP -MF $(DEPDIR)/test_main-test_main.Tpo -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_main.Tpo $(DEPDIR)/test_main-test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_main.cpp' object='test_main-test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_main.obj `if test -f 'test_main.cpp'; then $(CYGPATH_W) 'test_main.cpp'; else $(CYGPATH_W) '$(srcdir)/test_main.cpp'; fi` + +test_main-test_block_counter.o: test_block_counter.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_block_counter.o -MD -MP -MF $(DEPDIR)/test_main-test_block_counter.Tpo -c -o test_main-test_block_counter.o `test -f 'test_block_counter.cpp' || echo '$(srcdir)/'`test_block_counter.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_block_counter.Tpo $(DEPDIR)/test_main-test_block_counter.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_block_counter.cpp' object='test_main-test_block_counter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_block_counter.o `test -f 'test_block_counter.cpp' || echo '$(srcdir)/'`test_block_counter.cpp + +test_main-test_block_counter.obj: test_block_counter.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_block_counter.obj -MD -MP -MF $(DEPDIR)/test_main-test_block_counter.Tpo -c -o test_main-test_block_counter.obj `if test -f 'test_block_counter.cpp'; then $(CYGPATH_W) 'test_block_counter.cpp'; else $(CYGPATH_W) '$(srcdir)/test_block_counter.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_block_counter.Tpo $(DEPDIR)/test_main-test_block_counter.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_block_counter.cpp' object='test_main-test_block_counter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_block_counter.obj `if test -f 'test_block_counter.cpp'; then $(CYGPATH_W) 'test_block_counter.cpp'; else $(CYGPATH_W) '$(srcdir)/test_block_counter.cpp'; fi` + +test_main-test_block_init.o: test_block_init.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_block_init.o -MD -MP -MF $(DEPDIR)/test_main-test_block_init.Tpo -c -o test_main-test_block_init.o `test -f 'test_block_init.cpp' || echo '$(srcdir)/'`test_block_init.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_block_init.Tpo $(DEPDIR)/test_main-test_block_init.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_block_init.cpp' object='test_main-test_block_init.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_block_init.o `test -f 'test_block_init.cpp' || echo '$(srcdir)/'`test_block_init.cpp + +test_main-test_block_init.obj: test_block_init.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_block_init.obj -MD -MP -MF $(DEPDIR)/test_main-test_block_init.Tpo -c -o test_main-test_block_init.obj `if test -f 'test_block_init.cpp'; then $(CYGPATH_W) 'test_block_init.cpp'; else $(CYGPATH_W) '$(srcdir)/test_block_init.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_block_init.Tpo $(DEPDIR)/test_main-test_block_init.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_block_init.cpp' object='test_main-test_block_init.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_block_init.obj `if test -f 'test_block_init.cpp'; then $(CYGPATH_W) 'test_block_init.cpp'; else $(CYGPATH_W) '$(srcdir)/test_block_init.cpp'; fi` + +test_main-test_swap.o: test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap.o -MD -MP -MF $(DEPDIR)/test_main-test_swap.Tpo -c -o test_main-test_swap.o `test -f 'test_swap.cpp' || echo '$(srcdir)/'`test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap.Tpo $(DEPDIR)/test_main-test_swap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap.cpp' object='test_main-test_swap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap.o `test -f 'test_swap.cpp' || echo '$(srcdir)/'`test_swap.cpp + +test_main-test_swap.obj: test_swap.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_main-test_swap.obj -MD -MP -MF $(DEPDIR)/test_main-test_swap.Tpo -c -o test_main-test_swap.obj `if test -f 'test_swap.cpp'; then $(CYGPATH_W) 'test_swap.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main-test_swap.Tpo $(DEPDIR)/test_main-test_swap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_swap.cpp' object='test_main-test_swap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_main-test_swap.obj `if test -f 'test_swap.cpp'; then $(CYGPATH_W) 'test_swap.cpp'; else $(CYGPATH_W) '$(srcdir)/test_swap.cpp'; fi` + +$(top_builddir)/test/test_main-test_global.o: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.o -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.o `test -f '$(top_builddir)/test/test_global.cpp' || echo '$(srcdir)/'`$(top_builddir)/test/test_global.cpp + +$(top_builddir)/test/test_main-test_global.obj: $(top_builddir)/test/test_global.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT $(top_builddir)/test/test_main-test_global.obj -MD -MP -MF $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Tpo $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_builddir)/test/test_global.cpp' object='$(top_builddir)/test/test_main-test_global.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_main_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $(top_builddir)/test/test_main-test_global.obj `if test -f '$(top_builddir)/test/test_global.cpp'; then $(CYGPATH_W) '$(top_builddir)/test/test_global.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/test/test_global.cpp'; fi` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_block_counter.Po + -rm -f ./$(DEPDIR)/test_main-test_block_init.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_swap.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_main-test_global.Po + -rm -f ./$(DEPDIR)/test_main-test_block_counter.Po + -rm -f ./$(DEPDIR)/test_main-test_block_init.Po + -rm -f ./$(DEPDIR)/test_main-test_main.Po + -rm -f ./$(DEPDIR)/test_main-test_swap.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/multi_type_vector/event/soa/test_block_counter.cpp b/test/multi_type_vector/event/soa/test_block_counter.cpp new file mode 100644 index 0000000..dfe18e7 --- /dev/null +++ b/test/multi_type_vector/event/soa/test_block_counter.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "block_counter.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/soa/test_block_init.cpp b/test/multi_type_vector/event/soa/test_block_init.cpp new file mode 100644 index 0000000..c4fad26 --- /dev/null +++ b/test/multi_type_vector/event/soa/test_block_init.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "block_init.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/soa/test_main.cpp b/test/multi_type_vector/event/soa/test_main.cpp new file mode 100644 index 0000000..2301d61 --- /dev/null +++ b/test/multi_type_vector/event/soa/test_main.cpp @@ -0,0 +1,46 @@ +/************************************************************************* + * + * Copyright (c) 2015 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +int main() +{ + try + { + mtv_test_block_counter(); + mtv_test_block_init(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} diff --git a/test/multi_type_vector/event/soa/test_main.hpp b/test/multi_type_vector/event/soa/test_main.hpp new file mode 100644 index 0000000..78ea1e6 --- /dev/null +++ b/test/multi_type_vector/event/soa/test_main.hpp @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#pragma once + +#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1 +#include <mdds/multi_type_vector/soa/main.hpp> + +#include <iostream> +#include <vector> + +template<typename Traits> +using mtv_template_type = mdds::mtv::soa::multi_type_vector<Traits>; + +void mtv_test_block_counter(); +void mtv_test_block_init(); +void mtv_test_swap(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/soa/test_swap.cpp b/test/multi_type_vector/event/soa/test_swap.cpp new file mode 100644 index 0000000..bc7ad88 --- /dev/null +++ b/test/multi_type_vector/event/soa/test_swap.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_main.hpp" + +#include "swap.inl" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/tc/Makefile.am b/test/multi_type_vector/event/tc/Makefile.am new file mode 100644 index 0000000..3e84c57 --- /dev/null +++ b/test/multi_type_vector/event/tc/Makefile.am @@ -0,0 +1,4 @@ +EXTRA_DIST = \ + block_counter.inl \ + block_init.inl \ + swap.inl diff --git a/test/multi_type_vector/event/tc/Makefile.in b/test/multi_type_vector/event/tc/Makefile.in new file mode 100644 index 0000000..5232a12 --- /dev/null +++ b/test/multi_type_vector/event/tc/Makefile.in @@ -0,0 +1,464 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test/multi_type_vector/event/tc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +EXTRA_DIST = \ + block_counter.inl \ + block_init.inl \ + swap.inl + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/event/tc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/event/tc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am check-valgrind-am \ + check-valgrind-drd-am check-valgrind-drd-local \ + check-valgrind-helgrind-am check-valgrind-helgrind-local \ + check-valgrind-local check-valgrind-memcheck-am \ + check-valgrind-memcheck-local check-valgrind-sgcheck-am \ + check-valgrind-sgcheck-local clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic 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 \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/event/tc/block_counter.inl b/test/multi_type_vector/event/tc/block_counter.inl new file mode 100644 index 0000000..55794c7 --- /dev/null +++ b/test/multi_type_vector/event/tc/block_counter.inl @@ -0,0 +1,1118 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +struct event_block_counter +{ + size_t block_count; // number of element (data) blocks + size_t block_count_numeric; + size_t block_count_string; + size_t block_count_int16; + size_t block_count_uint16; + size_t block_count_int32; + size_t block_count_uint32; + size_t block_count_int64; + size_t block_count_uint64; + size_t block_count_boolean; + size_t block_count_int8; + size_t block_count_uint8; + + event_block_counter() + : block_count(0), block_count_numeric(0), block_count_string(0), block_count_int16(0), block_count_uint16(0), + block_count_int32(0), block_count_uint32(0), block_count_int64(0), block_count_uint64(0), + block_count_boolean(0), block_count_int8(0), block_count_uint8(0) + {} + + /** + * This copy constructor intentionally does not copy the counters. + */ + event_block_counter(const event_block_counter&) + : block_count(0), block_count_numeric(0), block_count_string(0), block_count_int16(0), block_count_uint16(0), + block_count_int32(0), block_count_uint32(0), block_count_int64(0), block_count_uint64(0), + block_count_boolean(0), block_count_int8(0), block_count_uint8(0) + {} + + void element_block_acquired(const mdds::mtv::base_element_block* block) + { + ++block_count; + + switch (mdds::mtv::get_block_type(*block)) + { + case mdds::mtv::element_type_double: + ++block_count_numeric; + break; + case mdds::mtv::element_type_string: + ++block_count_string; + break; + case mdds::mtv::element_type_int16: + ++block_count_int16; + break; + case mdds::mtv::element_type_uint16: + ++block_count_uint16; + break; + case mdds::mtv::element_type_int32: + ++block_count_int32; + break; + case mdds::mtv::element_type_uint32: + ++block_count_uint32; + break; + case mdds::mtv::element_type_int64: + ++block_count_int64; + break; + case mdds::mtv::element_type_uint64: + ++block_count_uint64; + break; + case mdds::mtv::element_type_boolean: + ++block_count_boolean; + break; + case mdds::mtv::element_type_int8: + ++block_count_int8; + break; + case mdds::mtv::element_type_uint8: + ++block_count_uint8; + break; + default:; + } + } + + void element_block_released(const mdds::mtv::base_element_block* block) + { + --block_count; + + switch (mdds::mtv::get_block_type(*block)) + { + case mdds::mtv::element_type_double: + --block_count_numeric; + break; + case mdds::mtv::element_type_string: + --block_count_string; + break; + case mdds::mtv::element_type_int16: + --block_count_int16; + break; + case mdds::mtv::element_type_uint16: + --block_count_uint16; + break; + case mdds::mtv::element_type_int32: + --block_count_int32; + break; + case mdds::mtv::element_type_uint32: + --block_count_uint32; + break; + case mdds::mtv::element_type_int64: + --block_count_int64; + break; + case mdds::mtv::element_type_uint64: + --block_count_uint64; + break; + case mdds::mtv::element_type_boolean: + --block_count_boolean; + break; + case mdds::mtv::element_type_int8: + --block_count_int8; + break; + case mdds::mtv::element_type_uint8: + --block_count_uint8; + break; + default:; + } + } +}; + +struct eb_counter_trait : public mdds::mtv::standard_element_blocks_traits +{ + using event_func = event_block_counter; + + constexpr static mdds::mtv::lu_factor_t loop_unrolling = mdds::mtv::lu_factor_t::lu8; +}; + +void mtv_test_block_counter() +{ + stack_printer __stack_printer__(__FUNCTION__); + + using mtv_type = mtv_template_type<eb_counter_trait>; + + { + // Initializing with an empty block should not create any element block. + mtv_type db(10); + assert(db.event_handler().block_count == 0); + } + + { + // Initializing with one element block of size 10. + mtv_type db(10, 1.2); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + db.clear(); + assert(db.event_handler().block_count == 0); + assert(db.event_handler().block_count_numeric == 0); + + db.push_back(5.5); // create a new block. + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + db.push_back(6.6); // no new block creation. + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + db.push_back(std::string("foo")); // another new block. + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_string == 1); + + // This should remove the last string block. + db.resize(2); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_string == 0); + + // This should have no effect on the block count. + db.resize(1); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + + // This should remove the last remaining block. + db.resize(0); + assert(db.event_handler().block_count == 0); + assert(db.event_handler().block_count_numeric == 0); + } + + { + mtv_type db(5); + assert(db.event_handler().block_count == 0); + + db.set(0, true); + assert(db.event_handler().block_count == 1); + db.set(1, 12.2); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_boolean == 1); + assert(db.event_handler().block_count_numeric == 1); + + db.set(4, std::string("foo")); + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_string == 1); + db.set(3, std::string("bar")); + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_string == 1); + + // This should delete the top two element blocks. + db.set_empty(0, 1); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_boolean == 0); + assert(db.event_handler().block_count_numeric == 0); + + // Now, delete the bottom one. + db.set_empty(3, 4); + assert(db.event_handler().block_count == 0); + assert(db.event_handler().block_count_string == 0); + + // Create and delete a block in the middle. + db.set(3, false); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_boolean == 1); + db.set_empty(3, 3); + assert(db.event_handler().block_count == 0); + assert(db.event_handler().block_count_boolean == 0); + + db.set(2, 10.5); + db.set(3, std::string("hmm")); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_string == 1); + db.set_empty(3, 3); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_string == 0); + + // Start over. + db.clear(); + assert(db.event_handler().block_count == 0); + + db.push_back(1.1); + db.push_back(1.2); + db.push_back(1.3); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + + // Put empty block in the middle. + db.set_empty(1, 1); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_numeric == 2); + } + + { + mtv_type db(4, 1.2); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + + // Split the block into two. + db.insert_empty(2, 2); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_numeric == 2); + } + + { + mtv_type db(2); + db.set(1, 1.2); // This creates a new element block. + assert(db.event_handler().block_count == 1); + db.set(0, 1.1); // The element block count should not change. + assert(db.event_handler().block_count == 1); + } + + { + mtv_type db(2); + db.set(1, std::string("test")); + assert(db.event_handler().block_count == 1); + db.set(0, 1.1); + assert(db.event_handler().block_count == 2); + db.set(0, true); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_boolean == 1); + assert(db.event_handler().block_count_string == 1); + + db.set(0, std::string("foo")); + assert(db.event_handler().block_count == 1); + + db.set(1, 1.2); + assert(db.event_handler().block_count == 2); + db.set(1, std::string("bar")); + assert(db.event_handler().block_count == 1); + } + + { + mtv_type db(2); + db.set(0, std::string("test")); // This creates a new string block. + assert(db.event_handler().block_count == 1); + db.set(1, std::string("foo")); // This appends to the existing string block. + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_string == 1); + } + + { + mtv_type db(3); + db.set(0, std::string("test")); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_string == 1); + db.set(2, std::string("foo")); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_string == 2); + db.set(1, std::string("bar")); // This merges all data into a single string block. + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_string == 1); + } + + { + mtv_type db(4); + db.set(0, std::string("test")); + assert(db.event_handler().block_count == 1); + db.set(2, std::string("foo1")); + assert(db.event_handler().block_count == 2); + db.set(3, std::string("foo2")); + assert(db.event_handler().block_count == 2); + db.set(1, std::string("bar")); // This merges all data into a single string block. + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_string == 1); + } + + { + mtv_type db(3); + db.set(0, std::string("test")); + assert(db.event_handler().block_count == 1); + db.set(2, 1.2); + assert(db.event_handler().block_count == 2); + db.set(1, std::string("bar")); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_string == 1); + } + + { + mtv_type db(3); + db.set(0, std::string("test")); + assert(db.event_handler().block_count == 1); + db.set(2, 1.2); + assert(db.event_handler().block_count == 2); + db.set(1, 1.1); // This will get prepended to the next numeric block. + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_string == 1); + } + + { + std::vector<double> vals = {1.1, 1.2, 1.3}; + mtv_type db(vals.size(), vals.begin(), vals.end()); + assert(db.event_handler().block_count == 1); + + mtv_type db2(db); + assert(db2.event_handler().block_count == 1); + db2.push_back(std::string("foo")); + assert(db2.event_handler().block_count == 2); + mtv_type db3 = db2; + assert(db3.event_handler().block_count == 2); + + mtv_type db4(3); + db4.insert(0, vals.begin(), vals.end()); + assert(db4.event_handler().block_count == 1); + + mtv_type db5(3, int64_t(10)); + assert(db5.event_handler().block_count == 1); + db5.insert(0, vals.begin(), vals.end()); + assert(db5.event_handler().block_count == 2); + + mtv_type db6(2, int32_t(30)); + assert(db6.event_handler().block_count == 1); + db6.insert(1, vals.begin(), vals.end()); // Insert to split the block. + assert(db6.event_handler().block_count == 3); + assert(db6.event_handler().block_count_int32 == 2); + assert(db6.event_handler().block_count_numeric == 1); + } + + { + mtv_type db(3); + db.set(1, 1.1); + db.set(2, true); + assert(db.event_handler().block_count == 2); + db.set(1, false); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_boolean == 1); + } + + { + mtv_type db(3); + db.set(1, 1.1); + db.set(0, true); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_boolean == 1); + assert(db.event_handler().block_count_numeric == 1); + db.set(1, false); + assert(db.event_handler().block_count == 1); + } + + { + mtv_type db(3); + db.set(0, true); + db.set(1, 1.1); + db.set(2, false); + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_boolean == 2); + assert(db.event_handler().block_count_numeric == 1); + db.set(1, true); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_boolean == 1); + + db.set(1, 1.1); + assert(db.event_handler().block_count == 3); + db.set(2, int64_t(10)); + db.set(1, true); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_boolean == 1); + assert(db.event_handler().block_count_int64 == 1); + + db.set(1, 1.1); + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_boolean == 1); + assert(db.event_handler().block_count_int64 == 1); + assert(db.event_handler().block_count_numeric == 1); + db.set(1, int64_t(20)); + assert(db.event_handler().block_count == 2); + + db.release(); + assert(db.event_handler().block_count == 0); + } + + { + mtv_type db; + db.push_back(1.1); + db.push_back(int64_t(10)); + db.push_back(std::string("foo")); + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_int64 == 1); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_string == 1); + + db.erase(0, 2); + assert(db.event_handler().block_count == 0); + } + + { + mtv_type db; + db.push_back(1.1); + db.push_back_empty(); + assert(db.event_handler().block_count == 1); + db.erase(0, 0); + assert(db.event_handler().block_count == 0); + } + + { + mtv_type db(3); + db.set(0, std::string("top")); + db.set(2, std::string("bottom")); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_string == 2); + db.erase(1, 1); + assert(db.event_handler().block_count == 1); + } + + { + mtv_type db(3); + db.set(1, 1.1); + assert(db.event_handler().block_count == 1); + db.erase(1, 1); + assert(db.event_handler().block_count == 0); + } + + { + std::vector<double> vals = {1.1, 1.2}; + mtv_type db(4); + db.set(0, 0.1); + db.set(1, 0.2); + db.set(2, std::string("foo")); + db.set(3, std::string("bar")); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_string == 1); + db.set(2, vals.begin(), vals.end()); // remove a block and append to previous one. + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + } + + { + std::vector<double> vals = {1.1, 1.2}; + mtv_type db(4); + db.set(0, int32_t(5)); + db.set(1, int32_t(10)); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_int32 == 1); + db.set(2, vals.begin(), vals.end()); // set to empty block. + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_int32 == 1); + assert(db.event_handler().block_count_numeric == 1); + } + + { + std::vector<double> vals = {1.1, 1.2}; + mtv_type db(4); + db.set(0, int32_t(5)); + db.set(1, int32_t(10)); + db.set(2, std::string("foo")); + db.set(3, std::string("bar")); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_int32 == 1); + assert(db.event_handler().block_count_string == 1); + db.set(2, vals.begin(), vals.end()); // replace a block. + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_int32 == 1); + assert(db.event_handler().block_count_numeric == 1); + } + + { + std::vector<double> vals = {1.1, 1.2}; + mtv_type db(4, std::string("foo")); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_string == 1); + db.set(0, vals.begin(), vals.end()); // replace the upper part of a block. + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_string == 1); + assert(db.event_handler().block_count_numeric == 1); + } + + { + std::vector<double> vals = {1.1, 1.2}; + mtv_type db(4, std::string("foo")); + assert(db.event_handler().block_count == 1); + db.set(2, vals.begin(), vals.end()); // replace the lower part of the last block. + assert(db.event_handler().block_count == 2); + } + + { + std::vector<double> vals = {1.1, 1.2}; + mtv_type db(4, std::string("foo")); + db.push_back(int64_t(100)); + assert(db.event_handler().block_count == 2); + db.set(2, vals.begin(), vals.end()); // replace the lower part of a block. + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_string == 1); + assert(db.event_handler().block_count_int64 == 1); + assert(db.event_handler().block_count_numeric == 1); + } + + { + std::vector<double> vals = {1.1, 1.2}; + mtv_type db(6, std::string("foo")); + assert(db.event_handler().block_count == 1); + db.set(2, vals.begin(), vals.end()); // set the values to the middle of a block. + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_string == 2); + assert(db.event_handler().block_count_numeric == 1); + } + + { + mtv_type db(1, 0.1); + db.push_back(int16_t(1)); + db.push_back(int32_t(20)); + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_int16 == 1); + assert(db.event_handler().block_count_int32 == 1); + assert(db.event_handler().block_count_numeric == 1); + + std::vector<double> vals = {1.1, 1.2, 1.3}; // same type as the top block. + db.set(0, vals.begin(), vals.end()); // overwrite multiple blocks. + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + } + + { + mtv_type db(1, std::string("foo")); + db.push_back(int16_t(1)); + db.push_back(int32_t(20)); + assert(db.event_handler().block_count == 3); + assert(db.event_handler().block_count_int16 == 1); + assert(db.event_handler().block_count_int32 == 1); + assert(db.event_handler().block_count_string == 1); + + std::vector<double> vals = {1.1, 1.2, 1.3}; // differene type from that of the top block. + db.set(0, vals.begin(), vals.end()); // overwrite multiple blocks. + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_numeric == 1); + } + + { + mtv_type db(6); + db.set(2, 1.1); + db.set(3, int32_t(22)); + assert(db.event_handler().block_count == 2); + assert(db.event_handler().block_count_int32 == 1); + assert(db.event_handler().block_count_numeric == 1); + db.erase(2, 3); + assert(db.event_handler().block_count == 0); + } + + { + mtv_type db(6, int8_t('a')); + db.set(2, 1.1); + db.set(3, int32_t(22)); + assert(db.event_handler().block_count == 4); + assert(db.event_handler().block_count_int32 == 1); + assert(db.event_handler().block_count_numeric == 1); + assert(db.event_handler().block_count_int8 == 2); + db.erase(2, 3); + assert(db.event_handler().block_count == 1); + assert(db.event_handler().block_count_int8 == 1); + } + + { + mtv_type src(6, int8_t('a')), dst(6); + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 0); + src.transfer(0, 2, dst, 0); + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + + src.transfer(3, 5, dst, 3); + assert(src.event_handler().block_count == 0); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(6), dst(6); + src.set(0, int8_t('z')); + src.set(1, int32_t(10)); + src.set(2, int16_t(5)); + dst.set(3, 1.1); + assert(src.event_handler().block_count == 3); + assert(src.event_handler().block_count_int8 == 1); + assert(src.event_handler().block_count_int32 == 1); + assert(src.event_handler().block_count_int16 == 1); + assert(dst.event_handler().block_count == 1); + assert(dst.event_handler().block_count_numeric == 1); + + src.transfer(0, 2, dst, 0); + assert(src.event_handler().block_count == 0); + assert(dst.event_handler().block_count == 4); + assert(dst.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count_int8 == 1); + assert(dst.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count_int16 == 1); + } + + { + mtv_type src(6), dst(6); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 0); + + src.transfer(1, 3, dst, 1); + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(6), dst(6); + src.set(3, 1.1); + src.set(4, 1.2); + src.set(5, 1.3); + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 0); + + src.transfer(1, 3, dst, 1); + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(3), dst(3); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, std::string("2.1")); + dst.set(1, std::string("2.2")); + dst.set(2, std::string("2.3")); + + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + + src.swap(0, 2, dst, 0); + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(4), dst(3); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + src.set(3, 1.4); + + dst.set(0, std::string("2.1")); + dst.set(1, std::string("2.2")); + dst.set(2, std::string("2.3")); + + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + + src.swap(0, 2, dst, 0); + assert(src.event_handler().block_count == 2); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(5), dst(3); + src.set(0, std::string("2.0")); + src.set(1, 1.1); + src.set(2, 1.2); + src.set(3, 1.3); + src.set(4, 1.4); + + dst.set(0, std::string("2.1")); + dst.set(1, std::string("2.2")); + dst.set(2, std::string("2.3")); + + assert(src.event_handler().block_count == 2); + assert(dst.event_handler().block_count == 1); + + src.swap(1, 3, dst, 0); + assert(src.event_handler().block_count == 2); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(4), dst(3); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + src.set(3, 1.4); + + dst.set(0, std::string("2.1")); + dst.set(1, std::string("2.2")); + dst.set(2, std::string("2.3")); + + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + + src.swap(1, 3, dst, 0); + assert(src.event_handler().block_count == 2); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(5), dst(3); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + src.set(3, 1.4); + src.set(4, std::string("2.4")); + + dst.set(0, std::string("2.1")); + dst.set(1, std::string("2.2")); + dst.set(2, std::string("2.3")); + + assert(src.event_handler().block_count == 2); + assert(dst.event_handler().block_count == 1); + + src.swap(1, 3, dst, 0); + assert(src.event_handler().block_count == 2); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(5), dst(3); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + src.set(3, 1.4); + src.set(4, 1.5); + + dst.set(0, std::string("2.1")); + dst.set(1, std::string("2.2")); + dst.set(2, std::string("2.3")); + + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + + src.swap(1, 3, dst, 0); + assert(src.event_handler().block_count == 3); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(3), dst(3); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, std::string("2.1")); + dst.set(1, int32_t(100)); + dst.set(2, std::string("2.3")); + + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count == 3); + assert(dst.event_handler().block_count_string == 2); + assert(dst.event_handler().block_count_int32 == 1); + + src.swap(0, 2, dst, 0); + assert(src.event_handler().block_count == 3); + assert(src.event_handler().block_count_string == 2); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 1); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(5), dst(5); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + src.set(3, 1.4); + src.set(4, 1.5); + + dst.set(0, std::string("2.1")); + dst.set(1, std::string("2.2")); + dst.set(2, int32_t(100)); + dst.set(3, std::string("2.3")); + dst.set(4, std::string("2.4")); + + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count == 3); + assert(dst.event_handler().block_count_string == 2); + assert(dst.event_handler().block_count_int32 == 1); + + src.swap(1, 3, dst, 1); + assert(src.event_handler().block_count == 5); + assert(src.event_handler().block_count_numeric == 2); + assert(src.event_handler().block_count_string == 2); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 3); + assert(dst.event_handler().block_count_string == 2); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(3), dst(4); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, 2.1); + dst.set(1, int32_t(5)); + dst.set(2, int32_t(6)); + dst.set(3, int32_t(7)); + + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count == 2); + assert(dst.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count_int32 == 1); + + src.swap(0, 2, dst, 1); + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 1); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(3), dst(5); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, 2.1); + dst.set(1, int32_t(5)); + dst.set(2, int32_t(6)); + dst.set(3, int32_t(7)); + dst.set(4, 2.2); + + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count == 3); + assert(dst.event_handler().block_count_numeric == 2); + assert(dst.event_handler().block_count_int32 == 1); + + src.swap(0, 2, dst, 1); + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 1); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(3), dst(4); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, int32_t(5)); + dst.set(1, int32_t(6)); + dst.set(2, int32_t(7)); + dst.set(3, 2.1); + + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count == 2); + assert(dst.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count_numeric == 1); + + src.swap(0, 2, dst, 0); + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 1); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(3), dst(4); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, int32_t(5)); + dst.set(1, int32_t(6)); + dst.set(2, int32_t(7)); + dst.set(3, int32_t(8)); + + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + + src.swap(0, 2, dst, 0); + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 2); + assert(dst.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(3), dst(5); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, 2.1); + dst.set(1, int32_t(5)); + dst.set(2, int32_t(6)); + dst.set(3, int32_t(7)); + dst.set(4, int32_t(8)); + + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count == 2); + assert(dst.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count_int32 == 1); + + src.swap(0, 2, dst, 1); + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 2); + assert(dst.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count_int32 == 1); + } + + { + mtv_type src(3), dst(5); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, int32_t(4)); + dst.set(1, int32_t(5)); + dst.set(2, int32_t(6)); + dst.set(3, int32_t(7)); + dst.set(4, int32_t(8)); + + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + + src.swap(0, 2, dst, 1); + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 3); + assert(dst.event_handler().block_count_int32 == 2); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(3), dst(4); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, int32_t(4)); + dst.set(1, int32_t(5)); + dst.set(2, int32_t(6)); + dst.set(3, int32_t(7)); + + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count == 1); + assert(dst.event_handler().block_count_int32 == 1); + + src.swap(0, 2, dst, 1); + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 2); + assert(dst.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(3), dst(5); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, int32_t(4)); + dst.set(1, int32_t(5)); + dst.set(2, int32_t(6)); + dst.set(3, int32_t(7)); + dst.set(4, 2.1); + + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count == 2); + assert(dst.event_handler().block_count_numeric == 1); + assert(dst.event_handler().block_count_int32 == 1); + + src.swap(0, 2, dst, 1); + assert(src.event_handler().block_count == 1); + assert(src.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count == 2); + assert(dst.event_handler().block_count_int32 == 1); + assert(dst.event_handler().block_count_numeric == 1); + } + + { + mtv_type src(3), dst(5); + src.set(0, 1.1); + src.set(1, 1.2); + src.set(2, 1.3); + + dst.set(0, 2.1); + dst.set(4, 2.2); + + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 2); + + src.transfer(0, 2, dst, 1); + assert(src.event_handler().block_count == 0); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type src(20), dst(20); + src.set(9, 1.2); + + dst.set(10, 2.1); + dst.set(11, 2.2); + + assert(src.event_handler().block_count == 1); + assert(dst.event_handler().block_count == 1); + + src.transfer(9, 9, dst, 9); + assert(src.event_handler().block_count == 0); + assert(dst.event_handler().block_count == 1); + } + + { + mtv_type db1(10); + db1.set<int32_t>(0, 2); + db1.set<int32_t>(1, 3); + db1.set<int32_t>(2, 4); + db1.set<std::string>(3, "A"); + db1.set<std::string>(4, "B"); + db1.set<std::string>(5, "C"); + + // Leave some empty range. + mtv_type db2(10); + for (int32_t i = 0; i < 10; ++i) + db2.set<int32_t>(i, 10 + i); + db2.set<int8_t>(5, 'Z'); + + assert(db1.event_handler().block_count == 2); + assert(db1.event_handler().block_count_int32 == 1); + assert(db1.event_handler().block_count_string == 1); + + assert(db2.event_handler().block_count == 3); + assert(db2.event_handler().block_count_int32 == 2); + assert(db2.event_handler().block_count_int8 == 1); + + db1.swap(1, 7, db2, 2); + + assert(db1.event_handler().block_count == 3); + assert(db1.event_handler().block_count_int32 == 2); + assert(db1.event_handler().block_count_string == 0); + assert(db1.event_handler().block_count_int8 == 1); + + assert(db2.event_handler().block_count == 3); + assert(db2.event_handler().block_count_int32 == 2); + assert(db2.event_handler().block_count_int8 == 0); + assert(db2.event_handler().block_count_string == 1); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/tc/block_init.inl b/test/multi_type_vector/event/tc/block_init.inl new file mode 100644 index 0000000..e530c12 --- /dev/null +++ b/test/multi_type_vector/event/tc/block_init.inl @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +struct event_block_init +{ + std::string name; + std::string ctor_type; + + event_block_init() : ctor_type("empty") + {} + event_block_init(const std::string& _name) : name(_name), ctor_type("normal") + {} + event_block_init(const event_block_init& other) : name(other.name), ctor_type("copy") + {} + event_block_init(event_block_init&& other) : name(std::move(other.name)), ctor_type("move") + {} + + void element_block_acquired(const mdds::mtv::base_element_block* /*block*/) + {} + void element_block_released(const mdds::mtv::base_element_block* /*block*/) + {} +}; + +struct eb_init_trait : public mdds::mtv::standard_element_blocks_traits +{ + using event_func = event_block_init; + + constexpr static mdds::mtv::lu_factor_t loop_unrolling = mdds::mtv::lu_factor_t::lu8; +}; + +void mtv_test_block_init() +{ + stack_printer __stack_printer__(__FUNCTION__); + + using mtv_type = mtv_template_type<eb_init_trait>; + + { + mtv_type db(event_block_init("some name")); // pass an rvalue + assert(db.event_handler().name == "some name"); + assert(db.event_handler().ctor_type == "move"); + + auto db2{db}; + assert(db2.event_handler().name == "some name"); + assert(db2.event_handler().ctor_type == "copy"); + } + + { + event_block_init ebi("other name"); + assert(ebi.ctor_type == "normal"); + mtv_type db(ebi); // pass an lvalue + assert(db.event_handler().name == "other name"); + assert(db.event_handler().ctor_type == "copy"); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/event/tc/swap.inl b/test/multi_type_vector/event/tc/swap.inl new file mode 100644 index 0000000..60d8ef4 --- /dev/null +++ b/test/multi_type_vector/event/tc/swap.inl @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2022 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +struct event_handler : public mdds::mtv::empty_event_func +{ + std::string name; + + event_handler() + {} +}; + +struct trait : public mdds::mtv::default_traits +{ + using event_func = event_handler; +}; + +using mtv_type = mtv_template_type<trait>; + +void mtv_test_swap() +{ + stack_printer __stack_printer__(__FUNCTION__); + + mtv_type db1(10), db2(2); + db1.event_handler().name = "db1"; + db2.event_handler().name = "db2"; + + assert(db1.size() == 10); + assert(db2.size() == 2); + assert(db1.event_handler().name == "db1"); + assert(db2.event_handler().name == "db2"); + + // This should also swap the event handlers. + db1.swap(db2); + + assert(db1.size() == 2); + assert(db2.size() == 10); + assert(db1.event_handler().name == "db2"); + assert(db2.event_handler().name == "db1"); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/multi_type_vector/perf/Makefile.am b/test/multi_type_vector/perf/Makefile.am new file mode 100644 index 0000000..d5c0088 --- /dev/null +++ b/test/multi_type_vector/perf/Makefile.am @@ -0,0 +1,14 @@ + +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include + +check_PROGRAMS = test + +test_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + + + + diff --git a/test/multi_type_vector/perf/Makefile.in b/test/multi_type_vector/perf/Makefile.in new file mode 100644 index 0000000..a448f9c --- /dev/null +++ b/test/multi_type_vector/perf/Makefile.in @@ -0,0 +1,613 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test$(EXEEXT) +subdir = test/multi_type_vector/perf +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_OBJECTS = test_main.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_OBJECTS = $(am_test_OBJECTS) +test_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_main.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_SOURCES) +DIST_SOURCES = $(test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include + +test_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/multi_type_vector/perf/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/multi_type_vector/perf/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) + @rm -f test$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ + check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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/test/multi_type_vector/perf/test_main.cpp b/test/multi_type_vector/perf/test_main.cpp new file mode 100644 index 0000000..5edae6d --- /dev/null +++ b/test/multi_type_vector/perf/test_main.cpp @@ -0,0 +1,132 @@ +/************************************************************************* + * + * Copyright (c) 2011-2013 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. + +#include <mdds/multi_type_vector.hpp> + +#include <cassert> +#include <sstream> +#include <vector> +#include <deque> + +using namespace std; +using namespace mdds; + +namespace { + +typedef mdds::multi_type_vector<mdds::mtv::standard_element_blocks_traits> mtv_type; + +void mtv_perf_test_block_position_lookup() +{ + size_t n = 24000; + + { + // Default insertion which always looks up the right element block + // from the position of the first block. As such, as the block size + // grows, so does the time it takes to search for the right block. + + mtv_type db(n * 2); + double val1 = 1.1; + int val2 = 23; + stack_printer __stack_printer__("::mtv_perf_test_block_position_lookup::default insertion"); + for (size_t i = 0; i < n; ++i) + { + size_t pos1 = i * 2, pos2 = i * 2 + 1; + db.set(pos1, val1); + db.set(pos2, val2); + } + } + + { + // As a solution for this, we can use an iterator to specify the start + // position, which eliminates the above scalability problem nicely. + + mtv_type db(n * 2); + mtv_type::iterator pos_hint = db.begin(); + double val1 = 1.1; + int val2 = 23; + stack_printer __stack_printer__("::mtv_perf_test_block_position_lookup::insertion with position hint"); + for (size_t i = 0; i < n; ++i) + { + size_t pos1 = i * 2, pos2 = i * 2 + 1; + pos_hint = db.set(pos_hint, pos1, val1); + pos_hint = db.set(pos_hint, pos2, val2); + } + } +} + +void mtv_perf_test_insert_via_position_object() +{ + size_t data_size = 80000; + mtv_type db(data_size); + { + stack_printer __stack_printer__("::mtv_perf_test_insert_via_position_object initialize mtv."); + mtv_type::iterator it = db.begin(); + for (size_t i = 0, n = db.size() / 2; i < n; ++i) + { + it = db.set(it, i * 2, 1.1); + } + } + + mtv_type db2 = db; + { + stack_printer __stack_printer__("::mtv_perf_test_insert_via_position_object insert with position hint."); + mtv_type::iterator it = db2.begin(); + for (size_t i = 0, n = db2.size(); i < n; ++i) + { + it = db2.set(it, i, string("foo")); + } + } + + db2 = db; + { + stack_printer __stack_printer__("::mtv_perf_test_insert_via_position_object insert via position object."); + mtv_type::position_type pos = db2.position(0); + for (; pos.first != db2.end(); pos = mtv_type::next_position(pos)) + { + size_t log_pos = mtv_type::logical_position(pos); + pos.first = db2.set(pos.first, log_pos, string("foo")); + pos.second = log_pos - pos.first->position; + } + } +} + +} // namespace + +int main() +try +{ + mtv_perf_test_block_position_lookup(); + mtv_perf_test_insert_via_position_object(); + + return EXIT_SUCCESS; +} +catch (...) +{ + return EXIT_FAILURE; +} diff --git a/test/point_quad_tree/Makefile.am b/test/point_quad_tree/Makefile.am new file mode 100644 index 0000000..b4927a7 --- /dev/null +++ b/test/point_quad_tree/Makefile.am @@ -0,0 +1,14 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/point_quad_tree/Makefile.in b/test/point_quad_tree/Makefile.in new file mode 100644 index 0000000..3b775e7 --- /dev/null +++ b/test/point_quad_tree/Makefile.in @@ -0,0 +1,990 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/point_quad_tree +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_main.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/point_quad_tree/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/point_quad_tree/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/point_quad_tree/test_main.cpp b/test/point_quad_tree/test_main.cpp new file mode 100644 index 0000000..605e410 --- /dev/null +++ b/test/point_quad_tree/test_main.cpp @@ -0,0 +1,477 @@ +/************************************************************************* + * + * Copyright (c) 2010 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "mdds/point_quad_tree.hpp" + +#include <algorithm> +#include <memory> +#include <vector> +#include <sstream> +#include <boost/cstdint.hpp> + +using namespace std; +using namespace mdds; +using ::boost::uint16_t; + +struct data_printer +{ + void operator()(const string* p) + { + cout << *p << " "; + } +}; + +template<typename _DbType> +struct search_result_printer +{ + void operator()(const pair<const typename _DbType::point, const typename _DbType::value_type>& r) const + { + cout << " (x=" << r.first.x << ", y=" << r.first.y << ", value='" << *r.second << "')" << endl; + } +}; + +void pqt_test_basic() +{ + stack_printer __stack_printer__("::pqt_test"); + typedef point_quad_tree<uint16_t, const string*> db_type; + db_type db; + + string A("A"); + string B("B"); + string C("C"); + string D("D"); + string E("E"); + string F("F"); + string G("G"); + string H("H"); + string I("I"); + string J("J"); + string K("K"); + string L("L"); + string M("M"); + string N("N"); + + db.insert(25, 32, &A); + db.insert(5, 45, &B); + db.insert(52, 10, &C); + db.insert(80, 5, &D); + db.insert(40, 50, &E); + db.insert(10, 10, &F); + db.insert(20, 20, &G); + db.insert(80, 80, &H); + db.insert(58, 46, &I); + db.insert(36, 55, &J); + db.insert(26, 52, &K); + db.insert(38, 68, &L); + db.insert(39, 78, &M); + db.insert(72, 52, &N); + + assert(db.size() == 14); + + cout << "node count = " << get_node_instance_count() << endl; + db.dump_tree_svg("./obj/test.svg"); + + { + db_type::data_array_type result; + db.search_region(10, 10, 60, 20, result); + cout << "search region: (10, 10, 60, 20)" << endl; + cout << "result: "; + for_each(result.begin(), result.end(), data_printer()); + cout << endl; + + result.clear(); + db.search_region(10, 10, 61, 61, result); + cout << "search region: (10, 10, 61, 61)" << endl; + cout << "result: "; + for_each(result.begin(), result.end(), data_printer()); + cout << endl; + } + + db_type::search_results result = db.search_region(10, 10, 60, 20); + db_type::search_results::const_iterator itr = result.begin(), itr_end = result.end(); + cout << "result: " << endl; + for_each(result.begin(), result.end(), search_result_printer<db_type>()); + + result = db.search_region(10, 10, 61, 61); + itr = result.begin(), itr_end = result.end(); + cout << "result: " << endl; + for_each(result.begin(), result.end(), search_result_printer<db_type>()); + + db.remove(20, 20); + db.remove(40, 50); + assert(db.size() == 12); + db.dump_tree_svg("./obj/test-remove.svg"); + + db.clear(); + assert(db.empty()); + assert(db.size() == 0); +} + +void pqt_test_insertion_removal() +{ + stack_printer __stack_printer__("::pqt_test_insertion_removal"); + typedef point_quad_tree<int32_t, const string*> db_type; + db_type db; + + // Check its empty-ness... + assert(db.empty()); + assert(db.size() == 0); + + // Create all data instances. + vector<unique_ptr<string>> data_store; + data_store.reserve(100); + for (size_t i = 0; i < 100; ++i) + { + ostringstream os; + os << "0x" << hex << i; + data_store.emplace_back(new string(os.str())); + } + + vector<db_type::node_data> expected; + + // Insert data one by one, and verify each insertion. + for (int32_t i = 0; i < 10; ++i) + { + for (int32_t j = 0; j < 10; ++j) + { + int32_t x = i * 10 + 1, y = j * 10 + 1; + size_t index = i * 10 + j; + const string* data_ptr = data_store[index].get(); + cout << "inserting '" << *data_ptr << "' at (" << x << "," << y << ")" << endl; + db.insert(x, y, data_ptr); + expected.push_back(db_type::node_data(x, y, data_ptr)); + + vector<db_type::node_data> stored_data; + db.get_all_stored_data(stored_data); + assert(stored_data.size() == (index + 1)); + assert(db.size() == (index + 1)); + assert(!db.empty()); + bool success = db.verify_data(expected); + assert(success); + } + } + db.dump_tree_svg("./obj/pqt_test_insertion.svg"); + + // Remove data one by one, and check the size after each removal. + size_t node_count = 100; + for (int32_t i = 0; i < 10; ++i) + { + for (int32_t j = 0; j < 10; ++j) + { + int32_t x = i * 10 + 1, y = j * 10 + 1; + db.remove(x, y); + size_t n = db.size(); + cout << "removing node at (" << x << "," << y << ") " + << "size after removal: " << n << endl; + --node_count; + assert(node_count == n); + } + } +} + +void pqt_test_remove_root() +{ + stack_printer __stack_printer__("::pqt_test_remove_root"); + typedef point_quad_tree<int32_t, const string*> db_type; + string O("O"); + string NW("NW"); + string NE("NE"); + string SW("SW"); + string SE("SE"); + db_type db; + + // Insert all data and verify their storage. + db.insert(10, 10, &O); + db.insert(20, 0, &NE); + db.insert(0, 0, &NW); + db.insert(20, 20, &SE); + db.insert(0, 20, &SW); + db.dump_tree_svg("./obj/pqt_test_remove_root-1.svg"); + + vector<db_type::node_data> expected; + expected.push_back(db_type::node_data(10, 10, &O)); + expected.push_back(db_type::node_data(20, 0, &NE)); + expected.push_back(db_type::node_data(0, 0, &NW)); + expected.push_back(db_type::node_data(20, 20, &SE)); + expected.push_back(db_type::node_data(0, 20, &SW)); + bool success = db.verify_data(expected); + assert(success); + assert(db.size() == 5); + + // Now, remove the root node. + db.remove(10, 10); + db.dump_tree_svg("./obj/pqt_test_remove_root-2.svg"); + expected.clear(); + expected.push_back(db_type::node_data(20, 0, &NE)); + expected.push_back(db_type::node_data(0, 0, &NW)); + expected.push_back(db_type::node_data(20, 20, &SE)); + expected.push_back(db_type::node_data(0, 20, &SW)); + success = db.verify_data(expected); + assert(success); + assert(db.size() == 4); +} + +void pqt_test_equality() +{ + stack_printer __stack_printer__("::pqt_test_equality"); + + typedef point_quad_tree<int32_t, const string*> db_type; + db_type db1, db2; + + string A("A"); + string B("B"); + string C("C"); + string D("D"); + string E("E"); + string F("F"); + + assert(db1 == db2); // both are empty. + + db1.insert(0, 0, &A); + db2.insert(0, 0, &A); + assert(db1 == db2); + db1.remove(0, 0); + assert(db1 != db2); + db1.insert(0, 0, &B); + assert(db1 != db2); + db2.insert(0, 0, &B); // B overwrites A. + assert(db1 == db2); // Both should have B at (0,0). + db1.insert(1, 1, &C); + db2.insert(2, 2, &C); + assert(db1 != db2); + db1.insert(2, 2, &C); + db2.insert(1, 1, &C); + assert(db1 == db2); + + // Inserting data in different orders should make no difference in equality. + db1.insert(1, 3, &D); + db1.insert(1, 4, &E); + db1.insert(1, 5, &F); + + db2.insert(1, 5, &F); + db2.insert(1, 4, &E); + db2.insert(1, 3, &D); + assert(db1 == db2); + db1.remove(1, 4); + db2.remove(1, 4); + assert(db1 == db2); + + // Make them empty again. + db1.clear(); + db2.clear(); + assert(db1 == db2); +} + +void pqt_test_assignment() +{ + stack_printer __stack_printer__("::pqt_test_assignment"); + typedef point_quad_tree<int32_t, const string*> db_type; + db_type db1, db2; + string A("A"); + string B("B"); + string C("C"); + string D("D"); + string E("E"); + string F("F"); + + db1.insert(0, 10, &A); + db1.insert(2, 5, &B); + db1.insert(-10, 2, &C); + db1.insert(5, 7, &D); + vector<db_type::node_data> expected; + expected.push_back(db_type::node_data(0, 10, &A)); + expected.push_back(db_type::node_data(2, 5, &B)); + expected.push_back(db_type::node_data(-10, 2, &C)); + expected.push_back(db_type::node_data(5, 7, &D)); + bool success = db1.verify_data(expected); + assert(success); + + db2 = db1; + success = db2.verify_data(expected); + assert(success); + success = db1.verify_data(expected); + assert(success); + + db2.insert(12, 45, &E); + db2.insert(20, 42, &F); + success = db2.verify_data(expected); // This should fail. + assert(!success); + db2 = db1; // Assign once again. + success = db2.verify_data(expected); // This now should succeed. + assert(success); +} + +void pqt_test_swap() +{ + stack_printer __stack_printer__("::pqt_test_swap"); + typedef point_quad_tree<int32_t, const string*> db_type; + db_type db1, db2; + string A("A"); + string B("B"); + string C("C"); + string D("D"); + string E("E"); + string F("F"); + + db1.insert(0, 10, &A); + db1.insert(2, 5, &B); + db1.insert(-10, 2, &C); + db1.insert(5, 7, &D); + vector<db_type::node_data> expected; + expected.push_back(db_type::node_data(0, 10, &A)); + expected.push_back(db_type::node_data(2, 5, &B)); + expected.push_back(db_type::node_data(-10, 2, &C)); + expected.push_back(db_type::node_data(5, 7, &D)); + bool success = db1.verify_data(expected); + assert(success); + assert(db2.empty()); + + db1.swap(db2); + assert(db1.empty()); + assert(!db2.empty()); + success = db2.verify_data(expected); + assert(success); +} + +template<typename _DbType> +bool verify_find( + const _DbType& db, typename _DbType::key_type x, typename _DbType::key_type y, + const typename _DbType::value_type data) +{ + try + { + typename _DbType::value_type found = db.find(x, y); + cout << "found at (" << x << "," << y << "): " << found << endl; + if (found == data) + return true; + } + catch (const typename _DbType::data_not_found&) + { + cout << "nothing found at (" << x << "," << y << ")" << endl; + } + return false; +} + +void pqt_test_find() +{ + stack_printer __stack_printer__("::pqt_test_find"); + typedef point_quad_tree<int32_t, const string*> db_type; + db_type db; + string A("A"); + string B("B"); + string C("C"); + string D("D"); + string E("E"); + string F("F"); + db.insert(92, 27, &A); + db.insert(53, 26, &B); + db.insert(69, 18, &C); + db.insert(0, 78, &D); + db.insert(17, 7, &E); + db.insert(91, 88, &F); + assert(db.size() == 6); + db.dump_tree_svg("obj/pqt_test_find.svg"); + + bool check; + check = verify_find(db, 92, 27, &A); + assert(check); + check = verify_find(db, 53, 26, &B); + assert(check); + check = verify_find(db, 69, 18, &C); + assert(check); + check = verify_find(db, 0, 78, &D); + assert(check); + check = verify_find(db, 17, 7, &E); + assert(check); + check = verify_find(db, 91, 88, &F); + assert(check); + + // Check for non-existent data. + check = verify_find(db, 34, 86, &A); + assert(!check); + check = verify_find(db, -1, 7, &A); + assert(!check); + check = verify_find(db, 91, 27, &A); + assert(!check); +} + +void pqt_test_node_access() +{ + stack_printer __stack_printer__("::pqt_test_node_access"); + typedef point_quad_tree<int32_t, const string*> db_type; + db_type db; + db_type::node_access nac = db.get_node_access(); + assert(!nac); + string A("A"); + string B("B"); + string C("C"); + string D("D"); + string E("E"); + string F("F"); + db.insert(92, 27, &A); + db.insert(53, 26, &B); + db.insert(69, 18, &C); + db.insert(0, 78, &D); + db.insert(17, 7, &E); + db.insert(91, 88, &F); + assert(db.size() == 6); + + nac = db.get_node_access(); + // Test root node. + assert(nac); + assert(nac.x() == 92); + assert(nac.y() == 27); + assert(nac.data() == &A); + + bool success = db.verify_node_iterator(nac); + assert(success); +} + +int main() +{ + try + { + pqt_test_basic(); + pqt_test_insertion_removal(); + pqt_test_remove_root(); + pqt_test_equality(); + pqt_test_assignment(); + pqt_test_swap(); + pqt_test_find(); + pqt_test_node_access(); + assert(get_node_instance_count() == 0); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} diff --git a/test/ref_pair_test.cpp b/test/ref_pair_test.cpp new file mode 100644 index 0000000..4a4c58f --- /dev/null +++ b/test/ref_pair_test.cpp @@ -0,0 +1,111 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2020 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "mdds/ref_pair.hpp" + +#include <iostream> + +using namespace std; + +void test_basic() +{ + stack_printer __stack_printer__("::test_basic"); + + using rp_type = mdds::detail::ref_pair<const int, int>; + using pair_type = std::pair<int, int>; + + int v1 = 11; + int v2 = 22; + rp_type rp(v1, v2); + + rp.second = 34; + + assert(rp == pair_type(11, 34)); + assert(rp != pair_type(12, 34)); + assert(rp != pair_type(11, 32)); + assert(rp == rp); + + int v3 = 23; + int v4 = 33; + rp_type rp2(v3, v4); + assert(rp != rp2); + assert(rp2 == pair_type(23, 33)); + + rp_type rp3(rp); + assert(rp3 == rp); +} + +void test_used_in_iterator() +{ + stack_printer __stack_printer__("::test_used_in_iterator"); + + using rp_type = mdds::detail::ref_pair<int, int>; + + struct fake_iterator + { + int m_v1 = 222; + int m_v2 = 456; + + fake_iterator() + {} + + rp_type operator*() + { + return rp_type(m_v1, m_v2); + } + + rp_type operator->() + { + return rp_type(m_v1, m_v2); + } + }; + + fake_iterator it; + + assert((*it).first == 222); + assert((*it).second == 456); + assert(it->first == 222); + assert(it->second == 456); + + // Make sure the member values can be modified. + it->second = 897; + assert(it->second == 897); + (*it).first = -23; + assert(it->first == -23); +} + +int main() +{ + test_basic(); + test_used_in_iterator(); + + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/Makefile.am b/test/rtree/Makefile.am new file mode 100644 index 0000000..a664104 --- /dev/null +++ b/test/rtree/Makefile.am @@ -0,0 +1,41 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +DISTCLEANFILES = \ + rtree-test-*.obj \ + rtree-test-*.svg + +check_PROGRAMS = test-main test-bulkload + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_main_SOURCES = \ + test_basic.cpp \ + test_copy.cpp \ + test_directory_node_split.cpp \ + test_erase_directories.cpp \ + test_exact_search_by_extent.cpp \ + test_exact_search_by_point.cpp \ + test_forced_reinsertion.cpp \ + test_geometry.cpp \ + test_intersection.cpp \ + test_main.cpp \ + test_move.cpp \ + test_node_split.cpp \ + test_point_objects.cpp \ + test_square_distance.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_bulkload_SOURCES = \ + test_bulkload_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +EXTRA_DIST = test_global_rtree.hpp + +TESTS = test-main test-bulkload + +@VALGRIND_CHECK_RULES@ diff --git a/test/rtree/Makefile.in b/test/rtree/Makefile.in new file mode 100644 index 0000000..429699f --- /dev/null +++ b/test/rtree/Makefile.in @@ -0,0 +1,1089 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) test-bulkload$(EXEEXT) +TESTS = test-main$(EXEEXT) test-bulkload$(EXEEXT) +subdir = test/rtree +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_bulkload_OBJECTS = test_bulkload_main.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_bulkload_OBJECTS = $(am_test_bulkload_OBJECTS) +test_bulkload_LDADD = $(LDADD) +am_test_main_OBJECTS = test_basic.$(OBJEXT) test_copy.$(OBJEXT) \ + test_directory_node_split.$(OBJEXT) \ + test_erase_directories.$(OBJEXT) \ + test_exact_search_by_extent.$(OBJEXT) \ + test_exact_search_by_point.$(OBJEXT) \ + test_forced_reinsertion.$(OBJEXT) test_geometry.$(OBJEXT) \ + test_intersection.$(OBJEXT) test_main.$(OBJEXT) \ + test_move.$(OBJEXT) test_node_split.$(OBJEXT) \ + test_point_objects.$(OBJEXT) test_square_distance.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_basic.Po ./$(DEPDIR)/test_bulkload_main.Po \ + ./$(DEPDIR)/test_copy.Po \ + ./$(DEPDIR)/test_directory_node_split.Po \ + ./$(DEPDIR)/test_erase_directories.Po \ + ./$(DEPDIR)/test_exact_search_by_extent.Po \ + ./$(DEPDIR)/test_exact_search_by_point.Po \ + ./$(DEPDIR)/test_forced_reinsertion.Po \ + ./$(DEPDIR)/test_geometry.Po ./$(DEPDIR)/test_intersection.Po \ + ./$(DEPDIR)/test_main.Po ./$(DEPDIR)/test_move.Po \ + ./$(DEPDIR)/test_node_split.Po \ + ./$(DEPDIR)/test_point_objects.Po \ + ./$(DEPDIR)/test_square_distance.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_bulkload_SOURCES) $(test_main_SOURCES) +DIST_SOURCES = $(test_bulkload_SOURCES) $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +DISTCLEANFILES = \ + rtree-test-*.obj \ + rtree-test-*.svg + +test_main_SOURCES = \ + test_basic.cpp \ + test_copy.cpp \ + test_directory_node_split.cpp \ + test_erase_directories.cpp \ + test_exact_search_by_extent.cpp \ + test_exact_search_by_point.cpp \ + test_forced_reinsertion.cpp \ + test_geometry.cpp \ + test_intersection.cpp \ + test_main.cpp \ + test_move.cpp \ + test_node_split.cpp \ + test_point_objects.cpp \ + test_square_distance.cpp \ + $(top_srcdir)/test/test_global.cpp + +test_bulkload_SOURCES = \ + test_bulkload_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +EXTRA_DIST = test_global_rtree.hpp +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/rtree/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/rtree/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-bulkload$(EXEEXT): $(test_bulkload_OBJECTS) $(test_bulkload_DEPENDENCIES) $(EXTRA_test_bulkload_DEPENDENCIES) + @rm -f test-bulkload$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_bulkload_OBJECTS) $(test_bulkload_LDADD) $(LIBS) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_basic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bulkload_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_copy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_directory_node_split.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_erase_directories.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_exact_search_by_extent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_exact_search_by_point.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_forced_reinsertion.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_geometry.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_intersection.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_move.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_node_split.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_point_objects.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_square_distance.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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-bulkload.log: test-bulkload$(EXEEXT) + @p='test-bulkload$(EXEEXT)'; \ + b='test-bulkload'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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) + -test -z "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_basic.Po + -rm -f ./$(DEPDIR)/test_bulkload_main.Po + -rm -f ./$(DEPDIR)/test_copy.Po + -rm -f ./$(DEPDIR)/test_directory_node_split.Po + -rm -f ./$(DEPDIR)/test_erase_directories.Po + -rm -f ./$(DEPDIR)/test_exact_search_by_extent.Po + -rm -f ./$(DEPDIR)/test_exact_search_by_point.Po + -rm -f ./$(DEPDIR)/test_forced_reinsertion.Po + -rm -f ./$(DEPDIR)/test_geometry.Po + -rm -f ./$(DEPDIR)/test_intersection.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f ./$(DEPDIR)/test_move.Po + -rm -f ./$(DEPDIR)/test_node_split.Po + -rm -f ./$(DEPDIR)/test_point_objects.Po + -rm -f ./$(DEPDIR)/test_square_distance.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_basic.Po + -rm -f ./$(DEPDIR)/test_bulkload_main.Po + -rm -f ./$(DEPDIR)/test_copy.Po + -rm -f ./$(DEPDIR)/test_directory_node_split.Po + -rm -f ./$(DEPDIR)/test_erase_directories.Po + -rm -f ./$(DEPDIR)/test_exact_search_by_extent.Po + -rm -f ./$(DEPDIR)/test_exact_search_by_point.Po + -rm -f ./$(DEPDIR)/test_forced_reinsertion.Po + -rm -f ./$(DEPDIR)/test_geometry.Po + -rm -f ./$(DEPDIR)/test_intersection.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f ./$(DEPDIR)/test_move.Po + -rm -f ./$(DEPDIR)/test_node_split.Po + -rm -f ./$(DEPDIR)/test_point_objects.Po + -rm -f ./$(DEPDIR)/test_square_distance.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/rtree/test_basic.cpp b/test/rtree/test_basic.cpp new file mode 100644 index 0000000..4dd3354 --- /dev/null +++ b/test/rtree/test_basic.cpp @@ -0,0 +1,148 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_basic_search() +{ + stack_printer __stack_printer__("::rtree_test_basic_search"); + using rt_type = rtree<int16_t, std::string>; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + rt_type tree; + const rt_type& ctree = tree; + rt_type::extent_type expected_bb; + + tree.insert({{0, 0}, {2, 2}}, "test"); + expected_bb = {{0, 0}, {2, 2}}; + assert(tree.extent() == expected_bb); + assert(tree.size() == 1); + + tree.insert({{3, 3}, {5, 5}}, "test again"); + expected_bb = {{0, 0}, {5, 5}}; + assert(tree.extent() == expected_bb); + assert(tree.size() == 2); + + tree.insert({{-2, 1}, {3, 6}}, "more test"); + expected_bb = {{-2, 0}, {5, 6}}; + assert(tree.extent() == expected_bb); + assert(tree.size() == 3); + + tree.check_integrity(check_props); + + // Verify the search method works. + + rt_type::const_search_results res = ctree.search({1, 1}, search_type::overlap); + + auto it = res.cbegin(), it_end = res.cend(); + + size_t n = std::distance(it, it_end); + assert(n == 2); + + std::unordered_map<std::string, rt_type::extent_type> expected_values = { + {"test", {{0, 0}, {2, 2}}}, + {"more test", {{-2, 1}, {3, 6}}}, + }; + + for (; it != it_end; ++it) + { + cout << "bounding box: " << it.extent().to_string() << "; value: " << *it << "; depth: " << it.depth() << endl; + auto itv = expected_values.find(*it); + assert(itv != expected_values.end()); + assert(itv->second == it.extent()); + assert(it.depth() == 1); + } + + // Perform an out-of-bound search by point. + std::vector<rt_type::point_type> pts = { + {-10, -10}, + {1, 7}, + {6, 3}, + }; + + for (const rt_type::point_type& pt : pts) + { + res = ctree.search(pt, search_type::overlap); + assert(res.cbegin() == res.cend()); + } +} + +void rtree_test_basic_erase() +{ + stack_printer __stack_printer__("::rtree_test_basic_erase"); + using rt_type = rtree<int16_t, std::string>; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + rt_type tree; + const rt_type& ctree = tree; + tree.insert({{-2, -2}, {2, 2}}, "erase me"); + assert(!tree.empty()); + assert(tree.size() == 1); + + rt_type::const_search_results res = ctree.search({0, 0}, search_type::overlap); + + size_t n = std::distance(res.begin(), res.end()); + assert(n == 1); + + rt_type::const_iterator it = res.begin(); + assert(it != res.end()); + + tree.erase(it); + assert(tree.empty()); + assert(tree.size() == 0); + assert(rt_type::extent_type() == tree.extent()); + + tree.insert({{0, 0}, {2, 2}}, "erase me"); + tree.insert({{-10, -4}, {0, 0}}, "erase me"); + rt_type::extent_type expected_bb({-10, -4}, {2, 2}); + assert(tree.extent() == expected_bb); + assert(tree.size() == 2); + + res = ctree.search({-5, -2}, search_type::overlap); + n = std::distance(res.begin(), res.end()); + assert(n == 1); + it = res.begin(); + tree.erase(it); + assert(!tree.empty()); // there should be one value stored in the tree. + assert(tree.size() == 1); + expected_bb = {{0, 0}, {2, 2}}; + assert(tree.extent() == expected_bb); + + tree.check_integrity(check_props); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_bulkload_main.cpp b/test/rtree/test_bulkload_main.cpp new file mode 100644 index 0000000..8295c29 --- /dev/null +++ b/test/rtree/test_bulkload_main.cpp @@ -0,0 +1,281 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2018 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +#include <vector> +#include <fstream> +#include <unordered_map> + +using namespace mdds; +using namespace std; + +void rtree_test_bl_empty() +{ + stack_printer __stack_printer__("::rtree_test_bl_empty"); + using rt_type = rtree<int16_t, std::string>; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + // Load nothing. + rt_type::bulk_loader loader; + rt_type tree = loader.pack(); + assert(tree.empty()); + tree.check_integrity(check_props); +} + +void rtree_test_bl_insert_points_move() +{ + stack_printer __stack_printer__("::rtree_test_bl_insert_points_move"); + using rt_type = rtree<int16_t, std::string, tiny_trait_2d_forced_reinsertion>; + using key_type = rt_type::key_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + rt_type::bulk_loader loader; + for (key_type x = 0; x < 20; ++x) + { + key_type yn = (x == 0) ? 19 : 20; + for (key_type y = 0; y < yn; ++y) + { + std::ostringstream os; + os << '(' << x << ',' << y << ')'; + loader.insert({x, y}, os.str()); + } + } + + auto tree = loader.pack(); + assert(tree.size() == 399); + tree.check_integrity(check_props); + export_tree(tree, "rtree-test-bl-insert-points-move"); +} + +void rtree_test_bl_insert_points_copy() +{ + stack_printer __stack_printer__("::rtree_test_bl_insert_points_copy"); + using rt_type = rtree<int16_t, std::string, tiny_trait_2d_forced_reinsertion>; + using point_type = rt_type::point_type; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + struct kv + { + point_type point; + std::string value; + }; + + std::vector<kv> values = { + {{0, 0}, "origin"}, {{125, 125}, "middle"}, {{22, 987}, "somewhere"}, + {{-34, -200}, "negative"}, {{2, 3}, "near origin"}, + }; + + // Insert less than max node size in order to test the packing + // implementation that doesn't involve per-level packing. + tiny_trait_2d_forced_reinsertion t; + assert(values.size() <= t.max_node_size); + + for (size_t n_values = 1; n_values <= values.size(); ++n_values) + { + auto loader = rt_type::bulk_loader(); + + // Insert specified number of value(s). + for (size_t i = 0; i < n_values; ++i) + loader.insert(values[i].point, values[i].value); + + // Populate and pack the tree. + auto tree = loader.pack(); + tree.check_integrity(check_props); + assert(tree.size() == n_values); + + // Make sure the inserted values are all there. + for (size_t i = 0; i < n_values; ++i) + { + auto res = tree.search(values[i].point, search_type::match); + assert(std::distance(res.begin(), res.end()) == 1); + auto it = res.begin(); + assert(*it == values[i].value); + + // The values should all be the immediate children of the root + // directory node. + assert(it.depth() == 1); + } + } +} + +void rtree_test_bl_insert_extents_move() +{ + stack_printer __stack_printer__("::rtree_test_bl_insert_extents_move"); + using rt_type = rtree<int16_t, only_movable, tiny_trait_2d_forced_reinsertion>; + using extent_type = rt_type::extent_type; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + struct kv + { + int16_t x; + int16_t y; + int16_t w; + int16_t h; + double value; + }; + + std::vector<kv> values = { + {2142, 2777, 1781, 1273, 1.0}, {5063, 2396, 765, 1019, 1.1}, {1887, 4935, 1400, 892, 1.2}, + {4428, 4046, 1527, 1146, 1.3}, {2268, 6713, 1146, 2162, 1.4}, {7729, 7094, 2924, 1908, 1.5}, + {10396, 2014, 6480, 892, 1.6}, {3158, 12302, 2035, 2289, 1.7}, {10777, 11032, 3432, 2289, 1.8}, + {14334, 5063, 1781, 2797, 1.9}, {8365, 4301, 3051, 1019, 2.0}, {16619, 11794, 638, 511, 2.1}, + {15222, 9254, 892, 511, 2.2}, {8111, 10142, 765, 638, 2.3}, {6587, 10397, 765, 511, 2.4}, + {7475, 11793, 638, 1146, 2.5}, {8746, 11285, 765, 892, 2.6}, {16620, 3665, 511, 2162, 2.7}, + {6332, 14714, 2162, 1908, 2.8}, {1634, 12048, 765, 5083, 2.9}, {15349, 16238, 1400, 1400, 3.0}, + {11666, 14587, 1400, 1146, 3.1}, + }; + + for (size_t n_values = 5; n_values <= values.size(); ++n_values) + { + rt_type::bulk_loader loader = rt_type::bulk_loader(); + + for (size_t i = 0; i < n_values; ++i) + { + const auto& v = values[i]; + extent_type extent{{v.x, v.y}, {int16_t(v.x + v.w), int16_t(v.y + v.h)}}; + only_movable vv(v.value); + + loader.insert(extent, std::move(vv)); + } + + auto tree = loader.pack(); + assert(tree.size() == n_values); + tree.check_integrity(check_props); + + // Make sure the values are all there. + for (size_t i = 0; i < n_values; ++i) + { + const auto& v = values[i]; + extent_type extent{{v.x, v.y}, {int16_t(v.x + v.w), int16_t(v.y + v.h)}}; + auto res = tree.search(extent, search_type::match); + assert(std::distance(res.begin(), res.end()) == 1); + assert(res.begin()->get() == v.value); + } + + if (n_values == values.size()) + export_tree(tree, "rtree-test-bl-insert-extents-move"); + } +} + +void rtree_test_bl_insert_extents_copy() +{ + stack_printer __stack_printer__("::rtree_test_bl_insert_extents_copy"); + using rt_type = rtree<int16_t, only_copyable, tiny_trait_2d_forced_reinsertion>; + using extent_type = rt_type::extent_type; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + struct kv + { + int16_t x; + int16_t y; + int16_t w; + int16_t h; + double value; + }; + + std::vector<kv> values = { + {2142, 2777, 1781, 1273, 1.0}, {5063, 2396, 765, 1019, 1.1}, {1887, 4935, 1400, 892, 1.2}, + {4428, 4046, 1527, 1146, 1.3}, {2268, 6713, 1146, 2162, 1.4}, {7729, 7094, 2924, 1908, 1.5}, + {10396, 2014, 6480, 892, 1.6}, {2904, 11286, 2035, 2289, 1.7}, {11412, 10524, 3432, 2289, 1.8}, + {14334, 5063, 1781, 2797, 1.9}, {8365, 4301, 3051, 1019, 2.0}, {16619, 11794, 638, 511, 2.1}, + {15222, 9254, 892, 511, 2.2}, {8111, 10142, 765, 638, 2.3}, {6587, 10397, 765, 511, 2.4}, + {7475, 11793, 638, 1146, 2.5}, {8746, 11285, 765, 892, 2.6}, {16620, 3665, 511, 2162, 2.7}, + {1760, 17762, 2162, 1908, 2.8}, {1634, 12048, 765, 5083, 2.9}, {15349, 16238, 1400, 1400, 3.0}, + {11793, 13190, 1400, 1146, 3.1}, {4174, 6078, 1019, 638, 3.2}, {13191, 3412, 1781, 257, 3.3}, + {6714, 11413, 511, 765, 3.4}, {2903, 14969, 892, 511, 3.5}, {3919, 16366, 638, 511, 3.6}, + {4554, 15222, 892, 638, 3.7}, {2904, 16238, 511, 892, 3.8}, {1507, 20557, 6099, 257, 3.9}, + {4047, 7221, 1273, 384, 4.0}, {12301, 3538, 638, 1908, 4.1}, {12174, 6460, 1146, 511, 4.2}, + {13318, 4046, 1273, 384, 4.3}, {16620, 6459, 1019, 638, 4.4}, {14080, 8238, 511, 765, 4.5}, + {8365, 12555, 765, 384, 4.6}, {16493, 7349, 511, 511, 4.7}, {7603, 11031, 511, 384, 4.8}, + {13571, 13191, 638, 1527, 4.9}, {15858, 13826, 2035, 2035, 5.0}, {7094, 1380, 892, 3305, 5.1}, + {7094, 6332, 1400, 1400, 5.2}, {10142, 8237, 2162, 384, 5.3}, {13444, 9761, 4, 130, 5.4}, + }; + + for (size_t n_values = 22; n_values <= values.size(); ++n_values) + { + rt_type::bulk_loader loader = rt_type::bulk_loader(); + + for (size_t i = 0; i < n_values; ++i) + { + const auto& v = values[i]; + extent_type extent{{v.x, v.y}, {int16_t(v.x + v.w), int16_t(v.y + v.h)}}; + only_copyable vv(v.value); + + loader.insert(extent, vv); + } + + auto tree = loader.pack(); + assert(tree.size() == n_values); + tree.check_integrity(check_props); + + // Make sure the values are all there. + for (size_t i = 0; i < n_values; ++i) + { + const auto& v = values[i]; + extent_type extent{{v.x, v.y}, {int16_t(v.x + v.w), int16_t(v.y + v.h)}}; + auto res = tree.search(extent, search_type::match); + assert(std::distance(res.begin(), res.end()) == 1); + assert(res.begin()->get() == v.value); + } + + if (n_values == values.size()) + export_tree(tree, "rtree-test-bl-insert-extents-copy"); + } +} + +int main() +{ + try + { + rtree_test_bl_empty(); + rtree_test_bl_insert_points_move(); + rtree_test_bl_insert_points_copy(); + rtree_test_bl_insert_extents_move(); + rtree_test_bl_insert_extents_copy(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_copy.cpp b/test/rtree/test_copy.cpp new file mode 100644 index 0000000..dd4e5a9 --- /dev/null +++ b/test/rtree/test_copy.cpp @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_copy() +{ + stack_printer __stack_printer__("::rtree_test_copy"); + + using rt_type = rtree<double, double, tiny_trait_2d_forced_reinsertion>; + using point_type = rt_type::point_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + struct input + { + point_type start; + point_type end; + double value; + }; + + std::vector<input> inputs = { + {{0.0, 0.0}, {1.0, 1.0}, 1.0}, {{2.0, 2.0}, {2.1, 2.1}, 2.4}, {{100.0, 80.0}, {101.0, 85.0}, 100.0}, + {{1.0, 75.0}, {2.0, 78.0}, 65.0}, {{1.0, 80.0}, {2.0, 82.0}, 68.0}, {{1.2, 1.0}, {2.2, 1.5}, 2.1}, + {{2.2, 2.2}, {2.3, 2.4}, 3.5}, {{3.0, 3.0}, {3.3, 3.4}, 3.8}, {{4.0, 4.0}, {8.3, 12.4}, 13.8}, + {{3.0, 5.0}, {4.3, 11.4}, 13.9}, + }; + + rt_type tree; + for (const input& i : inputs) + tree.insert({i.start, i.end}, double(i.value)); + + auto copied(tree); + + tree.check_integrity(check_props); + copied.check_integrity(check_props); + + std::string str_src = tree.export_tree(rt_type::export_tree_type::formatted_node_properties); + std::string str_dst = tree.export_tree(rt_type::export_tree_type::formatted_node_properties); + + assert(!str_src.empty() && str_src == str_dst); + + // Test the "copy via assignment" scenario too. + auto copied_via_assign = tree; + copied_via_assign.check_integrity(check_props); + str_dst = copied_via_assign.export_tree(rt_type::export_tree_type::formatted_node_properties); + + assert(!str_src.empty() && str_src == str_dst); +} + +/** + * Make sure the rtree works with values that are only copyable (i.e. not + * movable). + */ +void rtree_test_only_copyable() +{ + stack_printer __stack_printer__("::rtree_test_only_copyable"); + + using rt_type = rtree<float, only_copyable, tiny_trait_2d_forced_reinsertion>; + using search_type = rt_type::search_type; + using extent_type = rt_type::extent_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + rt_type tree; + const rt_type& ctree = tree; + only_copyable v(11.2); + tree.insert({{0, 0}, {2, 5}}, v); + v.set(12.5); + tree.insert({9, 9}, v); + + tree.check_integrity(check_props); + + { + // Immutable search. + auto cres = ctree.search({1, 1}, search_type::overlap); + assert(std::distance(cres.begin(), cres.end()) == 1); + assert(cres.begin()->get() == 11.2); + + cres = ctree.search({9, 9}, search_type::overlap); + assert(std::distance(cres.cbegin(), cres.cend()) == 1); + assert(cres.cbegin()->get() == 12.5); + } + + { + // Mutable search + auto res = tree.search({9, 9}, search_type::match); + assert(std::distance(res.begin(), res.end()) == 1); + assert(res.begin()->get() == 12.5); + auto it = res.begin(); + (*it).set(34.5); + + res = tree.search({9, 9}, search_type::match); + assert(std::distance(res.begin(), res.end()) == 1); + assert(res.begin()->get() == 34.5); + } + + { + // Erase the only object via mutable iterator. + assert(tree.size() == 2); + rt_type::search_results res = tree.search({{0, 0}, {100, 100}}, search_type::overlap); + assert(std::distance(res.begin(), res.end()) == 2); + + res = tree.search({9, 9}, search_type::match); + assert(std::distance(res.begin(), res.end()) == 1); + tree.erase(res.begin()); + + assert(tree.size() == 1); + res = tree.search({{0, 0}, {100, 100}}, search_type::overlap); + assert(std::distance(res.begin(), res.end()) == 1); + auto it = res.begin(); + assert(it.extent() == extent_type({{0, 0}, {2, 5}})); + assert(it->get() == 11.2); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_directory_node_split.cpp b/test/rtree/test_directory_node_split.cpp new file mode 100644 index 0000000..8f851a0 --- /dev/null +++ b/test/rtree/test_directory_node_split.cpp @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_directory_node_split() +{ + stack_printer __stack_printer__("::rtree_test_directory_node_split"); + using rt_type = rtree<int16_t, std::string, tiny_trait_2d>; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + rt_type tree; + const rt_type& ctree = tree; + using point = rt_type::point_type; + using bounding_box = rt_type::extent_type; + + for (int16_t x = 0; x < 10; ++x) + { + for (int16_t y = 0; y < 10; ++y) + { + std::ostringstream os; + os << "(x=" << x << ",y=" << y << ")"; + std::string v = os.str(); + int16_t xe = x + 1, ye = y + 1; + point s({x, y}), e({xe, ye}); + bounding_box bb(s, e); + cout << "Inserting value '" << v << "' to {" << bb.to_string() << "} ..." << endl; + tree.insert({s, e}, std::move(v)); + tree.check_integrity(check_props); + } + } + + assert(tree.size() == 100); + + // All value nodes in this tree should be at depth 4 (root having the + // depth of 0). Just check a few of them. + + std::vector<point> pts = { + {5, 5}, + {2, 3}, + {7, 9}, + }; + + for (const point& pt : pts) + { + auto res = ctree.search(pt, search_type::overlap); + auto it = res.cbegin(); + assert(it != res.cend()); + assert(it.depth() == 4); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_erase_directories.cpp b/test/rtree/test_erase_directories.cpp new file mode 100644 index 0000000..c753a1e --- /dev/null +++ b/test/rtree/test_erase_directories.cpp @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_erase_directories() +{ + stack_printer __stack_printer__("::rtree_test_erase_directories"); + using rt_type = rtree<int16_t, std::string, tiny_trait_2d>; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + rt_type tree; + const rt_type& ctree = tree; + using point = rt_type::point_type; + using bounding_box = rt_type::extent_type; + + for (int16_t x = 0; x < 5; ++x) + { + for (int16_t y = 0; y < 5; ++y) + { + std::ostringstream os; + int16_t x2 = x * 2; + int16_t y2 = y * 2; + os << "(x=" << x2 << ",y=" << y2 << ")"; + std::string v = os.str(); + int16_t xe = x2 + 2, ye = y2 + 2; + point s({x2, y2}), e({xe, ye}); + bounding_box bb(s, e); + tree.insert({s, e}, std::move(v)); + } + } + + assert(tree.size() == 25); + tree.check_integrity(check_props); + cout << tree.export_tree(rt_type::export_tree_type::formatted_node_properties) << endl; + + size_t expected_size = 25; + + for (int16_t x = 0; x < 5; ++x) + { + for (int16_t y = 0; y < 5; ++y) + { + int16_t x2 = x * 2 + 1; + int16_t y2 = y * 2 + 1; + + cout << "erase at (" << x2 << ", " << y2 << ")" << endl; + + auto res = ctree.search({x2, y2}, search_type::overlap); + auto it = res.begin(), ite = res.end(); + size_t n = std::distance(it, ite); + assert(n == 1); + + tree.erase(it); + + assert(tree.size() == --expected_size); + tree.check_integrity(check_props); + + res = ctree.search({x2, y2}, search_type::overlap); + n = std::distance(res.begin(), res.end()); + assert(n == 0); + } + } + + assert(tree.empty()); + assert(tree.size() == 0); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_exact_search_by_extent.cpp b/test/rtree/test_exact_search_by_extent.cpp new file mode 100644 index 0000000..dfcde7c --- /dev/null +++ b/test/rtree/test_exact_search_by_extent.cpp @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_exact_search_by_extent() +{ + stack_printer __stack_printer__("::rtree_test_exact_search_by_extent"); + + using rt_type = rtree<double, double, tiny_trait_2d_forced_reinsertion>; + using extent_type = rt_type::extent_type; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + rt_type tree; + const rt_type& ctree = tree; + tree.insert({{0, 0}, {2, 2}}, 1.1); + tree.insert({{1, 1}, {3, 3}}, 1.2); + tree.insert({{2, 2}, {4, 4}}, 1.3); + tree.check_integrity(check_props); + + { + // Immutable search + rt_type::const_search_results cres = ctree.search({{1, 1}, {3, 3}}, search_type::overlap); + size_t n = std::distance(cres.begin(), cres.end()); + assert(n == 3); + + cres = ctree.search({{1, 1}, {3, 3}}, search_type::match); + n = std::distance(cres.begin(), cres.end()); + assert(n == 1); + auto it = cres.cbegin(); + assert(*it == 1.2); + assert(it.extent() == extent_type({{1, 1}, {3, 3}})); + assert(it.depth() == 1); + } + + { + // Mutable search + rt_type::search_results res = tree.search({{1, 1}, {3, 3}}, search_type::overlap); + size_t n = std::distance(res.begin(), res.end()); + assert(n == 3); + + // Modify the values. + for (double& v : res) + v += 1.0; + + res = tree.search({{1, 1}, {3, 3}}, search_type::match); + n = std::distance(res.begin(), res.end()); + assert(n == 1); + assert(*res.begin() == 2.2); // The value should be updated. + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_exact_search_by_point.cpp b/test/rtree/test_exact_search_by_point.cpp new file mode 100644 index 0000000..a40852c --- /dev/null +++ b/test/rtree/test_exact_search_by_point.cpp @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_exact_search_by_point() +{ + stack_printer __stack_printer__("::rtree_test_exact_search_by_point"); + + using rt_type = rtree<double, double, tiny_trait_2d_forced_reinsertion>; + using point_type = rt_type::point_type; + using extent_type = rt_type::extent_type; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + rt_type tree; + const rt_type& ctree = tree; + tree.insert({{0, 0}, {4, 4}}, 10.0); + tree.insert({1, 1}, 11.0); + tree.insert({3, 3}, 33.0); + tree.check_integrity(check_props); + + rt_type::const_search_results res = ctree.search({1, 1}, search_type::overlap); + size_t n = std::distance(res.begin(), res.end()); + assert(n == 2); + + res = ctree.search({3, 3}, search_type::overlap); + n = std::distance(res.begin(), res.end()); + assert(n == 2); + + res = ctree.search({2, 2}, search_type::overlap); + n = std::distance(res.begin(), res.end()); + assert(n == 1); + rt_type::const_iterator it = res.begin(); + assert(*it == 10.0); + assert(it.extent() == extent_type({{0, 0}, {4, 4}})); + + res = ctree.search({1, 1}, search_type::match); + n = std::distance(res.begin(), res.end()); + assert(n == 1); + it = res.begin(); + assert(*it == 11.0); + assert(it.extent().is_point()); + assert(it.extent().start == point_type({1, 1})); + + res = ctree.search({3, 3}, search_type::match); + n = std::distance(res.begin(), res.end()); + assert(n == 1); + it = res.begin(); + assert(*it == 33.0); + assert(it.extent().is_point()); + assert(it.extent().start == point_type({3, 3})); + + res = ctree.search({{0, 0}, {4, 4}}, search_type::match); + n = std::distance(res.begin(), res.end()); + assert(n == 1); + it = res.begin(); + assert(*it == 10.0); + assert(it.extent() == extent_type({{0, 0}, {4, 4}})); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_forced_reinsertion.cpp b/test/rtree/test_forced_reinsertion.cpp new file mode 100644 index 0000000..a23e29a --- /dev/null +++ b/test/rtree/test_forced_reinsertion.cpp @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_forced_reinsertion() +{ + stack_printer __stack_printer__("::rtree_test_forced_reinsertion"); + + using rt_type = rtree<int16_t, std::string, tiny_trait_2d_forced_reinsertion>; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + rt_type tree; + + for (int16_t i = 0; i < 6; ++i) + { + int16_t w = 1; + std::ostringstream os; + os << "foo" << i; + tree.insert({{i, i}, {int16_t(i + w), int16_t(i + w)}}, os.str()); + } + + assert(tree.size() == 6); + tree.check_integrity(check_props); + + tree.clear(); + assert(tree.empty()); + assert(tree.size() == 0); + tree.check_integrity(check_props); + + for (int16_t x = 0; x < 5; ++x) + { + for (int16_t y = 0; y < 5; ++y) + { + std::ostringstream os; + int16_t x2 = x * 2; + int16_t y2 = y * 2; + os << "(x=" << x2 << ",y=" << y2 << ")"; + std::string v = os.str(); + int16_t xe = x2 + 2, ye = y2 + 2; + tree.insert({{x2, y2}, {xe, ye}}, std::move(v)); + } + } + + tree.check_integrity(check_props); + assert(tree.size() == 25); + + export_tree(tree, "rtree-test-forced-reinsertion"); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_geometry.cpp b/test/rtree/test_geometry.cpp new file mode 100644 index 0000000..77b89b1 --- /dev/null +++ b/test/rtree/test_geometry.cpp @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_area_enlargement() +{ + stack_printer __stack_printer__("::rtree_test_area_enlargement"); + using rt_type = rtree<int16_t, std::string>; + using bounding_box = rt_type::extent_type; + using mdds::detail::rtree::calc_area_enlargement; + + struct check + { + bounding_box host; + bounding_box guest; + int16_t expected_area; + }; + + std::vector<check> checks = { + {{{0, 0}, {2, 2}}, {{2, 2}, {3, 3}}, 5}, // 3x3 - 2x2 = 5 + {{{0, 0}, {2, 2}}, {{0, 1}, {1, 2}}, 0}, // no enlargement + {{{0, 0}, {3, 3}}, {{-3, 1}, {7, 2}}, 21}, // 10x3 - 3x3 = 21 + {{{0, 0}, {0, 0}}, {{-1, -1}, {0, 0}}, 1}, // 1x1 = 1 + {{{0, 0}, {1, 1}}, {{-4, -3}, {-3, -2}}, 19}, // 5x4 - 1x1 = 19 + }; + + for (const check& c : checks) + { + int16_t area = calc_area_enlargement(c.host, c.guest); + assert(area == c.expected_area); + } +} + +void rtree_test_center_point() +{ + stack_printer __stack_printer__("::rtree_test_center_point"); + using rt_type = rtree<int16_t, std::string, tiny_trait_2d>; + using mdds::detail::rtree::get_center_point; + using extent_type = rt_type::extent_type; + using point_type = rt_type::point_type; + + struct test_case + { + extent_type extent; + point_type expected; + }; + + std::vector<test_case> tcs = { + {{{0, 0}, {2, 2}}, {1, 1}}, + {{{-2, -4}, {2, 4}}, {0, 0}}, + {{{3, 5}, {8, 10}}, {5, 7}}, + }; + + for (const test_case& tc : tcs) + { + cout << "extent: " << tc.extent.to_string() << endl; + auto pt = get_center_point(tc.extent); + assert(pt == tc.expected); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_global_rtree.hpp b/test/rtree/test_global_rtree.hpp new file mode 100644 index 0000000..7819cda --- /dev/null +++ b/test/rtree/test_global_rtree.hpp @@ -0,0 +1,148 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2018 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#ifndef INCLUDED_MDDS_TEST_GLOBAL_RTREE_HPP +#define INCLUDED_MDDS_TEST_GLOBAL_RTREE_HPP + +#define MDDS_RTREE_DEBUG 1 +#include <mdds/rtree.hpp> +#include <fstream> + +struct tiny_trait_1d +{ + constexpr static size_t dimensions = 1; + constexpr static size_t min_node_size = 2; + constexpr static size_t max_node_size = 5; + constexpr static size_t max_tree_depth = 100; + + constexpr static bool enable_forced_reinsertion = false; + constexpr static size_t reinsertion_size = 2; +}; + +struct tiny_trait_2d +{ + constexpr static size_t dimensions = 2; + constexpr static size_t min_node_size = 2; + constexpr static size_t max_node_size = 5; + constexpr static size_t max_tree_depth = 100; + + constexpr static bool enable_forced_reinsertion = false; + constexpr static size_t reinsertion_size = 2; +}; + +struct tiny_trait_2d_forced_reinsertion +{ + constexpr static size_t dimensions = 2; + constexpr static size_t min_node_size = 2; + constexpr static size_t max_node_size = 5; + constexpr static size_t max_tree_depth = 100; + + constexpr static bool enable_forced_reinsertion = true; + constexpr static size_t reinsertion_size = 2; +}; + +class only_movable +{ + double m_value; + +public: + only_movable() : m_value(0.0) + {} + only_movable(double v) : m_value(v) + {} + only_movable(const only_movable&) = delete; + only_movable(only_movable&& other) : m_value(other.m_value) + { + other.m_value = 0.0; + } + + double get() const + { + return m_value; + } +}; + +class only_copyable +{ + double m_value; + +public: + only_copyable() : m_value(0.0) + {} + only_copyable(double v) : m_value(v) + {} + only_copyable(const only_copyable& other) : m_value(other.m_value) + {} + + only_copyable(only_copyable&&) = delete; + + void set(double v) + { + m_value = v; + } + double get() const + { + return m_value; + } +}; + +template<typename T> +void export_tree(const T& tree, const std::string& basename) +{ + { + std::ofstream fout(basename + ".obj"); + fout << tree.export_tree(T::export_tree_type::extent_as_obj); + } + + { + std::ofstream fout(basename + ".svg"); + fout << tree.export_tree(T::export_tree_type::extent_as_svg); + } +} + +void rtree_test_intersection(); +void rtree_test_square_distance(); +void rtree_test_center_point(); +void rtree_test_area_enlargement(); +void rtree_test_basic_search(); +void rtree_test_basic_erase(); +void rtree_test_node_split(); +void rtree_test_directory_node_split(); +void rtree_test_erase_directories(); +void rtree_test_forced_reinsertion(); +void rtree_test_move(); +void rtree_test_move_custom_type(); +void rtree_test_copy(); +void rtree_test_point_objects(); +void rtree_test_only_copyable(); +void rtree_test_exact_search_by_extent(); +void rtree_test_exact_search_by_point(); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_intersection.cpp b/test/rtree/test_intersection.cpp new file mode 100644 index 0000000..0cf5b93 --- /dev/null +++ b/test/rtree/test_intersection.cpp @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_intersection() +{ + stack_printer __stack_printer__("::rtree_test_intersection"); + using rt_type = rtree<int16_t, std::string>; + using bounding_box = rt_type::extent_type; + using mdds::detail::rtree::calc_intersection; + using mdds::detail::rtree::calc_linear_intersection; + + struct check + { + bounding_box bb1; + bounding_box bb2; + int16_t expected_length1; + int16_t expected_length2; + }; + + std::vector<check> checks = { + // bounding box 1 bounding box 2 + {{{0, 0}, {3, 6}}, {{1, 2}, {7, 5}}, 2, 3}, {{{3, 2}, {7, 10}}, {{1, 10}, {10, 11}}, 4, 0}, + {{{3, 2}, {7, 10}}, {{1, 9}, {10, 11}}, 4, 1}, {{{3, 2}, {7, 6}}, {{5, 4}, {11, 8}}, 2, 2}, + {{{-2, -8}, {2, -5}}, {{0, -10}, {8, -1}}, 2, 3}, {{{2, 2}, {20, 12}}, {{5, 6}, {16, 9}}, 11, 3}, + {{{0, 0}, {6, 6}}, {{0, 0}, {2, 3}}, 2, 3}, + }; + + for (const check& c : checks) + { + int16_t length1 = calc_linear_intersection<bounding_box>(0, c.bb1, c.bb2); + assert(length1 == c.expected_length1); + int16_t length2 = calc_linear_intersection<bounding_box>(1, c.bb1, c.bb2); + assert(length2 == c.expected_length2); + + int16_t area = calc_intersection<bounding_box>(c.bb1, c.bb2); + int16_t expected_area = c.expected_length1 * c.expected_length2; + assert(area == expected_area); + + // Swap the boxes and run the same tests. We should get the same results. + + length1 = calc_linear_intersection<bounding_box>(0, c.bb2, c.bb1); + assert(length1 == c.expected_length1); + length2 = calc_linear_intersection<bounding_box>(1, c.bb2, c.bb1); + assert(length2 == c.expected_length2); + + area = calc_intersection<bounding_box>(c.bb2, c.bb1); + assert(area == expected_area); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_main.cpp b/test/rtree/test_main.cpp new file mode 100644 index 0000000..6e776a8 --- /dev/null +++ b/test/rtree/test_main.cpp @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2018 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using namespace std; + +int main() +{ + try + { + rtree_test_intersection(); + rtree_test_square_distance(); + rtree_test_center_point(); + rtree_test_area_enlargement(); + rtree_test_basic_search(); + rtree_test_basic_erase(); + rtree_test_node_split(); + rtree_test_directory_node_split(); + rtree_test_erase_directories(); + rtree_test_forced_reinsertion(); + rtree_test_move(); + rtree_test_move_custom_type(); + rtree_test_copy(); + rtree_test_point_objects(); + rtree_test_only_copyable(); + rtree_test_exact_search_by_extent(); + rtree_test_exact_search_by_point(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_move.cpp b/test/rtree/test_move.cpp new file mode 100644 index 0000000..1a81b82 --- /dev/null +++ b/test/rtree/test_move.cpp @@ -0,0 +1,134 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_move() +{ + stack_printer __stack_printer__("::rtree_test_move"); + + using rt_type = rtree<int16_t, std::string, tiny_trait_2d_forced_reinsertion>; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + rt_type tree; + + for (int16_t x = 0; x < 5; ++x) + { + for (int16_t y = 0; y < 5; ++y) + { + std::ostringstream os; + int16_t x2 = x * 2; + int16_t y2 = y * 2; + os << "(x=" << x2 << ",y=" << y2 << ")"; + std::string v = os.str(); + int16_t xe = x2 + 2, ye = y2 + 2; + tree.insert({{x2, y2}, {xe, ye}}, std::move(v)); + } + } + + tree.check_integrity(check_props); + assert(tree.size() == 25); + + // moved via constructor. + rt_type tree_moved(std::move(tree)); + tree.check_integrity(check_props); + tree_moved.check_integrity(check_props); + assert(tree.empty()); + assert(tree.size() == 0); + assert(tree_moved.size() == 25); + + // moved via assignment operator. + rt_type tree_moved_2; + tree_moved_2.check_integrity(check_props); + tree_moved_2 = std::move(tree_moved); + tree_moved.check_integrity(check_props); + tree_moved_2.check_integrity(check_props); + assert(tree_moved.empty()); + assert(tree_moved.size() == 0); + assert(tree_moved_2.size() == 25); +} + +/** + * Make sure we can 1) store objects that are only movable but not copyable, + * and 2) the whole tree can still be moved. + */ +void rtree_test_move_custom_type() +{ + stack_printer __stack_printer__("::rtree_test_move_custom_type"); + + using rt_type = rtree<double, only_movable, tiny_trait_2d_forced_reinsertion>; + using point_type = rt_type::point_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + { + // Make sure you can actually move an object of this type. + only_movable v1(1.5); + only_movable v2(std::move(v1)); + } + + struct input + { + point_type start; + point_type end; + double value; + }; + + std::vector<input> inputs = { + {{0.0, 0.0}, {1.0, 1.0}, 1.0}, {{2.0, 2.0}, {2.1, 2.1}, 2.4}, {{100.0, 80.0}, {101.0, 85.0}, 100.0}, + {{1.0, 75.0}, {2.0, 78.0}, 65.0}, {{1.0, 80.0}, {2.0, 82.0}, 68.0}, {{1.2, 1.0}, {2.2, 1.5}, 2.1}, + {{2.2, 2.2}, {2.3, 2.4}, 3.5}, {{3.0, 3.0}, {3.3, 3.4}, 3.8}, {{4.0, 4.0}, {8.3, 12.4}, 13.8}, + {{3.0, 5.0}, {4.3, 11.4}, 13.9}, + }; + + rt_type tree; + + for (const input& i : inputs) + tree.insert({i.start, i.end}, only_movable(i.value)); + + assert(tree.size() == inputs.size()); + + tree.check_integrity(check_props); + + export_tree(tree, "rtree-test-move-custom-type"); + + // Now move the tree. + rt_type tree_moved = std::move(tree); + tree.check_integrity(check_props); + tree_moved.check_integrity(check_props); + assert(tree.empty()); + assert(tree_moved.size() == inputs.size()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_node_split.cpp b/test/rtree/test_node_split.cpp new file mode 100644 index 0000000..c09727a --- /dev/null +++ b/test/rtree/test_node_split.cpp @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_node_split() +{ + stack_printer __stack_printer__("::rtree_test_node_split"); + using rt_type = rtree<int16_t, std::string, tiny_trait_2d>; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = true; + + rt_type tree; + const rt_type& ctree = tree; + + // Inserting 6 entries should cause the root directory node to split. + // After the split, the root node should become a non-leaf directory + // storing two leaf directory nodes as its children. + + for (int16_t i = 0; i < 6; ++i) + { + int16_t w = 1; + std::ostringstream os; + os << "foo" << i; + tree.insert({{i, i}, {int16_t(i + w), int16_t(i + w)}}, os.str()); + } + + assert(tree.size() == 6); + + cout << tree.export_tree(rt_type::export_tree_type::formatted_node_properties) << endl; + + size_t count_values = 0; + size_t count_leaf = 0; + size_t count_nonleaf = 0; + + auto walker = [&](const rt_type::node_properties& np) { + switch (np.type) + { + case rt_type::node_type::value: + ++count_values; + break; + case rt_type::node_type::directory_leaf: + ++count_leaf; + break; + case rt_type::node_type::directory_nonleaf: + ++count_nonleaf; + break; + default:; + } + }; + + tree.walk(walker); + + assert(count_values == 6); + assert(count_leaf == 2); + assert(count_nonleaf == 1); + + tree.check_integrity(check_props); + + // Adding two more entries will cause one of the leaf directory nodes + // below the root node to split. + + for (int16_t i = 6; i < 8; ++i) + { + int16_t w = 1; + std::ostringstream os; + os << "bar" << i; + tree.insert({{i, i}, {int16_t(i + w), int16_t(i + w)}}, os.str()); + } + + assert(tree.size() == 8); + tree.check_integrity(check_props); + + // Count all the nodes again. + count_values = 0; + count_leaf = 0; + count_nonleaf = 0; + + tree.walk(walker); + + assert(count_values == 8); + assert(count_leaf == 3); + assert(count_nonleaf == 1); + + // Erase the entry at (0, 0). There should be only one match. Erasing + // this entry will cause the node to be underfilled. + + rt_type::const_search_results res = ctree.search({0, 0}, search_type::overlap); + auto it = res.cbegin(); + assert(it != res.cend()); + assert(std::distance(it, res.cend()) == 1); + tree.erase(it); + + assert(tree.size() == 7); + tree.check_integrity(check_props); + + // Count all the nodes again. + count_values = 0; + count_leaf = 0; + count_nonleaf = 0; + + tree.walk(walker); + + assert(count_values == 7); + assert(count_leaf == 2); + assert(count_nonleaf == 1); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_point_objects.cpp b/test/rtree/test_point_objects.cpp new file mode 100644 index 0000000..b2a3602 --- /dev/null +++ b/test/rtree/test_point_objects.cpp @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_point_objects() +{ + stack_printer __stack_printer__("::rtree_test_point_objects"); + + using rt_type = rtree<double, double, tiny_trait_2d_forced_reinsertion>; + using key_type = rt_type::key_type; + using search_type = rt_type::search_type; + rt_type::integrity_check_properties check_props; + check_props.throw_on_first_error = false; + + rt_type tree; + const rt_type& ctree = tree; + + for (key_type x = 0; x < 10; ++x) + { + for (key_type y = 0; y < 10; ++y) + { + tree.insert({x, y}, x * y); + } + } + + tree.check_integrity(check_props); + + for (key_type x = 0; x < 10; ++x) + { + for (key_type y = 0; y < 10; ++y) + { + auto results = tree.search({x, y}, search_type::overlap); + assert(std::distance(results.begin(), results.end()) == 1); + double expected = x * y; + auto it = results.begin(); + assert(expected == *it); + } + } + + // Test an extent-based search on point data. + auto results = ctree.search({{0, 0}, {3, 3}}, search_type::overlap); + size_t n_results = std::distance(results.cbegin(), results.cend()); + assert(n_results == 16); + + export_tree(tree, "rtree-test-point-objects"); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/rtree/test_square_distance.cpp b/test/rtree/test_square_distance.cpp new file mode 100644 index 0000000..4ea80d3 --- /dev/null +++ b/test/rtree/test_square_distance.cpp @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "test_global_rtree.hpp" + +using mdds::rtree; +using std::cout; +using std::endl; + +void rtree_test_square_distance() +{ + stack_printer __stack_printer__("::rtree_test_square_distance"); + using mdds::detail::rtree::calc_square_distance; + + { + // 1 dimensional unsigned + using rt_type = rtree<uint16_t, std::string, tiny_trait_1d>; + using point_type = rt_type::point_type; + + struct test_case + { + point_type p1; + point_type p2; + uint16_t expected; + }; + + std::vector<test_case> tcs = { + {{3}, {5}, 4}, + {{9}, {2}, 49}, + {{0}, {0}, 0}, + }; + + for (const test_case& tc : tcs) + { + cout << "p1: " << tc.p1.to_string() << "; p2: " << tc.p2.to_string() << endl; + + uint16_t dist = calc_square_distance<point_type>(tc.p1, tc.p2); + assert(dist == tc.expected); + + // Flip the value to make sure we still get the same result. + dist = calc_square_distance<point_type>(tc.p2, tc.p1); + assert(dist == tc.expected); + } + } + + { + // 2 dimensional unsigned + using rt_type = rtree<uint16_t, std::string, tiny_trait_2d>; + using point_type = rt_type::point_type; + + struct test_case + { + point_type p1; + point_type p2; + uint16_t expected; + }; + + std::vector<test_case> tcs = { + {{0, 0}, {0, 0}, 0}, + {{0, 0}, {1, 1}, 2}, + {{0, 0}, {2, 2}, 8}, + {{3, 0}, {0, 4}, 25}, + }; + + for (const test_case& tc : tcs) + { + cout << "p1: " << tc.p1.to_string() << "; p2: " << tc.p2.to_string() << endl; + + uint16_t dist = calc_square_distance<point_type>(tc.p1, tc.p2); + assert(dist == tc.expected); + + // Flip the value to make sure we still get the same result. + dist = calc_square_distance<point_type>(tc.p2, tc.p1); + assert(dist == tc.expected); + } + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/segment_tree/Makefile.am b/test/segment_tree/Makefile.am new file mode 100644 index 0000000..b4927a7 --- /dev/null +++ b/test/segment_tree/Makefile.am @@ -0,0 +1,14 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/segment_tree/Makefile.in b/test/segment_tree/Makefile.in new file mode 100644 index 0000000..97cc373 --- /dev/null +++ b/test/segment_tree/Makefile.in @@ -0,0 +1,990 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/segment_tree +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_main.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/segment_tree/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/segment_tree/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/segment_tree/test_main.cpp b/test/segment_tree/test_main.cpp new file mode 100644 index 0000000..c636a22 --- /dev/null +++ b/test/segment_tree/test_main.cpp @@ -0,0 +1,1136 @@ +/************************************************************************* + * + * Copyright (c) 2010, 2011 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. +#include "mdds/segment_tree.hpp" + +#include <cstdlib> +#include <cstdio> +#include <iostream> +#include <list> +#include <memory> +#include <sstream> +#include <string> +#include <vector> + +#define ARRAY_SIZE(x) sizeof(x) / sizeof(x[0]) + +using namespace std; +using namespace mdds; + +template<typename key_type, typename value_type> +void build_and_dump(segment_tree<key_type, value_type>& db) +{ + cout << "build and dump (start) -----------------------------------------" << endl; + db.build_tree(); + db.dump_tree(); + db.dump_leaf_nodes(); + cout << "build and dump (end) -------------------------------------------" << endl; +} + +struct test_data +{ + string name; // data structure expects the data to have 'name' data member. + + test_data(const string& s) : name(s) + {} + + struct ptr_printer + { + void operator()(const test_data* data) const + { + cout << data->name << " "; + } + }; + + /** + * Use this to sort instances of test_data by name, in ascending order. + */ + struct sort_by_name + { + bool operator()(const test_data* left, const test_data* right) const + { + return left->name < right->name; + } + }; + + struct name_printer + { + void operator()(const test_data* p) const + { + cout << p->name << " "; + } + }; +}; + +template<typename key_type, typename value_type> +bool check_leaf_nodes( + const segment_tree<key_type, value_type>& db, const key_type* keys, value_type* data_chain, size_t key_size) +{ + typedef segment_tree<key_type, value_type> st_type; + vector<typename st_type::leaf_node_check> checks; + checks.reserve(key_size); + size_t dcid = 0; + for (size_t i = 0; i < key_size; ++i) + { + typename st_type::leaf_node_check c; + c.key = keys[i]; + value_type p = data_chain[dcid]; + while (p) + { + c.data_chain.push_back(p); + p = data_chain[++dcid]; + } + checks.push_back(c); + ++dcid; + } + + return db.verify_leaf_nodes(checks); +} + +template<typename value_type> +bool check_against_expected(const list<value_type>& test, value_type* expected) +{ + size_t i = 0; + value_type p = expected[i++]; + typename list<value_type>::const_iterator itr = test.begin(), itr_end = test.end(); + while (p) + { + if (itr == itr_end) + // data chain ended prematurely. + return false; + + if (*itr != p) + // the value is not as expected. + return false; + + p = expected[i++]; + ++itr; + } + if (itr != itr_end) + // data chain is too long. + return false; + + return true; +} + +/** + * Only check the search result against expected result set. The caller + * needs to run search and pass the result to this function. + */ +template<typename key_type, typename value_type> +bool check_search_result_only( + const segment_tree<key_type, value_type>& /*db*/, + const typename segment_tree<key_type, value_type>::search_results_type& result, key_type key, value_type* expected) +{ + cout << "search key: " << key << " "; + + list<value_type> test; + copy(result.begin(), result.end(), back_inserter(test)); + test.sort(test_data::sort_by_name()); + + cout << "search result (sorted): "; + for_each(test.begin(), test.end(), test_data::name_printer()); + cout << endl; + + return check_against_expected(test, expected); +} + +/** + * Run the search and check the search result. + */ +template<typename key_type, typename value_type> +bool check_search_result(const segment_tree<key_type, value_type>& db, key_type key, value_type* expected) +{ + cout << "search key: " << key << " "; + + typedef typename segment_tree<key_type, value_type>::search_results_type search_result_type; + search_result_type data_chain; + db.search(key, data_chain); + return check_search_result_only(db, data_chain, key, expected); +} + +template<typename key_type, typename value_type> +bool check_search_result_iterator(const segment_tree<key_type, value_type>& db, key_type key, value_type* expected) +{ + cout << "search key: " << key << " "; + + typedef segment_tree<key_type, value_type> db_type; + typename db_type::search_results result = db.search(key); + list<value_type> test; + copy(result.begin(), result.end(), back_inserter(test)); + test.sort(test_data::sort_by_name()); + + cout << "search result (sorted): "; + for_each(test.begin(), test.end(), test_data::name_printer()); + cout << endl; + + return check_against_expected(test, expected); +} + +void st_test_insert_search_removal() +{ + stack_printer __stack_printer__("::st_test_insert_segments"); + + typedef long key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + db_type db; + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + + build_and_dump(db); + assert(db_type::node::get_instance_count() == 0); + + db.insert(0, 10, &A); + build_and_dump(db); + { + key_type keys[] = {0, 10}; + value_type* data_chain[] = {&A, 0, 0}; + assert(check_leaf_nodes(db, keys, data_chain, ARRAY_SIZE(keys))); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.verify_node_lists()); + } + + db.insert(0, 5, &B); + build_and_dump(db); + { + key_type keys[] = {0, 5, 10}; + value_type* data_chain[] = {&A, &B, 0, &A, 0, 0}; + assert(check_leaf_nodes(db, keys, data_chain, ARRAY_SIZE(keys))); + assert(db_type::node::get_instance_count() == db.leaf_size()); + } + + db.insert(5, 12, &C); + build_and_dump(db); + { + key_type keys[] = {0, 5, 10, 12}; + value_type* data_chain[] = {&A, &B, 0, &A, &C, 0, &C, 0, 0}; + assert(check_leaf_nodes(db, keys, data_chain, ARRAY_SIZE(keys))); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.verify_node_lists()); + } + + db.insert(10, 24, &D); + build_and_dump(db); + { + key_type keys[] = {0, 5, 10, 12, 24}; + value_type* data_chain[] = {&A, &B, 0, &A, &C, 0, &C, &D, 0, &D, 0, 0}; + assert(check_leaf_nodes(db, keys, data_chain, ARRAY_SIZE(keys))); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.verify_node_lists()); + } + + db.insert(4, 24, &E); + build_and_dump(db); + { + key_type keys[] = {0, 4, 5, 10, 12, 24}; + value_type* data_chain[] = {&B, 0, &B, &E, 0, &A, &C, 0, &C, &D, 0, &D, &E, 0, 0}; + assert(check_leaf_nodes(db, keys, data_chain, ARRAY_SIZE(keys))); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.verify_node_lists()); + } + + db.insert(0, 26, &F); + build_and_dump(db); + { + key_type keys[] = {0, 4, 5, 10, 12, 24, 26}; + value_type* data_chain[] = {&B, 0, &B, &E, 0, &A, &C, 0, &C, &D, 0, &D, &E, &F, 0, &F, 0, 0}; + assert(check_leaf_nodes(db, keys, data_chain, ARRAY_SIZE(keys))); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.verify_node_lists()); + } + + db.insert(12, 26, &G); + build_and_dump(db); + { + key_type keys[] = {0, 4, 5, 10, 12, 24, 26}; + value_type* data_chain[] = {&B, 0, &B, &E, 0, &A, &C, 0, &C, &D, 0, &D, &E, &F, &G, 0, &F, &G, 0, 0}; + assert(check_leaf_nodes(db, keys, data_chain, ARRAY_SIZE(keys))); + assert(db_type::node::get_instance_count() == db.leaf_size()); + assert(db.verify_node_lists()); + } + + // Search tests. Test boundary cases. + + for (key_type i = -10; i <= 30; ++i) + { + db_type::search_results_type data_chain; + db.search(i, data_chain); + cout << "search key " << i << ": "; + for_each(data_chain.begin(), data_chain.end(), test_data::ptr_printer()); + cout << endl; + } + + { + key_type key = -1; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 0; + value_type* expected[] = {&A, &B, &F, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 4; + value_type* expected[] = {&A, &B, &E, &F, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 5; + value_type* expected[] = {&A, &C, &E, &F, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 10; + value_type* expected[] = {&C, &D, &E, &F, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 12; + value_type* expected[] = {&D, &E, &F, &G, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 24; + value_type* expected[] = {&F, &G, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 30; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 9999; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + // Remove E, F and G and check search results. + + db.remove(&E); + db.remove(&F); + db.remove(&G); + cout << "removed: E F G" << endl; + db.dump_tree(); + db.dump_leaf_nodes(); + + for (key_type i = -10; i <= 30; ++i) + { + db_type::search_results_type data_chain; + db.search(i, data_chain); + cout << "search key " << i << ": "; + for_each(data_chain.begin(), data_chain.end(), test_data::ptr_printer()); + cout << endl; + } + + { + key_type key = -1; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 0; + value_type* expected[] = {&A, &B, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 4; + value_type* expected[] = {&A, &B, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 5; + value_type* expected[] = {&A, &C, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 10; + value_type* expected[] = {&C, &D, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 12; + value_type* expected[] = {&D, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 24; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 30; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 9999; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + // Re-build the tree and check the search results once again, to make sure + // we get the same results. + + db.build_tree(); + db.dump_tree(); + db.dump_leaf_nodes(); + + { + key_type key = -1; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 0; + value_type* expected[] = {&A, &B, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 4; + value_type* expected[] = {&A, &B, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 5; + value_type* expected[] = {&A, &C, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 10; + value_type* expected[] = {&C, &D, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 12; + value_type* expected[] = {&D, 0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 24; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } + + { + key_type key = 30; + value_type* expected[] = {0}; + assert(check_search_result(db, key, expected)); + } +} + +void st_test_copy_constructor() +{ + stack_printer __stack_printer__("::st_test_copy_constructor"); + + typedef long key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + db_type db; + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + vector<db_type::segment_data> segments; + segments.push_back(db_type::segment_data(0, 10, &A)); + segments.push_back(db_type::segment_data(0, 5, &B)); + segments.push_back(db_type::segment_data(5, 12, &C)); + segments.push_back(db_type::segment_data(10, 24, &D)); + segments.push_back(db_type::segment_data(4, 24, &E)); + segments.push_back(db_type::segment_data(0, 26, &F)); + segments.push_back(db_type::segment_data(12, 26, &G)); + segments.push_back(db_type::segment_data(0, 0, nullptr)); // null-terminated + + db_type::segment_map_type checks; + for (size_t i = 0; segments[i].pdata; ++i) + { + db.insert(segments[i].begin_key, segments[i].end_key, segments[i].pdata); + pair<key_type, key_type> range; + range.first = segments[i].begin_key; + range.second = segments[i].end_key; + checks.insert(db_type::segment_map_type::value_type(segments[i].pdata, range)); + } + + // Copy before the tree is built. + + db.dump_segment_data(); + assert(db.verify_segment_data(checks)); + + db_type db_copied(db); + db_copied.dump_segment_data(); + assert(db_copied.verify_segment_data(checks)); + assert(db.is_tree_valid() == db_copied.is_tree_valid()); + assert(db == db_copied); + + // Copy after the tree is built. + db.build_tree(); + db_type db_copied_tree(db); + db_copied_tree.dump_segment_data(); + db_copied_tree.dump_tree(); + assert(db_copied_tree.verify_segment_data(checks)); + assert(db.is_tree_valid() == db_copied_tree.is_tree_valid()); + assert(db == db_copied_tree); +} + +void st_test_equality() +{ + stack_printer __stack_printer__("::st_test_equality"); + + typedef uint32_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + { + db_type db1, db2; + db1.insert(0, 10, &A); + db2.insert(0, 10, &A); + assert(db1 == db2); + db2.insert(5, 12, &B); + assert(db1 != db2); + db1.insert(5, 12, &C); + assert(db1 != db2); + db1.remove(&C); + db2.remove(&B); + assert(db1 == db2); + db1.insert(4, 20, &D); + db2.insert(4, 20, &D); + assert(db1 == db2); + db1.insert(3, 12, &E); + db2.insert(3, 15, &E); + assert(db1 != db2); + } +} + +void st_test_clear() +{ + stack_printer __stack_printer__("::st_test_clear"); + + typedef uint8_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + + vector<db_type::segment_data> segments; + segments.push_back(db_type::segment_data(0, 10, &A)); + segments.push_back(db_type::segment_data(0, 5, &B)); + segments.push_back(db_type::segment_data(5, 12, &C)); + segments.push_back(db_type::segment_data(10, 24, &D)); + segments.push_back(db_type::segment_data(4, 24, &E)); + segments.push_back(db_type::segment_data(0, 26, &F)); + segments.push_back(db_type::segment_data(12, 26, &G)); + segments.push_back(db_type::segment_data(0, 0, nullptr)); // null-terminated + + db_type db; + for (size_t i = 0; segments[i].pdata; ++i) + db.insert(segments[i].begin_key, segments[i].end_key, segments[i].pdata); + + assert(!db.empty()); + assert(db.size() == 7); + cout << "size of db is " << db.size() << endl; + + db.clear(); + assert(db.empty()); + assert(db.size() == 0); + + // Insert the same data set once again, but this time build tree afterwards. + for (size_t i = 0; segments[i].pdata; ++i) + db.insert(segments[i].begin_key, segments[i].end_key, segments[i].pdata); + + db.build_tree(); + assert(!db.empty()); + assert(db.size() == 7); + + db.clear(); + assert(db.empty()); + assert(db.size() == 0); +} + +void st_test_duplicate_insertion() +{ + stack_printer __stack_printer__("::st_test_duplicate_insertion"); + + typedef short key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + + db_type db; + assert(db.insert(0, 10, &A)); + assert(!db.insert(0, 10, &A)); + assert(!db.insert(2, 30, &A)); + assert(db.insert(0, 10, &B)); + db.remove(&A); + assert(db.insert(2, 30, &A)); + build_and_dump(db); +} + +/** + * When the number of segments is not a multiple of 2, it creates a tree + * where the right side becomes "cut off". Make sure the search works + * correctly under those conditions. + */ +void st_test_search_on_uneven_tree() +{ + stack_printer __stack_printer__("::st_test_search_on_uneven_tree"); + + typedef int16_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + for (key_type data_count = 10; data_count < 20; ++data_count) + { + vector<unique_ptr<test_data>> data_store; + data_store.reserve(data_count); + for (key_type i = 0; i < data_count; ++i) + { + ostringstream os; + os << hex << showbase << i; + data_store.emplace_back(new test_data(os.str())); + } + assert(data_store.size() == static_cast<size_t>(data_count)); + + db_type db; + for (key_type i = 0; i < data_count; ++i) + { + test_data* p = data_store[i].get(); + db.insert(0, i + 1, p); + } + assert(db.size() == static_cast<size_t>(data_count)); + + db.build_tree(); + + for (key_type i = -1; i < data_count + 1; ++i) + { + db_type::search_results_type result; + bool success = db.search(i, result); + assert(success); + cout << "search key: " << i << " result: "; + for_each(result.begin(), result.end(), test_data::name_printer()); + cout << endl; + } + } +} + +void st_test_perf_insertion() +{ + stack_printer __stack_printer__("::st_test_perf_insertion"); + + typedef uint32_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + key_type data_count = 1000000; + + // First, create test data instances and store them into a vector. + vector<unique_ptr<test_data>> data_store; + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: data array creation"); + data_store.reserve(data_count); + for (key_type i = 0; i < data_count; ++i) + { + ostringstream os; + os << hex << i; + data_store.emplace_back(new test_data(os.str())); + } + } + assert(data_store.size() == data_count); + + db_type db; + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: data array insertion into segment tree"); + for (key_type i = 0; i < data_count; ++i) + { + test_data* p = data_store[i].get(); + db.insert(0, i + 1, p); + } + } + assert(db.size() == data_count); + + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: build tree"); + db.build_tree(); + } + assert(db.is_tree_valid()); + + const test_data* test = nullptr; + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: 200 searches with max results"); + for (key_type i = 0; i < 200; ++i) + { + db_type::search_results_type result; + db.search(0, result); + db_type::search_results_type::const_iterator itr = result.begin(), itr_end = result.end(); + for (; itr != itr_end; ++itr) + { + test = *itr; + assert(test); + } + } + } + + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: 200 searches with max results (iterator)"); + for (key_type i = 0; i < 200; ++i) + { + db_type::search_results result = db.search(0); + db_type::search_results::iterator itr = result.begin(), itr_end = result.end(); + for (; itr != itr_end; ++itr) + { + test = *itr; + assert(test); + } + } + } + + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: 200 searches with median results"); + for (key_type i = 0; i < 200; ++i) + { + db_type::search_results_type result; + db.search(data_count / 2, result); + db_type::search_results_type::const_iterator itr = result.begin(), itr_end = result.end(); + for (; itr != itr_end; ++itr) + { + test = *itr; + assert(test); + } + } + } + + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: 200 searches with median results (iterator)"); + for (key_type i = 0; i < 200; ++i) + { + db_type::search_results result = db.search(data_count / 2); + db_type::search_results::iterator itr = result.begin(), itr_end = result.end(); + for (; itr != itr_end; ++itr) + { + test = *itr; + assert(test); + } + } + } + + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: 200 searches with empty results"); + for (key_type i = 0; i < 200; ++i) + { + db_type::search_results_type result; + db.search(data_count, result); + db_type::search_results_type::const_iterator itr = result.begin(), itr_end = result.end(); + for (; itr != itr_end; ++itr) + { + test = *itr; + assert(test); + } + } + } + + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: 200 searches with empty results (iterator)"); + for (key_type i = 0; i < 200; ++i) + { + db_type::search_results result = db.search(data_count); + db_type::search_results::iterator itr = result.begin(), itr_end = result.end(); + for (; itr != itr_end; ++itr) + { + test = *itr; + assert(test); + } + } + } + + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: 10000 segment removals"); + for (key_type i = 0; i < 10000; ++i) + { + test_data* p = data_store[i].get(); + db.remove(p); + } + } + assert(db.size() == data_count - 10000); + + { + stack_printer __stack_printer2__("::st_test_perf_insertion:: clear"); + db.clear(); + } +} + +void st_test_aggregated_search_results() +{ + stack_printer __stack_printer__("::st_test_aggregated_search_results"); + + typedef uint16_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + + vector<db_type::segment_data> segments; + segments.push_back(db_type::segment_data(0, 10, &A)); + segments.push_back(db_type::segment_data(0, 5, &B)); + segments.push_back(db_type::segment_data(5, 12, &C)); + segments.push_back(db_type::segment_data(10, 24, &D)); + segments.push_back(db_type::segment_data(4, 24, &E)); + segments.push_back(db_type::segment_data(0, 26, &F)); + segments.push_back(db_type::segment_data(12, 26, &G)); + segments.push_back(db_type::segment_data(0, 0, nullptr)); // null-terminated + + db_type db; + for (size_t i = 0; segments[i].pdata; ++i) + db.insert(segments[i].begin_key, segments[i].end_key, segments[i].pdata); + + db.dump_segment_data(); + db.build_tree(); + + db_type::search_results_type result; + { + key_type key = 0; + db.search(key, result); + value_type* expected[] = {&A, &B, &F, 0}; + assert(check_search_result_only(db, result, key, expected)); + } + + { + key_type key = 10; + db.search(key, result); + // Note the duplicated F's in the search result. + value_type* expected[] = {&A, &B, &C, &D, &E, &F, &F, 0}; + assert(check_search_result_only(db, result, key, expected)); + } + + { + key_type key = 5; + db.search(key, result); + value_type* expected[] = {&A, &A, &B, &C, &C, &D, &E, &E, &F, &F, &F, 0}; + assert(check_search_result_only(db, result, key, expected)); + } + + { + result.clear(); // clear the accumulated result set. + key_type key = 5; + db.search(key, result); + value_type* expected[] = {&A, &C, &E, &F, 0}; + assert(check_search_result_only(db, result, key, expected)); + } +} + +void st_test_dense_tree_search() +{ + stack_printer __stack_printer__("::st_test_dense_tree_search"); + + typedef uint16_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + db_type db; + db.insert(0, 1, &A); + db.insert(0, 2, &B); + db.insert(0, 3, &C); + db.insert(0, 4, &D); + db.insert(0, 5, &E); + db.insert(0, 6, &F); + db.insert(0, 7, &G); + db.build_tree(); + db.dump_tree(); + db.dump_leaf_nodes(); + + { + db_type::value_type expected[] = {&A, &B, &C, &D, &E, &F, &G, 0}; + bool success = check_search_result<key_type, value_type*>(db, 0, expected); + assert(success); + } + { + db_type::value_type expected[] = {&B, &C, &D, &E, &F, &G, 0}; + bool success = check_search_result<key_type, value_type*>(db, 1, expected); + assert(success); + } + { + db_type::value_type expected[] = {&C, &D, &E, &F, &G, 0}; + bool success = check_search_result<key_type, value_type*>(db, 2, expected); + assert(success); + } + { + db_type::value_type expected[] = {&D, &E, &F, &G, 0}; + bool success = check_search_result<key_type, value_type*>(db, 3, expected); + assert(success); + } + { + db_type::value_type expected[] = {&E, &F, &G, 0}; + bool success = check_search_result<key_type, value_type*>(db, 4, expected); + assert(success); + } + { + db_type::value_type expected[] = {&F, &G, 0}; + bool success = check_search_result<key_type, value_type*>(db, 5, expected); + assert(success); + } + { + db_type::value_type expected[] = {&G, 0}; + bool success = check_search_result<key_type, value_type*>(db, 6, expected); + assert(success); + } + { + db_type::value_type expected[] = {0}; + bool success = check_search_result<key_type, value_type*>(db, 7, expected); + assert(success); + } +} + +void st_test_search_on_empty_set() +{ + stack_printer __stack_printer__("::st_test_search_on_empty_set"); + + typedef uint16_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + db_type db; + db.build_tree(); + + // Search on an empty set should still be considered a success as long as + // the tree is built beforehand. + db_type::search_results_type result; + bool success = db.search(0, result); + assert(success); + assert(result.empty()); +} + +void st_test_search_iterator_basic() +{ + stack_printer __stack_printer__("::st_test_search_iterator"); + typedef uint16_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + db_type db; + db.insert(0, 1, &A); + db.insert(0, 2, &B); + db.insert(0, 3, &C); + db.insert(0, 4, &D); + db.insert(0, 5, &E); + db.insert(0, 6, &F); + db.insert(0, 7, &G); + db.build_tree(); + db.dump_tree(); + db.dump_leaf_nodes(); + + db_type::search_results result = db.search(0); + db_type::search_results::iterator itr; + db_type::search_results::iterator itr_beg = result.begin(); + db_type::search_results::iterator itr_end = result.end(); + cout << "Iterate through the search results." << endl; + for (itr = itr_beg; itr != itr_end; ++itr) + cout << (*itr)->name << " "; + cout << endl; + + cout << "Do it again." << endl; + for (itr = itr_beg; itr != itr_end; ++itr) + cout << (*itr)->name << " "; + cout << endl; + + cout << "Iterate backwards" << endl; + do + { + --itr; + cout << (*itr)->name << " "; + } while (itr != itr_beg); + cout << endl; + + cout << "Get the last item from the end position." << endl; + itr = itr_end; + --itr; + cout << (*itr)->name << endl; + + cout << "Use for_each to print names." << endl; + for_each(itr_beg, itr_end, test_data::ptr_printer()); + cout << endl; +} + +void st_test_search_iterator_result_check() +{ + stack_printer __stack_printer__("::st_test_search_iterator_result_check"); + + typedef uint16_t key_type; + typedef test_data value_type; + typedef segment_tree<key_type, value_type*> db_type; + + value_type A("A"), B("B"), C("C"), D("D"), E("E"), F("F"), G("G"); + db_type db; + db.insert(0, 1, &A); + db.insert(0, 2, &B); + db.insert(0, 3, &C); + db.insert(0, 4, &D); + db.insert(0, 5, &E); + db.insert(0, 6, &F); + db.insert(0, 7, &G); + db.build_tree(); + + { + value_type* expected[] = {&A, &B, &C, &D, &E, &F, &G, 0}; + bool success = check_search_result_iterator<key_type, value_type*>(db, 0, expected); + assert(success); + } + { + value_type* expected[] = {&B, &C, &D, &E, &F, &G, 0}; + bool success = check_search_result_iterator<key_type, value_type*>(db, 1, expected); + assert(success); + } + { + value_type* expected[] = {&C, &D, &E, &F, &G, 0}; + bool success = check_search_result_iterator<key_type, value_type*>(db, 2, expected); + assert(success); + } + { + value_type* expected[] = {&D, &E, &F, &G, 0}; + bool success = check_search_result_iterator<key_type, value_type*>(db, 3, expected); + assert(success); + } + { + value_type* expected[] = {&E, &F, &G, 0}; + bool success = check_search_result_iterator<key_type, value_type*>(db, 4, expected); + assert(success); + } + { + value_type* expected[] = {&F, &G, 0}; + bool success = check_search_result_iterator<key_type, value_type*>(db, 5, expected); + assert(success); + } + { + value_type* expected[] = {&G, 0}; + bool success = check_search_result_iterator<key_type, value_type*>(db, 6, expected); + assert(success); + } + { + value_type* expected[] = {0}; + bool success = check_search_result_iterator<key_type, value_type*>(db, 7, expected); + assert(success); + } +} + +/** + * When calling search() on empty tree, even without calling build_tree() + * should still return a valid search_result instance with a size of 0. + */ +void st_test_empty_result_set() +{ + stack_printer __stack_printer__("::st_test_empty_result_set"); + typedef segment_tree<long, string*> db_type; + db_type db; + db_type::search_results result = db.search(0); + cout << "size of empty result set: " << result.size() << endl; + assert(result.size() == 0); +} + +void st_test_non_pointer_data() +{ + stack_printer __stack_printer__("::st_test_non_pointer_data"); + + typedef uint16_t key_type; + typedef size_t value_type; + typedef segment_tree<key_type, value_type> db_type; + + db_type db; + db.insert(0, 1, 10); + db.build_tree(); + + db_type::search_results result = db.search(0); + assert(result.size() == 1); + assert(*result.begin() == 10); +} + +int main(int argc, char** argv) +{ + try + { + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; + + if (opt.test_func) + { + st_test_insert_search_removal(); + st_test_copy_constructor(); + st_test_equality(); + st_test_clear(); + st_test_duplicate_insertion(); + st_test_search_on_uneven_tree(); + st_test_aggregated_search_results(); + st_test_dense_tree_search(); + st_test_search_on_empty_set(); + st_test_search_iterator_basic(); + st_test_search_iterator_result_check(); + st_test_empty_result_set(); + st_test_non_pointer_data(); + } + + if (opt.test_perf) + { + st_test_perf_insertion(); + } + + // At this point, all of the nodes created during the test run should have + // been destroyed. If not, we are leaking memory. + typedef segment_tree<uint32_t, void*> db_type; + assert(db_type::node::get_instance_count() == 0); + } + catch (const std::exception& e) + { + fprintf(stdout, "Test failed: %s\n", e.what()); + return EXIT_FAILURE; + } + fprintf(stdout, "Test finished successfully!\n"); + return EXIT_SUCCESS; +} diff --git a/test/sorted_string_map/Makefile.am b/test/sorted_string_map/Makefile.am new file mode 100644 index 0000000..0d6f9e0 --- /dev/null +++ b/test/sorted_string_map/Makefile.am @@ -0,0 +1,14 @@ + +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include + +check_PROGRAMS = test + +test_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test + +@VALGRIND_CHECK_RULES@ diff --git a/test/sorted_string_map/Makefile.in b/test/sorted_string_map/Makefile.in new file mode 100644 index 0000000..4e02b27 --- /dev/null +++ b/test/sorted_string_map/Makefile.in @@ -0,0 +1,989 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test$(EXEEXT) +TESTS = test$(EXEEXT) +subdir = test/sorted_string_map +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_OBJECTS = test_main.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_OBJECTS = $(am_test_OBJECTS) +test_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_main.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_SOURCES) +DIST_SOURCES = $(test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include + +test_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sorted_string_map/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/sorted_string_map/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) + @rm -f test$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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.log: test$(EXEEXT) + @p='test$(EXEEXT)'; \ + b='test'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/sorted_string_map/test_main.cpp b/test/sorted_string_map/test_main.cpp new file mode 100644 index 0000000..4f94aab --- /dev/null +++ b/test/sorted_string_map/test_main.cpp @@ -0,0 +1,197 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2014-2015 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" +#define MDDS_SORTED_STRING_MAP_DEBUG 1 +#include "mdds/sorted_string_map.hpp" +#include "mdds/global.hpp" + +#include <cstring> +#include <vector> +#include <fstream> + +enum name_type +{ + name_none = 0, + name_andy, + name_bruce, + name_charlie, + name_david +}; + +void ssmap_test_basic() +{ + stack_printer __sp__(__func__); + + typedef mdds::sorted_string_map<name_type> map_type; + + map_type::entry entries[] = { + {MDDS_ASCII("andy"), name_andy}, {MDDS_ASCII("andy1"), name_andy}, {MDDS_ASCII("andy13"), name_andy}, + {MDDS_ASCII("bruce"), name_bruce}, {MDDS_ASCII("charlie"), name_charlie}, {MDDS_ASCII("david"), name_david}, + }; + + size_t entry_count = sizeof(entries) / sizeof(entries[0]); + map_type names(entries, entry_count, name_none); + for (size_t i = 0; i < entry_count; ++i) + { + cout << "* key = " << entries[i].key << endl; + bool res = names.find(entries[i].key, strlen(entries[i].key)) == entries[i].value; + assert(res); + } + + // Try invalid keys. + assert(names.find("foo", 3) == name_none); + assert(names.find("andy133", 7) == name_none); +} + +void ssmap_test_mixed_case_null() +{ + stack_printer __sp__(__func__); + + typedef mdds::sorted_string_map<int> map_type; + + map_type::entry entries[] = { + {MDDS_ASCII("NULL"), 1}, + {MDDS_ASCII("Null"), 2}, + {MDDS_ASCII("null"), 3}, + {MDDS_ASCII("~"), 4}, + }; + + size_t entry_count = sizeof(entries) / sizeof(entries[0]); + map_type names(entries, entry_count, -1); + for (size_t i = 0; i < entry_count; ++i) + { + cout << "* key = " << entries[i].key << endl; + bool res = names.find(entries[i].key, strlen(entries[i].key)) == entries[i].value; + assert(res); + } + + // Try invalid keys. + assert(names.find(MDDS_ASCII("NUll")) == -1); + assert(names.find(MDDS_ASCII("Oull")) == -1); + assert(names.find(MDDS_ASCII("Mull")) == -1); + assert(names.find(MDDS_ASCII("hell")) == -1); +} + +void ssmap_test_string_view_entry() +{ + stack_printer __sp__(__func__); + + constexpr int cv_unknown = -1; + constexpr int cv_days = 0; + constexpr int cv_hours = 1; + constexpr int cv_minutes = 2; + constexpr int cv_months = 3; + constexpr int cv_quarters = 4; + constexpr int cv_range = 5; + constexpr int cv_seconds = 6; + constexpr int cv_years = 7; + + using map_type = mdds::sorted_string_map<int, mdds::string_view_map_entry>; + + constexpr map_type::entry entries[] = { + {"days", cv_days}, {"hours", cv_hours}, {"minutes", cv_minutes}, {"months", cv_months}, + {"quarters", cv_quarters}, {"range", cv_range}, {"seconds", cv_seconds}, {"years", cv_years}, + }; + + map_type mapping{entries, std::size(entries), cv_unknown}; + + for (const auto& entry : entries) + { + auto v = mapping.find(entry.key); + assert(v == entry.value); + } + + constexpr std::string_view unknown_keys[] = { + "dayss", "Days", "ddays", "adfsd", "secoonds", "years ", + }; + + for (const auto& key : unknown_keys) + { + auto v = mapping.find(key); + assert(v == cv_unknown); + } +} + +void ssmap_test_perf() +{ + stack_printer __sp__(__func__); + + std::ifstream in("misc/sorted_string_data.dat"); + typedef mdds::sorted_string_map<int> map_type; + std::vector<map_type::entry> data; + std::string line; + int i = 0; + while (std::getline(in, line)) + { + data.push_back(map_type::entry()); + data.back().key_length = line.size(); + data.back().value = i; + char* str = new char[line.size()]; + data.back().key = str; + strcpy(str, &line[0]); + ++i; + } + + assert(data.size() > 1000); + { + stack_printer __stack_printer__("::ssmap_test_perf"); + map_type names(data.data(), data.size(), -1); + + assert(names.find(MDDS_ASCII("test")) == -1); + } + + for (auto it = data.begin(), itEnd = data.end(); it != itEnd; ++it) + { + delete[] it->key; + } +} + +int main(int argc, char** argv) +{ + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; + + if (opt.test_func) + { + ssmap_test_basic(); + ssmap_test_mixed_case_null(); + ssmap_test_string_view_entry(); + } + + if (opt.test_perf) + { + ssmap_test_perf(); + } + + fprintf(stdout, "Test finished successfully!\n"); + return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/test_global.cpp b/test/test_global.cpp new file mode 100644 index 0000000..90f86c6 --- /dev/null +++ b/test/test_global.cpp @@ -0,0 +1,108 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2021 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#include "test_global.hpp" // This must be the first header to be included. + +#include <cstring> +#include <chrono> + +cmd_options::cmd_options() : test_func(false), test_perf(false) +{} + +bool parse_cmd_options(int argc, char** argv, cmd_options& opt) +{ + using namespace std; + + if (argc > 1) + { + for (int i = 1; i < argc; ++i) + { + if (!strncmp(argv[i], "func", 4)) + opt.test_func = true; + else if (!strncmp(argv[i], "perf", 4)) + opt.test_perf = true; + else + { + cout << "unknown argument: " << argv[i] << endl; + return false; + } + } + } + else + opt.test_func = true; + + return true; +} + +double get_current_time() +{ + uint64_t usec_since_epoch = + std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch()) + .count(); + + return usec_since_epoch / 1000000.0; +} + +stack_watch::stack_watch() : m_start_time(get_current_time()) +{} + +void stack_watch::reset() +{ + m_start_time = get_current_time(); +} + +double stack_watch::get_duration() const +{ + return get_current_time() - m_start_time; +} + +stack_printer::stack_printer(const char* msg) : m_msg(msg) +{ + std::cout << m_msg << ": --begin" << std::endl; + m_start_time = get_current_time(); +} + +stack_printer::stack_printer(std::string msg) : m_msg(std::move(msg)) +{ + std::cout << m_msg << ": --begin" << std::endl; + m_start_time = get_current_time(); +} + +stack_printer::~stack_printer() +{ + double end_time = get_current_time(); + std::cout << m_msg << ": --end (duration: " << (end_time - m_start_time) << " sec)" << std::endl; +} + +void stack_printer::print_time(int line) const +{ + double end_time = get_current_time(); + std::cout << m_msg << ": --(" << line << ") (duration: " << (end_time - m_start_time) << " sec)" << std::endl; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/trie_map/Makefile.am b/test/trie_map/Makefile.am new file mode 100644 index 0000000..b4927a7 --- /dev/null +++ b/test/trie_map/Makefile.am @@ -0,0 +1,14 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +check_PROGRAMS = test-main + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +TESTS = test-main + +@VALGRIND_CHECK_RULES@ diff --git a/test/trie_map/Makefile.in b/test/trie_map/Makefile.in new file mode 100644 index 0000000..6630a00 --- /dev/null +++ b/test/trie_map/Makefile.in @@ -0,0 +1,990 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@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@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +check_PROGRAMS = test-main$(EXEEXT) +TESTS = test-main$(EXEEXT) +subdir = test/trie_map +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \ + $(top_srcdir)/m4/m4_ax_valgrind_check.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__dirstamp = $(am__leading_dot)dirstamp +am_test_main_OBJECTS = test_main.$(OBJEXT) \ + $(top_builddir)/test/test_global.$(OBJEXT) +test_main_OBJECTS = $(am_test_main_OBJECTS) +test_main_LDADD = $(LDADD) +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@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(top_builddir)/test/$(DEPDIR)/test_global.Po \ + ./$(DEPDIR)/test_main.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +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 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +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_main_SOURCES) +DIST_SOURCES = $(test_main_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive +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)` +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` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/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)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_NODEBUG = @CPPFLAGS_NODEBUG@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_UNITTESTS = @CXXFLAGS_UNITTESTS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ +ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ +ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ +ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXPECT = @EXPECT@ +GDB = @GDB@ +HAVE_CXX17 = @HAVE_CXX17@ +INCDIR = @INCDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MISCDIR = @MISCDIR@ +MKDIR_P = @MKDIR_P@ +OBJDIR = @OBJDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUICKCHECKDIR = @QUICKCHECKDIR@ +RUNTEST_BIN = @RUNTEST_BIN@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPHINX = @SPHINX@ +STRIP = @STRIP@ +VALGRIND = @VALGRIND@ +VALGRIND_ENABLED = @VALGRIND_ENABLED@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +valgrind_enabled_tools = @valgrind_enabled_tools@ +valgrind_tools = @valgrind_tools@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/test/include \ + $(CXXFLAGS_UNITTESTS) + +test_main_SOURCES = \ + test_main.cpp \ + $(top_srcdir)/test/test_global.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/trie_map/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/trie_map/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +$(top_builddir)/test/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test + @: > $(top_builddir)/test/$(am__dirstamp) +$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) $(top_builddir)/test/$(DEPDIR) + @: > $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) +$(top_builddir)/test/test_global.$(OBJEXT): \ + $(top_builddir)/test/$(am__dirstamp) \ + $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + +test-main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) + @rm -f test-main$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f $(top_builddir)/test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/test/$(DEPDIR)/test_global.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@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@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: + +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`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +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 + +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 + +# 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; \ + 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 \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + 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"$(AM_TESTSUITE_SUMMARY_HEADER)"$${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: $(check_PROGRAMS) + @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) + @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-main.log: test-main$(EXEEXT) + @p='test-main$(EXEEXT)'; \ + b='test-main'; \ + $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + 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: + +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 "$(top_builddir)/test/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(DEPDIR)/$(am__dirstamp) + -test -z "$(top_builddir)/test/$(am__dirstamp)" || rm -f $(top_builddir)/test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +check-valgrind: check-valgrind-am + +check-valgrind-am: check-valgrind-local + +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(top_builddir)/test/$(DEPDIR)/test_global.Po + -rm -f ./$(DEPDIR)/test_main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic 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 install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@VALGRIND_CHECK_RULES@ + +# 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/test/trie_map/test_main.cpp b/test/trie_map/test_main.cpp new file mode 100644 index 0000000..3b7aa19 --- /dev/null +++ b/test/trie_map/test_main.cpp @@ -0,0 +1,1909 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2015-2018 Kohei Yoshida + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + ************************************************************************/ + +#define MDDS_TRIE_MAP_DEBUG 1 +#include "test_global.hpp" // This must be the first header to be included. +//#define MDDS_TRIE_MAP_DEBUG_DUMP_TRIE 1 +//#define MDDS_TRIE_MAP_DEBUG_DUMP_PACKED 1 + +#include "mdds/trie_map.hpp" +#include "mdds/global.hpp" + +#include <iterator> +#include <fstream> +#include <vector> +#include <list> + +using namespace std; +using namespace mdds; + +using packed_int_map_type = packed_trie_map<trie::std_string_traits, int>; +using packed_str_map_type = packed_trie_map<trie::std_string_traits, std::string>; + +bool verify_entries(const packed_int_map_type& db, const packed_int_map_type::entry* entries, size_t entry_size) +{ + auto results = db.prefix_search(nullptr, 0); + for (auto it = results.begin(), ite = results.end(); it != ite; ++it) + cout << it->first << ": " << it->second << endl; + + const packed_int_map_type::entry* p = entries; + const packed_int_map_type::entry* p_end = p + entry_size; + for (; p != p_end; ++p) + { + auto it = db.find(p->key, p->keylen); + if (it == db.end() || it->second != p->value) + return false; + } + + return true; +} + +template<typename T> +bool check_equal(const T& left, const T& right) +{ + if (left.first != right.first) + { + cout << "left: " << left.first << "; right: " << right.first << endl; + return false; + } + + if (left.second != right.second) + { + cout << "left: " << left.second << "; right: " << right.second << endl; + return false; + } + + return true; +} + +void trie_packed_test1() +{ + stack_printer __stack_printer__("::trie_packed_test1"); + + packed_int_map_type::entry entries[] = { + {MDDS_ASCII("a"), 13}, + {MDDS_ASCII("aa"), 10}, + {MDDS_ASCII("ab"), 3}, + {MDDS_ASCII("b"), 7}, + }; + + size_t entry_size = std::size(entries); + packed_int_map_type db(entries, entry_size); + assert(db.size() == 4); + assert(verify_entries(db, entries, entry_size)); + + // invalid keys + assert(db.find(MDDS_ASCII("ac")) == db.end()); + assert(db.find(MDDS_ASCII("c")) == db.end()); + + { + // Get all key-value pairs. + auto results = db.prefix_search(nullptr, 0); + size_t n = std::distance(results.begin(), results.end()); + assert(n == 4); + auto it = results.begin(); + assert(it->first == "a"); + assert(it->second == 13); + ++it; + assert(it->first == "aa"); + assert(it->second == 10); + ++it; + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it->first == "b"); + assert(it->second == 7); + ++it; + assert(it == results.end()); + } + + { + auto it = db.find(MDDS_ASCII("a")); + assert(it->first == "a"); + assert(it->second == 13); + ++it; + assert(it->first == "aa"); + assert(it->second == 10); + ++it; + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it->first == "b"); + assert(it->second == 7); + ++it; + assert(it == db.end()); + } +} + +void trie_packed_test2() +{ + stack_printer __stack_printer__("::trie_packed_test2"); + + packed_int_map_type::entry entries[] = { + {MDDS_ASCII("aaron"), 0}, {MDDS_ASCII("al"), 1}, {MDDS_ASCII("aldi"), 2}, {MDDS_ASCII("andy"), 3}, + {MDDS_ASCII("bison"), 4}, {MDDS_ASCII("bruce"), 5}, {MDDS_ASCII("charlie"), 6}, {MDDS_ASCII("charlotte"), 7}, + {MDDS_ASCII("david"), 8}, {MDDS_ASCII("dove"), 9}, {MDDS_ASCII("e"), 10}, {MDDS_ASCII("eva"), 11}, + }; + + size_t entry_size = std::size(entries); + packed_int_map_type db(entries, entry_size); + assert(db.size() == 12); + assert(verify_entries(db, entries, entry_size)); + + // invalid keys + assert(db.find(MDDS_ASCII("aarons")) == db.end()); + assert(db.find(MDDS_ASCII("a")) == db.end()); + assert(db.find(MDDS_ASCII("biso")) == db.end()); + assert(db.find(MDDS_ASCII("dAvid")) == db.end()); +} + +void trie_packed_test3() +{ + stack_printer __stack_printer__("::trie_packed_test3"); + + packed_int_map_type::entry entries[] = { + {MDDS_ASCII("NULL"), 1}, + {MDDS_ASCII("Null"), 2}, + {MDDS_ASCII("null"), 3}, + {MDDS_ASCII("~"), 4}, + }; + + size_t entry_size = std::size(entries); + packed_int_map_type db(entries, entry_size); + assert(db.size() == 4); + assert(verify_entries(db, entries, entry_size)); + + // invalid keys + assert(db.find(MDDS_ASCII("NUll")) == db.end()); + assert(db.find(MDDS_ASCII("Oull")) == db.end()); + assert(db.find(MDDS_ASCII("Mull")) == db.end()); + assert(db.find(MDDS_ASCII("hell")) == db.end()); +} + +void trie_packed_test4() +{ + stack_printer __stack_printer__("::trie_packed_test4"); + + enum name_type + { + name_none = 0, + name_andy, + name_bruce, + name_charlie, + name_david + }; + + packed_int_map_type::entry entries[] = { + {MDDS_ASCII("andy"), name_andy}, {MDDS_ASCII("andy1"), name_andy}, {MDDS_ASCII("andy13"), name_andy}, + {MDDS_ASCII("bruce"), name_bruce}, {MDDS_ASCII("charlie"), name_charlie}, {MDDS_ASCII("david"), name_david}, + }; + + size_t entry_size = std::size(entries); + packed_int_map_type db(entries, entry_size); + assert(db.size() == 6); + assert(verify_entries(db, entries, entry_size)); + + // Try invalid keys. + assert(db.find("foo", 3) == db.end()); + assert(db.find("andy133", 7) == db.end()); + + // Test prefix search on 'andy'. + auto results = db.prefix_search(MDDS_ASCII("andy")); + size_t n = std::distance(results.begin(), results.end()); + assert(n == 3); + auto it = results.begin(); + assert(it->first == "andy"); + ++it; + assert(it->first == "andy1"); + ++it; + assert(it->first == "andy13"); + ++it; + assert(it == results.end()); + + results = db.prefix_search(MDDS_ASCII("andy's toy")); + n = std::distance(results.begin(), results.end()); + assert(n == 0); + + results = db.prefix_search(MDDS_ASCII("e")); + n = std::distance(results.begin(), results.end()); + assert(n == 0); + + results = db.prefix_search(MDDS_ASCII("b")); + n = std::distance(results.begin(), results.end()); + assert(n == 1); + it = results.begin(); + assert(it->first == "bruce"); + assert(it->second == name_bruce); + ++it; + assert(it == results.end()); +} + +struct value_wrapper +{ + int value; + + value_wrapper() : value(0) + {} + value_wrapper(int _value) : value(_value) + {} +}; + +std::ostream& operator<<(std::ostream& os, const value_wrapper& vw) +{ + os << vw.value; + return os; +} + +typedef packed_trie_map<trie::std_string_traits, value_wrapper> packed_value_map_type; + +void trie_packed_test_value_life_cycle() +{ + stack_printer __stack_printer__("::trie_packed_test_value_life_cycle"); + + using entry = packed_value_map_type::entry; + + // Entries must be sorted by the key! + std::unique_ptr<vector<entry>> entries(new vector<entry>); + entries->push_back(entry(MDDS_ASCII("fifteen"), value_wrapper(15))); + entries->push_back(entry(MDDS_ASCII("ten"), value_wrapper(10))); + entries->push_back(entry(MDDS_ASCII("twelve"), value_wrapper(12))); + entries->push_back(entry(MDDS_ASCII("two"), value_wrapper(2))); + + packed_value_map_type db(entries->data(), entries->size()); + + // Delete the original entry store. + entries.reset(); + + auto results = db.prefix_search(nullptr, 0); + std::for_each(results.begin(), results.end(), [](const packed_value_map_type::const_iterator::value_type& v) { + cout << v.first << ": " << v.second.value << endl; + }); + + auto it = db.find(MDDS_ASCII("twelve")); + assert(it->second.value == 12); + + it = db.find(MDDS_ASCII("two")); + assert(it->second.value == 2); + + it = db.find(MDDS_ASCII("foo")); + assert(it == db.end()); +} + +struct custom_string +{ + std::string data; + + custom_string() + {} + custom_string(const std::string& _data) : data(_data) + {} +}; + +struct custom_string_trait +{ + typedef uint16_t key_unit_type; + typedef custom_string key_type; + typedef std::vector<key_unit_type> key_buffer_type; + + static key_buffer_type to_key_buffer(const key_unit_type* str, size_t length) + { + key_buffer_type buf; + const key_unit_type* str_end = str + length; + for (; str != str_end; ++str) + buf.push_back(*str); + + return buf; + } + + static void push_back(key_buffer_type& buffer, key_unit_type c) + { + buffer.push_back(c); + } + + static void pop_back(key_buffer_type& buffer) + { + buffer.pop_back(); + } + + static key_type to_key(const key_buffer_type& buf) + { + // Cast all uint16_t chars to regular chars. + key_type s; + + std::for_each(buf.begin(), buf.end(), [&](key_unit_type c) { s.data.push_back(static_cast<char>(c)); }); + return s; + } +}; + +typedef packed_trie_map<custom_string_trait, std::string> packed_custom_str_map_type; + +void trie_packed_test_custom_string() +{ + stack_printer __stack_printer__("::trie_packed_test_custom_string"); + + const uint16_t key_alex[] = {0x41, 0x6C, 0x65, 0x78}; + const uint16_t key_bob[] = {0x42, 0x6F, 0x62}; + const uint16_t key_max[] = {0x4D, 0x61, 0x78}; + const uint16_t key_ming[] = {0x4D, 0x69, 0x6E, 0x67}; + + const packed_custom_str_map_type::entry entries[] = { + {key_alex, 4, "Alex"}, + {key_bob, 3, "Bob"}, + {key_max, 3, "Max"}, + {key_ming, 4, "Ming"}, + }; + + size_t n_entries = std::size(entries); + packed_custom_str_map_type db(entries, n_entries); + for (size_t i = 0; i < n_entries; ++i) + { + auto it = db.find(entries[i].key, entries[i].keylen); + cout << it->second << endl; + assert(it->second == entries[i].value); + } + + // Find all keys that start with 'M'. + auto results = db.prefix_search(key_max, 1); + size_t n = std::distance(results.begin(), results.end()); + assert(n == 2); + auto it = results.begin(); + assert(it->first.data == it->second); + assert(it->second == "Max"); + ++it; + assert(it->first.data == it->second); + assert(it->second == "Ming"); + ++it; + assert(it == results.end()); +} + +void trie_packed_test_iterator_empty() +{ + stack_printer __stack_printer__("::trie_packed_test_iterator_empty"); + packed_int_map_type db(nullptr, 0); + + // empty container + packed_int_map_type::const_iterator it = db.begin(); + packed_int_map_type::const_iterator ite = db.end(); + + assert(it == ite); +} + +void trie_packed_test_iterator() +{ + stack_printer __stack_printer__("::trie_packed_test_iterator"); + + using trie_map_type = trie_map<trie::std_string_traits, int>; + using packed_type = trie_map_type::packed_type; + using kv = packed_type::key_value_type; + + trie_map_type db; + + db.insert(MDDS_ASCII("a"), 1); + packed_type packed = db.pack(); + assert(db.size() == packed.size()); + packed_type::const_iterator it = packed.begin(); + packed_type::const_iterator ite = packed.end(); + assert(it != ite); + assert(it->first == "a"); + assert(it->second == 1); + + db.insert(MDDS_ASCII("ab"), 2); + packed = db.pack(); // this invalidates the end position. + assert(db.size() == packed.size()); + + it = packed.begin(); + ite = packed.end(); + assert(it != ite); + assert(it->first == "a"); + assert(it->second == 1); + + ++it; + bool check_true = check_equal(*it++, kv("ab", 2)); + assert(check_true); + assert(it == ite); + + db.insert(MDDS_ASCII("aba"), 3); + db.insert(MDDS_ASCII("abb"), 4); + db.insert(MDDS_ASCII("abc"), 5); + db.insert(MDDS_ASCII("bc"), 6); + db.insert(MDDS_ASCII("bcd"), 7); + + packed = db.pack(); + assert(db.size() == packed.size()); + + it = packed.begin(); + ite = packed.end(); + + assert(*it == kv("a", 1)); + assert(check_equal(*(++it), kv("ab", 2))); + assert(check_equal(*(++it), kv("aba", 3))); + assert(check_equal(*(++it), kv("abb", 4))); + assert(check_equal(*(++it), kv("abc", 5))); + assert(check_equal(*(++it), kv("bc", 6))); + assert(check_equal(*(++it), kv("bcd", 7))); + assert(it->first == "bcd"); + assert(it->second == 7); + ++it; + assert(it == ite); + + --it; + assert(it != ite); + assert(check_equal(*it, kv("bcd", 7))); + --it; + assert(check_equal(*it, kv("bc", 6))); + --it; + assert(check_equal(*it, kv("abc", 5))); + --it; + assert(check_equal(*it, kv("abb", 4))); + --it; + assert(check_equal(*it, kv("aba", 3))); + --it; + assert(check_equal(*it, kv("ab", 2))); + assert(check_equal(*(--it), kv("a", 1))); + assert(it == packed.begin()); + + assert(check_equal(*(++it), kv("ab", 2))); + assert(check_equal(*(++it), kv("aba", 3))); + --it; + assert(check_equal(*it, kv("ab", 2))); + --it; + assert(check_equal(*it, kv("a", 1))); + ++it; + assert(check_equal(*it, kv("ab", 2))); + ++it; + assert(check_equal(*it, kv("aba", 3))); + + // Post-decrement operator. + assert(check_equal(*it--, kv("aba", 3))); + assert(check_equal(*it, kv("ab", 2))); +} + +void trie_packed_test_prefix_search1() +{ + stack_printer __stack_printer__("::trie_packed_test_prefix_search1"); + + using trie_map_type = trie_map<trie::std_string_traits, int>; + using packed_type = trie_map_type::packed_type; + + trie_map_type db; + db.insert(MDDS_ASCII("andy"), 1); + db.insert(MDDS_ASCII("andy1"), 2); + db.insert(MDDS_ASCII("andy12"), 3); + + { + auto results = db.prefix_search(MDDS_ASCII("andy")); + auto it = results.begin(); + assert(it != results.end()); + assert(it->first == "andy"); + ++it; + assert(it->first == "andy1"); + ++it; + assert(it->first == "andy12"); + ++it; + assert(it == results.end()); + + size_t n = std::distance(results.begin(), results.end()); + assert(n == 3); + } + + packed_type packed = db.pack(); + { + auto results = packed.prefix_search(MDDS_ASCII("andy")); + auto it = results.begin(); + assert(it != results.end()); + assert(it->first == "andy"); + ++it; + assert(it->first == "andy1"); + ++it; + assert(it->first == "andy12"); + ++it; + assert(it == results.end()); + + size_t n = std::distance(results.begin(), results.end()); + assert(n == 3); + } +} + +void trie_packed_test_key_as_input() +{ + stack_printer __stack_printer__("::trie_packed_test_key_as_input"); + + typedef trie_map<trie::std_string_traits, int> trie_map_type; + trie_map_type db; + + db.insert(std::string("string as key"), 1); + db.insert("literal as key", 2); + auto packed = db.pack(); + + auto it = packed.find("literal as key"); + assert(it != packed.end()); + assert(it->first == "literal as key"); + assert(it->second == 2); + + auto results = packed.prefix_search("str"); + auto rit = results.begin(); + assert(rit != results.end()); + assert(rit->first == "string as key"); + assert(rit->second == 1); + ++rit; + assert(rit == results.end()); +} + +void trie_packed_test_copying() +{ + stack_printer __stack_printer__("::trie_packed_test_copying"); + using map_type = packed_trie_map<trie::std_string_traits, int>; + + map_type::entry entries[] = { + {MDDS_ASCII("aaron"), 0}, {MDDS_ASCII("al"), 1}, {MDDS_ASCII("aldi"), 2}, {MDDS_ASCII("andy"), 3}, + {MDDS_ASCII("bison"), 4}, {MDDS_ASCII("bruce"), 5}, {MDDS_ASCII("charlie"), 6}, {MDDS_ASCII("charlotte"), 7}, + {MDDS_ASCII("david"), 8}, {MDDS_ASCII("dove"), 9}, {MDDS_ASCII("e"), 10}, {MDDS_ASCII("eva"), 11}, + }; + + auto verify_content = [&entries](const map_type& db) { + auto it = db.begin(); + const map_type::entry* p_entries = entries; + const map_type::entry* p_entries_end = p_entries + db.size(); + size_t n = std::distance(p_entries, p_entries_end); + assert(db.size() == n); + assert(!db.empty()); + + for (; p_entries != p_entries_end; ++p_entries, ++it) + { + std::string key_expected(p_entries->key, p_entries->keylen); + assert(key_expected == it->first); + assert(p_entries->value == it->second); + } + }; + + auto db = std::make_unique<map_type>(entries, std::size(entries)); + auto db_copied(*db); + assert(*db == db_copied); + assert(db->size() == db_copied.size()); + db.reset(); + + auto it = db_copied.find("charlie"); + assert(it != db_copied.end()); + assert(it->first == "charlie"); + assert(it->second == 6); + + verify_content(db_copied); + + auto db_moved(std::move(db_copied)); + assert(db_copied.empty()); + assert(!db_moved.empty()); + assert(db_moved.size() == std::size(entries)); + + it = db_copied.find("bison"); + assert(it == db_copied.end()); + it = db_moved.find("bison"); + assert(it != db_moved.end()); + assert(it->first == "bison"); + assert(it->second == 4); + + verify_content(db_moved); + + map_type db_copy_assigned; + assert(db_copy_assigned.empty()); + db_copy_assigned = db_moved; + assert(db_copy_assigned == db_moved); + + verify_content(db_moved); + verify_content(db_copy_assigned); + + map_type db_move_assigned; + assert(db_move_assigned.empty()); + db_move_assigned = std::move(db_moved); + assert(db_move_assigned != db_moved); + + verify_content(db_move_assigned); + assert(db_moved.empty()); +} + +void trie_packed_test_non_equal() +{ + stack_printer __stack_printer__("::trie_packed_test_non_equal"); + + using map_type = packed_trie_map<trie::std_string_traits, int>; + + map_type::entry entries1[] = { + {MDDS_ASCII("aaron"), 0}, {MDDS_ASCII("al"), 1}, {MDDS_ASCII("aldi"), 2}, {MDDS_ASCII("andy"), 3}, + {MDDS_ASCII("bison"), 4}, {MDDS_ASCII("bruce"), 5}, {MDDS_ASCII("charlie"), 6}, {MDDS_ASCII("charlotte"), 7}, + {MDDS_ASCII("david"), 8}, {MDDS_ASCII("dove"), 9}, {MDDS_ASCII("e"), 10}, {MDDS_ASCII("eva"), 11}, + }; + + map_type::entry entries2[] = { + {MDDS_ASCII("aaron"), 0}, {MDDS_ASCII("al"), 1}, {MDDS_ASCII("aldi"), 2}, + {MDDS_ASCII("andy"), 3}, {MDDS_ASCII("bison"), 4}, {MDDS_ASCII("bruce"), 2}, // different value + {MDDS_ASCII("charlie"), 6}, {MDDS_ASCII("charlotte"), 7}, {MDDS_ASCII("david"), 8}, + {MDDS_ASCII("dove"), 9}, {MDDS_ASCII("e"), 10}, {MDDS_ASCII("eva"), 11}, + }; + + // fewer entries + map_type::entry entries3[] = { + {MDDS_ASCII("aaron"), 0}, {MDDS_ASCII("al"), 1}, {MDDS_ASCII("aldi"), 2}, {MDDS_ASCII("andy"), 3}, + {MDDS_ASCII("bison"), 4}, {MDDS_ASCII("bruce"), 5}, {MDDS_ASCII("charlie"), 6}, {MDDS_ASCII("charlotte"), 7}, + {MDDS_ASCII("david"), 8}, {MDDS_ASCII("dove"), 9}, {MDDS_ASCII("e"), 10}, + }; + + map_type db1(entries1, std::size(entries1)); + map_type db2(entries2, std::size(entries2)); + map_type db3(entries3, std::size(entries3)); + assert(db1 != db2); + assert(db1 != db3); + assert(db2 != db3); + + map_type db4(entries1, std::size(entries1)); + map_type db5(entries2, std::size(entries2)); + map_type db6(entries3, std::size(entries3)); + + assert(db1 == db4); + assert(db2 == db5); + assert(db3 == db6); +} + +namespace trie_packed_test_save_and_load_state { + +struct _custom_variable_value +{ + enum class v_type + { + unknown, + fp32, + int64 + }; + + v_type type; + + union + { + float fp32; + int64_t int64; + } value; + + _custom_variable_value() : type(v_type::unknown) + {} + + _custom_variable_value(float v) : type(v_type::fp32) + { + value.fp32 = v; + } + + _custom_variable_value(int v) : type(v_type::int64) + { + value.int64 = v; + } + + _custom_variable_value(const _custom_variable_value& other) : type(other.type) + { + switch (type) + { + case v_type::fp32: + value.fp32 = other.value.fp32; + break; + case v_type::int64: + value.int64 = other.value.int64; + break; + default:; + } + } + + bool operator==(const _custom_variable_value& other) const + { + if (type != other.type) + return false; + + switch (type) + { + case v_type::fp32: + return value.fp32 == other.value.fp32; + case v_type::int64: + return value.int64 == other.value.int64; + default:; + } + + return true; + } + + bool operator!=(const _custom_variable_value& other) const + { + return !operator==(other); + } +}; + +struct _custom_variable_serializer +{ + union bin_value + { + char buffer[8]; + float fp32; + int64_t int64; + }; + + static constexpr bool variable_size = true; + + static void write(std::ostream& os, const _custom_variable_value& v) + { + bin_value bv; + + switch (v.type) + { + case _custom_variable_value::v_type::unknown: + { + char c = 0; + os.write(&c, 1); + break; + } + case _custom_variable_value::v_type::fp32: + { + char c = 1; + os.write(&c, 1); + bv.fp32 = v.value.fp32; + os.write(bv.buffer, 4); + break; + } + case _custom_variable_value::v_type::int64: + { + char c = 2; + os.write(&c, 1); + bv.int64 = v.value.int64; + os.write(bv.buffer, 8); + break; + } + } + } + + static void read(std::istream& is, size_t n, _custom_variable_value& v) + { + assert(n > 0); + char c; + is.read(&c, 1); + + switch (c) + { + case 0: + v.type = _custom_variable_value::v_type::unknown; + break; + case 1: + v.type = _custom_variable_value::v_type::fp32; + break; + case 2: + v.type = _custom_variable_value::v_type::int64; + break; + default: + assert(!"invalid value type"); + } + + n -= 1; + bin_value bv; + + switch (v.type) + { + case _custom_variable_value::v_type::fp32: + assert(n == 4); + is.read(bv.buffer, 4); + v.value.fp32 = bv.fp32; + break; + case _custom_variable_value::v_type::int64: + assert(n == 8); + is.read(bv.buffer, 8); + v.value.int64 = bv.int64; + break; + case _custom_variable_value::v_type::unknown: + break; + default: + assert(!"invalid value type"); + } + } +}; + +/** + * mock value struct containing one value string that only stores "zero", + * "one", "two" or "three". We use a custom serializer to store the value + * using only 1 byte each. + */ +struct _custom_fixed_value +{ + std::string value_string; // only stores "zero", "one", "two" or "three". + + _custom_fixed_value() + {} + + _custom_fixed_value(const char* p) : value_string(p, std::strlen(p)) + {} + + bool operator==(const _custom_fixed_value& other) const + { + return value_string == other.value_string; + } + + bool operator!=(const _custom_fixed_value& other) const + { + return !operator==(other); + } +}; + +struct _custom_fixed_serializer +{ + static constexpr bool variable_size = false; + static constexpr size_t value_size = 1; + + static void write(std::ostream& os, const _custom_fixed_value& v) + { + char bv = -1; + + if (v.value_string == "zero") + bv = 0; + else if (v.value_string == "one") + bv = 1; + else if (v.value_string == "two") + bv = 2; + else if (v.value_string == "three") + bv = 3; + + os.write(&bv, 1); + } + + static void read(std::istream& is, size_t n, _custom_fixed_value& v) + { + assert(n == 1); + char bv = -1; + is.read(&bv, 1); + + switch (bv) + { + case 0: + v.value_string = "zero"; + break; + case 1: + v.value_string = "one"; + break; + case 2: + v.value_string = "two"; + break; + case 3: + v.value_string = "three"; + break; + default: + v.value_string = "???"; + } + } +}; + +void test1() +{ + stack_printer __stack_printer__("trie_packed_test_save_and_load_state::test1"); + packed_int_map_type empty_db; + + std::string saved_state; + + { + std::ostringstream state; + empty_db.save_state(state); + saved_state = state.str(); + } + + packed_int_map_type restored; + + { + std::istringstream state(saved_state); + restored.load_state(state); + } + + assert(restored == empty_db); +} + +void test2() +{ + stack_printer __stack_printer__("trie_packed_test_save_and_load_state::test2"); + packed_int_map_type::entry entries[] = { + {MDDS_ASCII("bruce"), 5}, {MDDS_ASCII("charlie"), 6}, {MDDS_ASCII("charlotte"), 7}, + {MDDS_ASCII("david"), 8}, {MDDS_ASCII("dove"), 9}, + }; + + packed_int_map_type db(entries, std::size(entries)); + + std::string saved_state; + + { + std::ostringstream state; + db.save_state(state); + saved_state = state.str(); + } + + packed_int_map_type restored; + assert(restored != db); + + { + std::istringstream state(saved_state); + restored.load_state(state); + } + + assert(restored == db); +} + +void test3() +{ + stack_printer __stack_printer__("trie_packed_test_save_and_load_state::test3"); + std::vector<packed_str_map_type::entry> entries = { + {MDDS_ASCII("Abby"), "ABBY"}, + {MDDS_ASCII("Ashley"), "ASHLEY"}, + {MDDS_ASCII("Candelaria"), "CANDELARIA"}, + {MDDS_ASCII("Carita"), "CARITA"}, + {MDDS_ASCII("Christal"), "CHRISTAL"}, + {MDDS_ASCII("Cory"), "CORY"}, + {MDDS_ASCII("Estrella"), "ESTRELLA"}, + {MDDS_ASCII("Etha"), "ETHA"}, + {MDDS_ASCII("Harley"), "HARLEY"}, + {MDDS_ASCII("Irish"), "IRISH"}, + {MDDS_ASCII("Kiara"), "KIARA"}, + {MDDS_ASCII("Korey"), "KOREY"}, + {MDDS_ASCII("Laurene"), "LAURENE"}, + {MDDS_ASCII("Michiko"), "MICHIKO"}, + {MDDS_ASCII("Miriam"), "MIRIAM"}, + {MDDS_ASCII("Mitzi"), "MITZI"}, + {MDDS_ASCII("Seth"), "SETH"}, + {MDDS_ASCII("Sindy"), "SINDY"}, + {MDDS_ASCII("Tawanna"), "TAWANNA"}, + {MDDS_ASCII("Tyra"), "TYRA"}, + }; + + packed_str_map_type db(entries.data(), entries.size()); + + // Run some search. + auto results = db.prefix_search("Mi"); + auto it = results.begin(); + assert(it != results.end()); + assert(it->first == "Michiko"); + assert(it->second == "MICHIKO"); + ++it; + assert(it != results.end()); + assert(it->first == "Miriam"); + assert(it->second == "MIRIAM"); + ++it; + assert(it != results.end()); + assert(it->first == "Mitzi"); + assert(it->second == "MITZI"); + ++it; + assert(it == results.end()); + + std::string saved_state; + + { + std::ostringstream state; + db.save_state(state); + saved_state = state.str(); + } + + packed_str_map_type restored; + + { + std::istringstream state(saved_state); + restored.load_state(state); + } + + assert(db == restored); +} + +void test4() +{ + stack_printer __stack_printer__("trie_packed_test_save_and_load_state::test4"); + using map_type = packed_trie_map<trie::std_string_traits, std::vector<int64_t>>; + + std::vector<map_type::entry> entries = { + {MDDS_ASCII("Abby"), {65, 98, 98, 121}}, + {MDDS_ASCII("Ashley"), {65, 115, 104, 108, 101, 121}}, + {MDDS_ASCII("Christal"), {67, 104, 114, 105, 115, 116, 97, 108}}, + {MDDS_ASCII("Cory"), {67, 111, 114, 121}}, + {MDDS_ASCII("Harley"), {72, 97, 114, 108, 101, 121}}, + {MDDS_ASCII("Kiara"), {75, 105, 97, 114, 97}}, + {MDDS_ASCII("Mitzi"), {77, 105, 116, 122, 105}}, + }; + + map_type db(entries.data(), entries.size()); + assert(db.size() == entries.size()); + + std::string saved_state; + { + std::ostringstream state; + db.save_state(state); + saved_state = state.str(); + } + + map_type restored; + + { + std::istringstream state(saved_state); + restored.load_state(state); + } + + assert(db == restored); +} + +void test5() +{ + stack_printer __stack_printer__("trie_packed_test_save_and_load_state::test5"); + using map_type = packed_trie_map<trie::std_string_traits, float>; + + std::vector<map_type::entry> entries = { + {MDDS_ASCII("Abby"), 1.0f}, {MDDS_ASCII("Ashley"), 1.1f}, {MDDS_ASCII("Christal"), 1.2f}, + {MDDS_ASCII("Cory"), 1.3f}, {MDDS_ASCII("Harley"), 1.4f}, {MDDS_ASCII("Kiara"), 1.5f}, + {MDDS_ASCII("Mitzi"), 1.6f}, + }; + + map_type db(entries.data(), entries.size()); + assert(db.size() == entries.size()); + + std::string saved_state; + { + std::ostringstream state; + db.save_state(state); + saved_state = state.str(); + } + + map_type restored; + + { + std::istringstream state(saved_state); + restored.load_state(state); + } + + assert(db == restored); +} + +template<typename SeqT> +void test6() +{ + stack_printer __stack_printer__("trie_packed_test_save_and_load_state::test6"); + using map_type = packed_trie_map<trie::std_string_traits, SeqT>; + + std::vector<typename map_type::entry> entries = { + {MDDS_ASCII("Abby"), {65.0, 98.1, 98.2, 121.3}}, + {MDDS_ASCII("Ashley"), {65.0, 11.5, 1.04, 1.08, .101, .12586}}, + {MDDS_ASCII("Christal"), {67.0, -10.4, -114.236}}, + {MDDS_ASCII("Cory"), {67.0, 122.111}}, + {MDDS_ASCII("Harley"), {72.0, 97.12, -1.114}}, + {MDDS_ASCII("Kiara"), {75.0, 1.05, 9.7, 1.14, -97.5}}, + {MDDS_ASCII("Mitzi"), {77.0, 10.5, 11.6, 1.22, 10.5}}, + }; + + map_type db(entries.data(), entries.size()); + assert(db.size() == entries.size()); + + std::string saved_state; + { + std::ostringstream state; + db.save_state(state); + saved_state = state.str(); + } + + map_type restored; + + { + std::istringstream state(saved_state); + restored.load_state(state); + } + + assert(db == restored); +} + +void test7() +{ + stack_printer __stack_printer__("trie_packed_test_save_and_load_state::test7"); + using map_type = packed_trie_map<trie::std_string_traits, _custom_variable_value>; + + std::vector<map_type::entry> entries = { + {MDDS_ASCII("Alan"), 1.2f}, {MDDS_ASCII("Cory"), -125}, {MDDS_ASCII("Eleni"), 966}, + {MDDS_ASCII("Evia"), -0.987f}, {MDDS_ASCII("Nathaniel"), 0}, {MDDS_ASCII("Rebbecca"), 1.234f}, + {MDDS_ASCII("Rodrick"), 34253536}, {MDDS_ASCII("Stuart"), 12}, {MDDS_ASCII("Verline"), 56}, + }; + + map_type db(entries.data(), entries.size()); + assert(db.size() == entries.size()); + + std::string saved_state; + { + std::ostringstream state; + db.save_state<_custom_variable_serializer>(state); + saved_state = state.str(); + } + + map_type restored; + + { + std::istringstream state(saved_state); + restored.load_state<_custom_variable_serializer>(state); + } + + assert(db == restored); +} + +void test8() +{ + stack_printer __stack_printer__("trie_packed_test_save_and_load_state::test8"); + using map_type = packed_trie_map<trie::std_string_traits, _custom_fixed_value>; + + std::vector<map_type::entry> entries = { + {MDDS_ASCII("Bernardine"), "zero"}, {MDDS_ASCII("Donny"), "two"}, {MDDS_ASCII("Julia"), "one"}, + {MDDS_ASCII("Lindsy"), "three"}, {MDDS_ASCII("Martine"), "three"}, {MDDS_ASCII("Shana"), "two"}, + {MDDS_ASCII("Sonia"), "zero"}, {MDDS_ASCII("Tracie"), "one"}, {MDDS_ASCII("Vanita"), "two"}, + {MDDS_ASCII("Yung"), "zero"}, + }; + + map_type db(entries.data(), entries.size()); + assert(db.size() == entries.size()); + + std::string saved_state; + { + std::ostringstream state; + db.save_state<_custom_fixed_serializer>(state); + saved_state = state.str(); + } + + map_type restored; + + { + std::istringstream state(saved_state); + restored.load_state<_custom_fixed_serializer>(state); + } + + assert(db == restored); + + // Run some query to make sure it is still functional. + auto it = restored.find("Tracie"); + assert(it->first == "Tracie"); + assert(it->second.value_string == "one"); +} + +void run() +{ + test1(); + test2(); + test3(); + test4(); + test5(); + test6<std::vector<double>>(); + test6<std::deque<double>>(); + test6<std::list<double>>(); + test7(); + test8(); +} + +} // namespace trie_packed_test_save_and_load_state + +void trie_test1() +{ + stack_printer __stack_printer__("::trie_test1"); + + typedef trie_map<trie::std_string_traits, custom_string> trie_map_type; + typedef packed_trie_map<trie::std_string_traits, custom_string> packed_trie_map_type; + + trie_map_type db; + const trie_map_type& dbc = db; + + assert(db.size() == 0); + db.insert(MDDS_ASCII("Barak"), custom_string("Obama")); + assert(db.size() == 1); + db.insert(MDDS_ASCII("Bob"), custom_string("Marley")); + assert(db.size() == 2); + db.insert(MDDS_ASCII("Hideki"), custom_string("Matsui")); + assert(db.size() == 3); + + auto it = dbc.find(MDDS_ASCII("Barak")); + assert(it->first == "Barak"); + custom_string res = it->second; + assert(res.data == "Obama"); + + res = dbc.find(MDDS_ASCII("Bob"))->second; + assert(res.data == "Marley"); + res = dbc.find(MDDS_ASCII("Hideki"))->second; + assert(res.data == "Matsui"); + + // Non-existent key. + it = dbc.find(MDDS_ASCII("Von")); + assert(it == dbc.end()); + it = dbc.find(MDDS_ASCII("Bar")); + assert(it == dbc.end()); + + // Perform prefix search on "B", which should return both "Barak" and "Bob". + // The results should be sorted. + { + auto matches = dbc.prefix_search(MDDS_ASCII("B")); + size_t n = std::distance(matches.begin(), matches.end()); + assert(n == 2); + auto it2 = matches.begin(); + assert(it2->first == "Barak"); + assert(it2->second.data == "Obama"); + ++it2; + assert(it2->first == "Bob"); + assert(it2->second.data == "Marley"); + + matches = dbc.prefix_search(MDDS_ASCII("Hi")); + n = std::distance(matches.begin(), matches.end()); + assert(n == 1); + it2 = matches.begin(); + assert(it2->first == "Hideki"); + assert(it2->second.data == "Matsui"); + + // Invalid prefix searches. + matches = dbc.prefix_search(MDDS_ASCII("Bad")); + assert(matches.begin() == matches.end()); + matches = dbc.prefix_search(MDDS_ASCII("Foo")); + assert(matches.begin() == matches.end()); + } + + { + // Create a packed version from it, and make sure it still generates the + // same results. + packed_trie_map_type packed(dbc); + assert(packed.size() == dbc.size()); + + { + auto results = packed.prefix_search(MDDS_ASCII("B")); + size_t n = std::distance(results.begin(), results.end()); + assert(n == 2); + auto it2 = results.begin(); + assert(it2->first == "Barak"); + assert(it2->second.data == "Obama"); + ++it2; + assert(it2->first == "Bob"); + assert(it2->second.data == "Marley"); + ++it2; + assert(it2 == results.end()); + } + + { + auto results = dbc.prefix_search(MDDS_ASCII("Hi")); + size_t n = std::distance(results.begin(), results.end()); + assert(n == 1); + auto it2 = results.begin(); + assert(it2->first == "Hideki"); + assert(it2->second.data == "Matsui"); + } + + // Invalid prefix searches. + auto results = dbc.prefix_search(MDDS_ASCII("Bad")); + assert(results.begin() == results.end()); + results = dbc.prefix_search(MDDS_ASCII("Foo")); + assert(results.begin() == results.end()); + } + + { + auto packed = dbc.pack(); + auto results = packed.prefix_search(MDDS_ASCII("B")); + size_t n = std::distance(results.begin(), results.end()); + assert(n == 2); + auto it2 = results.begin(); + assert(it2->first == "Barak"); + assert(it2->second.data == "Obama"); + ++it2; + assert(it2->first == "Bob"); + assert(it2->second.data == "Marley"); + } + + // Erase an existing key. + bool erased = db.erase(MDDS_ASCII("Hideki")); + assert(erased); + assert(db.size() == 2); + + it = dbc.find(MDDS_ASCII("Hideki")); + assert(it == dbc.end()); + + // Try to erase a key that doesn't exist. + erased = db.erase(MDDS_ASCII("Foo")); + assert(!erased); + assert(db.size() == 2); + + // Clear the whole thing. + db.clear(); + assert(db.size() == 0); +} + +void trie_test2() +{ + stack_printer __stack_printer__("::trie_test2"); + using key_trait = trie::std_container_traits<std::vector<uint16_t>>; + using map_type = trie_map<key_trait, int>; + using key_type = map_type::key_type; + + auto print_key = [](const std::vector<uint16_t>& key, const char* msg) { + cout << msg << ": "; + std::copy(key.begin(), key.end(), std::ostream_iterator<uint16_t>(std::cout, " ")); + cout << endl; + }; + + map_type db; + key_type key = {2393, 99, 32589, 107, 0, 65535}; + print_key(key, "original"); + int value = 1; + db.insert(key, value); + assert(db.size() == 1); + { + auto it = db.begin(); + assert(it != db.end()); + assert(it->first == key); + + print_key(it->first, "from trie_map"); + } + + auto packed = db.pack(); + assert(packed.size() == 1); + + { + auto it = packed.begin(); + assert(it != packed.end()); + print_key(it->first, "from packed_trie_map"); + assert(it->first == key); + } +} + +void trie_test_iterator_empty() +{ + stack_printer __stack_printer__("::trie_test_iterator_empty"); + typedef trie_map<trie::std_string_traits, int> trie_map_type; + trie_map_type db; + const trie_map_type& dbc = db; + + // empty container + trie_map_type::const_iterator it = dbc.begin(); + trie_map_type::const_iterator ite = dbc.end(); + + assert(it == ite); + assert(db.begin() == dbc.begin()); // non-const vs const iterators + assert(dbc.end() == db.end()); // const vs non-const iterators +} + +void trie_test_iterator() +{ + stack_printer __stack_printer__("::trie_test_iterator"); + typedef trie_map<trie::std_string_traits, int> trie_map_type; + using kv = trie_map_type::key_value_type; + trie_map_type db; + const trie_map_type& dbc = db; + + cout << "empty container" << endl; + + // empty container + trie_map_type::const_iterator it = dbc.begin(); + trie_map_type::const_iterator ite = dbc.end(); + + // The end iterator will never get invalidated since it only references + // the root node which will never get modified as long as the parent + // container is alive. + + assert(it == ite); + + cout << "one element" << endl; + + db.insert(MDDS_ASCII("a"), 1); + it = dbc.begin(); + assert(it != ite); + assert(*it == kv("a", 1)); + ++it; + assert(it == ite); + + cout << "two elements" << endl; + + db.insert(MDDS_ASCII("ab"), 2); + it = dbc.begin(); + assert(it != ite); + assert(*it == kv("a", 1)); + ++it; + assert(it != ite); + assert(*it == kv("ab", 2)); + ++it; + assert(it == ite); + + cout << "more than two elements" << endl; + + db.insert(MDDS_ASCII("aba"), 3); + db.insert(MDDS_ASCII("abb"), 4); + db.insert(MDDS_ASCII("abc"), 5); + db.insert(MDDS_ASCII("bc"), 6); + db.insert(MDDS_ASCII("bcd"), 7); + + it = dbc.begin(); + assert(*it == kv("a", 1)); + ++it; + assert(*it == kv("ab", 2)); + ++it; + assert(*it == kv("aba", 3)); + ++it; + assert(*it == kv("abb", 4)); + ++it; + assert(*it == kv("abc", 5)); + ++it; + assert(*it == kv("bc", 6)); + ++it; + assert(*it == kv("bcd", 7)); + assert(it->first == "bcd"); + assert(it->second == 7); + ++it; + assert(it == ite); + + --it; + assert(it != ite); + assert(*it == kv("bcd", 7)); + --it; + assert(*it == kv("bc", 6)); + --it; + assert(*it == kv("abc", 5)); + --it; + assert(*it == kv("abb", 4)); + --it; + assert(*it == kv("aba", 3)); + --it; + assert(*it == kv("ab", 2)); + --it; + assert(*it == kv("a", 1)); + assert(it == dbc.begin()); + ++it; + assert(*it == kv("ab", 2)); + ++it; + assert(*it == kv("aba", 3)); + --it; + assert(*it == kv("ab", 2)); + --it; + assert(*it == kv("a", 1)); + ++it; + assert(*it == kv("ab", 2)); + ++it; + assert(*it == kv("aba", 3)); + + assert(db.begin() != dbc.end()); // non-const vs const iterators + assert(dbc.begin() != db.end()); // const vs non-const iterators +} + +void trie_test_iterator_with_erase() +{ + stack_printer __stack_printer__("::trie_test_iterator_with_erase"); + typedef trie_map<trie::std_string_traits, int> trie_map_type; + using kv = trie_map_type::key_value_type; + trie_map_type db; + const trie_map_type& dbc = db; + bool check_true = false; + + db.insert(MDDS_ASCII("Python"), 1); + db.insert(MDDS_ASCII("C++"), 2); + + auto it = dbc.begin(), ite = dbc.end(); + check_true = (*it++ == kv("C++", 2)); + assert(check_true); + check_true = (*it++ == kv("Python", 1)); + assert(check_true); + assert(it == ite); + + db.erase(MDDS_ASCII("C++")); + it = dbc.begin(); + check_true = (*it++ == kv("Python", 1)); + assert(check_true); + assert(it == ite); + check_true = (*(--it) == kv("Python", 1)); + assert(check_true); + assert(it == dbc.begin()); + + db.clear(); + assert(dbc.begin() == dbc.end()); + + db.insert(MDDS_ASCII("A"), 1); + db.insert(MDDS_ASCII("AB"), 2); + db.insert(MDDS_ASCII("ABC"), 3); + db.erase(MDDS_ASCII("AB")); + + it = dbc.begin(); + check_true = (*it++ == kv("A", 1)); + assert(check_true); + check_true = (*it++ == kv("ABC", 3)); + assert(check_true); + assert(it == ite); + + check_true = (*(--it) == kv("ABC", 3)); + assert(check_true); + check_true = (*(--it) == kv("A", 1)); + assert(check_true); + assert(it == dbc.begin()); + + db.clear(); + db.insert(MDDS_ASCII("A"), 1); + db.insert(MDDS_ASCII("AB"), 2); + db.insert(MDDS_ASCII("ABC"), 3); + db.erase(MDDS_ASCII("ABC")); + + it = dbc.begin(); + check_true = (*it++ == kv("A", 1)); + assert(check_true); + check_true = (*it++ == kv("AB", 2)); + assert(check_true); + assert(it == ite); + + check_true = (*(--it) == kv("AB", 2)); + assert(check_true); + check_true = (*(--it) == kv("A", 1)); + assert(check_true); + assert(it == dbc.begin()); + + it = ite; + --it; + assert(*it-- == kv("AB", 2)); // test post-decrement operator. + assert(*it == kv("A", 1)); +} + +void trie_test_find_iterator() +{ + stack_printer __stack_printer__("::trie_test_find_iterator"); + typedef trie_map<trie::std_string_traits, int> trie_map_type; + trie_map_type db; + const trie_map_type& dbc = db; + + db.insert(MDDS_ASCII("a"), 1); + db.insert(MDDS_ASCII("aa"), 2); + db.insert(MDDS_ASCII("ab"), 3); + db.insert(MDDS_ASCII("b"), 4); + { + auto it = dbc.find(MDDS_ASCII("a")); + assert(it->first == "a"); + assert(it->second == 1); + ++it; + assert(it->first == "aa"); + assert(it->second == 2); + ++it; + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == dbc.end()); + + it = dbc.find(MDDS_ASCII("aa")); + assert(it->first == "aa"); + assert(it->second == 2); + ++it; + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == dbc.end()); + + it = dbc.find(MDDS_ASCII("ab")); + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == dbc.end()); + + it = dbc.find(MDDS_ASCII("b")); + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == dbc.end()); + } + + trie_map_type::packed_type packed = db.pack(); + { + auto it = packed.find(MDDS_ASCII("a")); + assert(it->first == "a"); + assert(it->second == 1); + ++it; + assert(it->first == "aa"); + assert(it->second == 2); + ++it; + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == packed.end()); + + it = packed.find(MDDS_ASCII("aa")); + assert(it->first == "aa"); + assert(it->second == 2); + ++it; + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == packed.end()); + + it = packed.find(MDDS_ASCII("ab")); + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == packed.end()); + + it = packed.find(MDDS_ASCII("b")); + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == packed.end()); + } +} + +void trie_test_prefix_search() +{ + stack_printer __stack_printer__("::trie_test_prefix_search"); + + typedef trie_map<trie::std_string_traits, int> trie_map_type; + trie_map_type db; + const trie_map_type& dbc = db; + + db.insert(MDDS_ASCII("a"), 1); + db.insert(MDDS_ASCII("aa"), 2); + db.insert(MDDS_ASCII("ab"), 3); + db.insert(MDDS_ASCII("b"), 4); + + cout << "Performing prefix search on 'a'..." << endl; + + trie_map_type::search_results results = dbc.prefix_search(MDDS_ASCII("a")); + auto it = results.begin(); + auto ite = results.end(); + assert(it != ite); + assert(it->first == "a"); + assert(it->second == 1); + ++it; + assert(it->first == "aa"); + assert(it->second == 2); + ++it; + assert(it->first == "ab"); + assert(it->second == 3); + ++it; + assert(it == ite); + size_t n = std::distance(results.begin(), results.end()); + assert(n == 3); + + cout << "Performing prefix search on 'b'..." << endl; + + results = dbc.prefix_search(MDDS_ASCII("b")); + it = results.begin(); + ite = results.end(); + assert(it != ite); + assert(it->first == "b"); + assert(it->second == 4); + ++it; + assert(it == ite); + --it; + assert(it->first == "b"); + assert(it->second == 4); + n = std::distance(results.begin(), results.end()); + assert(n == 1); + + // Only one element. + db.clear(); + db.insert(MDDS_ASCII("dust"), 10); + + cout << "Performing prefix search on 'du'..." << endl; + + results = dbc.prefix_search(MDDS_ASCII("du")); + it = results.begin(); + assert(it->first == "dust"); + assert(it->second == 10); + bool check_true = (++it == results.end()); + assert(check_true); + --it; + assert(it->first == "dust"); + assert(it->second == 10); + n = std::distance(results.begin(), results.end()); + assert(n == 1); +} + +void trie_test_key_as_input() +{ + stack_printer __stack_printer__("::trie_test_key_as_input"); + + typedef trie_map<trie::std_string_traits, int> trie_map_type; + trie_map_type db; + const trie_map_type& dbc = db; + + db.insert(std::string("string as key"), 1); + db.insert("literal as key", 2); + + auto it = dbc.find("literal as key"); + assert(it != dbc.end()); + assert(it->first == "literal as key"); + assert(it->second == 2); + + auto results = dbc.prefix_search("str"); + auto rit = results.begin(); + assert(rit != results.end()); + assert(rit->first == "string as key"); + assert(rit->second == 1); + ++rit; + assert(rit == results.end()); +} + +void trie_test_copying() +{ + stack_printer __stack_printer__("::trie_test_copying"); + + typedef trie_map<trie::std_string_traits, int> trie_map_type; + trie_map_type db; + assert(db.empty()); + + { + auto db_copied(db); + assert(db_copied.empty()); + } + + db.insert("twenty", 20); + db.insert("twelve", 12); + assert(db.size() == 2); + + { + // copy constructor + auto db_copied(db); + const trie_map_type& dbc_copied = db_copied; + assert(db_copied.size() == 2); + + auto it = dbc_copied.find("twenty"); + assert(it != dbc_copied.end()); + assert(it->first == "twenty"); + assert(it->second == 20); + + it = dbc_copied.find("twelve"); + assert(it != dbc_copied.end()); + assert(it->first == "twelve"); + assert(it->second == 12); + } + + { + // copy assignment + trie_map_type db_copied; + db_copied = db; + const trie_map_type& dbc_copied = db_copied; + assert(db_copied.size() == 2); + + auto it = dbc_copied.find("twenty"); + assert(it != dbc_copied.end()); + assert(it->first == "twenty"); + assert(it->second == 20); + + it = dbc_copied.find("twelve"); + assert(it != dbc_copied.end()); + assert(it->first == "twelve"); + assert(it->second == 12); + } + + { + // move constructor + auto db_copied(db); + auto db_moved(std::move(db_copied)); + const trie_map_type& dbc_moved = db_moved; + assert(db_moved.size() == 2); + assert(db_copied.empty()); + + auto it = dbc_moved.find("twenty"); + assert(it != dbc_moved.end()); + assert(it->first == "twenty"); + assert(it->second == 20); + + it = dbc_moved.find("twelve"); + assert(it != dbc_moved.end()); + assert(it->first == "twelve"); + assert(it->second == 12); + } + + { + // move assignment + auto db_copied(db); + trie_map_type db_moved; + db_moved = std::move(db_copied); + const trie_map_type& dbc_moved = db_moved; + assert(db_moved.size() == 2); + assert(db_copied.empty()); + + auto it = dbc_moved.find("twenty"); + assert(it != dbc_moved.end()); + assert(it->first == "twenty"); + assert(it->second == 20); + + it = dbc_moved.find("twelve"); + assert(it != dbc_moved.end()); + assert(it->first == "twelve"); + assert(it->second == 12); + } +} + +void trie_test_value_update_from_iterator() +{ + stack_printer __stack_printer__("::trie_test_value_update_from_iterator"); + + typedef trie_map<trie::std_string_traits, int> trie_map_type; + trie_map_type db; + db.insert("one", 1); + db.insert("two", 2); + db.insert("three", 3); + + trie_map_type::iterator it = db.begin(); + assert(it->first == "one"); + assert(it->second == 1); + it->second = 10; // update the value. + it = db.begin(); + assert(it->first == "one"); + assert(it->second == 10); + + it = db.find("three"); + assert(it->first == "three"); + assert(it->second == 3); + it->second = 345; // update the value again. + it = db.find("three"); + assert(it->first == "three"); + assert(it->second == 345); +} + +int main() +{ + try + { + trie_packed_test1(); + trie_packed_test2(); + trie_packed_test3(); + trie_packed_test4(); + trie_packed_test_value_life_cycle(); + trie_packed_test_custom_string(); + trie_packed_test_iterator_empty(); + trie_packed_test_iterator(); + trie_packed_test_prefix_search1(); + trie_packed_test_key_as_input(); + trie_packed_test_copying(); + trie_packed_test_non_equal(); + trie_packed_test_save_and_load_state::run(); + + trie_test1(); + trie_test2(); + + trie_test_iterator_empty(); + trie_test_iterator(); + trie_test_iterator_with_erase(); + trie_test_find_iterator(); + trie_test_prefix_search(); + trie_test_key_as_input(); + trie_test_copying(); + trie_test_value_update_from_iterator(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } + + cout << "Test finished successfully!" << endl; + + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |