commit mdds for openSUSE:Factory
Hello community, here is the log from the commit of package mdds for openSUSE:Factory checked in at 2014-11-24 11:10:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mdds (Old) and /work/SRC/openSUSE:Factory/.mdds.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "mdds" Changes: -------- --- /work/SRC/openSUSE:Factory/mdds/mdds.changes 2014-10-05 20:30:35.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.mdds.new/mdds.changes 2014-11-24 11:10:58.000000000 +0100 @@ -1,0 +2,6 @@ +Thu Nov 13 12:13:18 UTC 2014 - tchvatal@suse.com + +- Version bump to 0.11.1: + * Small bugfixes along 0.11 series + +------------------------------------------------------------------- Old: ---- mdds_0.11.0.tar.bz2 New: ---- mdds_0.11.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mdds.spec ++++++ --- /var/tmp/diff_new_pack.c7q8UE/_old 2014-11-24 11:10:59.000000000 +0100 +++ /var/tmp/diff_new_pack.c7q8UE/_new 2014-11-24 11:10:59.000000000 +0100 @@ -17,7 +17,7 @@ Name: mdds -Version: 0.11.0 +Version: 0.11.1 Release: 0 Summary: A collection of multi-dimensional data structure and indexing algorithm License: MIT ++++++ mdds_0.11.0.tar.bz2 -> mdds_0.11.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/NEWS new/mdds_0.11.1/NEWS --- old/mdds_0.11.0/NEWS 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/NEWS 2014-10-03 02:44:03.000000000 +0200 @@ -1,3 +1,15 @@ +mdds 0.11.1 + +* all + + * fixed a large number of outstanding defects reported by Coverity + Scan. + +* multi_type_vector + + * fixed 2 cases of double-free bug in the variant of swap() that + allows segmented swapping. + mdds 0.11.0 * sorted_string_map (new) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/configure new/mdds_0.11.1/configure --- old/mdds_0.11.0/configure 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/configure 2014-10-03 02:44:03.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for mdds 0.11.0. +# Generated by GNU Autoconf 2.69 for mdds 0.11.1. # # Report bugs to <kohei.yoshida@gmail.com>. # @@ -579,8 +579,8 @@ # Identity of this package. PACKAGE_NAME='mdds' PACKAGE_TARNAME='mdds' -PACKAGE_VERSION='0.11.0' -PACKAGE_STRING='mdds 0.11.0' +PACKAGE_VERSION='0.11.1' +PACKAGE_STRING='mdds 0.11.1' PACKAGE_BUGREPORT='kohei.yoshida@gmail.com' PACKAGE_URL='' @@ -1181,7 +1181,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures mdds 0.11.0 to adapt to many kinds of systems. +\`configure' configures mdds 0.11.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1242,7 +1242,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mdds 0.11.0:";; + short | recursive ) echo "Configuration of mdds 0.11.1:";; esac cat <<\_ACEOF @@ -1335,7 +1335,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mdds configure 0.11.0 +mdds configure 0.11.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1352,7 +1352,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by mdds $as_me 0.11.0, which was +It was created by mdds $as_me 0.11.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1701,7 +1701,7 @@ -VERSION=0.11.0 +VERSION=0.11.1 PACKAGE_TARNAME=mdds @@ -2298,7 +2298,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mdds $as_me 0.11.0, which was +This file was extended by mdds $as_me 0.11.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2351,7 +2351,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mdds config.status 0.11.0 +mdds config.status 0.11.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -3455,7 +3455,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mdds $as_me 0.11.0, which was +This file was extended by mdds $as_me 0.11.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3508,7 +3508,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mdds config.status 0.11.0 +mdds config.status 0.11.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -4613,7 +4613,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mdds $as_me 0.11.0, which was +This file was extended by mdds $as_me 0.11.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4666,7 +4666,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mdds config.status 0.11.0 +mdds config.status 0.11.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -5772,7 +5772,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mdds $as_me 0.11.0, which was +This file was extended by mdds $as_me 0.11.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5825,7 +5825,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mdds config.status 0.11.0 +mdds config.status 0.11.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/configure.ac new/mdds_0.11.1/configure.ac --- old/mdds_0.11.0/configure.ac 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/configure.ac 2014-10-03 02:44:03.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT(mdds, 0.11.0, kohei.yoshida@gmail.com) +AC_INIT(mdds, 0.11.1, kohei.yoshida@gmail.com) VERSION=AC_PACKAGE_VERSION AC_SUBST(VERSION) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/include/mdds/flat_segment_tree.hpp new/mdds_0.11.1/include/mdds/flat_segment_tree.hpp --- old/mdds_0.11.0/include/mdds/flat_segment_tree.hpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/include/mdds/flat_segment_tree.hpp 2014-10-03 02:44:03.000000000 +0200 @@ -61,6 +61,12 @@ { return low == r.low && high == r.high; } + + nonleaf_value_type() + : low(0) + , high(0) + { + } }; struct leaf_value_type @@ -72,6 +78,12 @@ { return key == r.key && value == r.value; } + + leaf_value_type() + : key(0) + , value(0) + { + } }; // Handlers required by the node template class. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/include/mdds/mixed_type_matrix_flag_storage.hpp new/mdds_0.11.1/include/mdds/mixed_type_matrix_flag_storage.hpp --- old/mdds_0.11.0/include/mdds/mixed_type_matrix_flag_storage.hpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/include/mdds/mixed_type_matrix_flag_storage.hpp 2014-10-03 02:44:03.000000000 +0200 @@ -27,6 +27,7 @@ #ifdef MDDS_UNIT_TEST #include <iostream> +#include <boost/io/ios_state.hpp> #endif #include "mdds/hash_container/map.hpp" @@ -85,6 +86,7 @@ } cout << "flags stored:" << endl; + boost::io::ios_flags_saver ifs(cout); typename flag_store_type::const_iterator itr = m_flags.begin(), itr_end = m_flags.end(); for (; itr != itr_end; ++itr) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/include/mdds/mixed_type_matrix_storage_sparse.inl new/mdds_0.11.1/include/mdds/mixed_type_matrix_storage_sparse.inl --- old/mdds_0.11.0/include/mdds/mixed_type_matrix_storage_sparse.inl 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/include/mdds/mixed_type_matrix_storage_sparse.inl 2014-10-03 02:44:03.000000000 +0200 @@ -79,7 +79,9 @@ m_rows(r.m_rows), m_empty_elem(r.m_empty_elem), m_row_size(r.m_row_size), - m_col_size(r.m_col_size) {} + m_col_size(r.m_col_size), + m_numeric(r.m_numeric), + m_valid(r.m_valid) {} ~storage_sparse() {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/include/mdds/multi_type_matrix_def.inl new/mdds_0.11.1/include/mdds/multi_type_matrix_def.inl --- old/mdds_0.11.0/include/mdds/multi_type_matrix_def.inl 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/include/mdds/multi_type_matrix_def.inl 2014-10-03 02:44:03.000000000 +0200 @@ -366,31 +366,31 @@ multi_type_matrix<_String>::transpose() { multi_type_matrix tmp(m_size.column, m_size.row); - for (size_type row = 0; row < m_size.row; ++row) + for (size_type old_row_new_col = 0; old_row_new_col < m_size.row; ++old_row_new_col) { - for (size_type col = 0; col < m_size.column; ++col) + for (size_type old_col_new_row = 0; old_col_new_row < m_size.column; ++old_col_new_row) { - switch (get_type(row,col)) + switch (get_type(old_row_new_col,old_col_new_row)) { case mtm::element_numeric: { double val; - m_store.get(get_pos(row,col), val); - tmp.set(col, row, val); + m_store.get(get_pos(old_row_new_col,old_col_new_row), val); + tmp.set(old_col_new_row, old_row_new_col, val); } break; case mtm::element_boolean: { bool val; - m_store.get(get_pos(row,col), val); - tmp.set(col, row, val); + m_store.get(get_pos(old_row_new_col,old_col_new_row), val); + tmp.set(old_col_new_row, old_row_new_col, val); } break; case mtm::element_string: { string_type val; - m_store.get(get_pos(row,col), val); - tmp.set(col, row, val); + m_store.get(get_pos(old_row_new_col,old_col_new_row), val); + tmp.set(old_col_new_row, old_row_new_col, val); } break; case mtm::element_empty: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/include/mdds/multi_type_vector_def.inl new/mdds_0.11.1/include/mdds/multi_type_vector_def.inl --- old/mdds_0.11.0/include/mdds/multi_type_vector_def.inl 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/include/mdds/multi_type_vector_def.inl 2014-10-03 02:44:03.000000000 +0200 @@ -2009,6 +2009,7 @@ { // Append the new elements to the previous block. element_block_func::append_values_from_block(*blk_prev->mp_data, *dst_data); + element_block_func::resize_block(*dst_data, 0); // prevent double-delete. blk_prev->m_size += len; } else @@ -2038,6 +2039,7 @@ { // Merge with the next block. element_block_func::prepend_values_from_block(*blk_next->mp_data, *dst_data, 0, len); + element_block_func::resize_block(*dst_data, 0); // prevent double-delete. blk_next->m_size += len; } else @@ -2913,7 +2915,7 @@ if (dst_end_pos == blk->m_size) { // The new elements will replace the lower part of the block. - + assert(blk->mp_data && "NULL block mp_data"); element_block_func::resize_block(*blk->mp_data, dst_offset); blk->m_size = dst_offset; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/include/mdds/point_quad_tree.hpp new/mdds_0.11.1/include/mdds/point_quad_tree.hpp --- old/mdds_0.11.0/include/mdds/point_quad_tree.hpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/include/mdds/point_quad_tree.hpp 2014-10-03 02:44:03.000000000 +0200 @@ -804,7 +804,6 @@ adjust_quad(xrange, yrange, delete_node->southeast, dir_north, insert_list); set_new_root(xrange, yrange, delete_node->southwest, quad_northeast, insert_list); break; - case quad_unspecified: default: throw general_error("quadrant for the replacement node is unspecified."); } @@ -837,7 +836,6 @@ reinsert_tree(delete_node, quad_southwest, root); } break; - case quad_unspecified: default: throw general_error("quadrant for the replacement node is unspecified."); } @@ -869,7 +867,6 @@ delete_node->southwest = repl_node->southwest; repl_node->southwest.reset(); break; - case quad_unspecified: default: throw general_error("quadrant for the replacement node is unspecified."); } @@ -1533,7 +1530,6 @@ root->parent = dest; } break; - case quad_unspecified: default: throw general_error("reinsert_tree: quadrant unspecified"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/include/mdds/quad_node.hpp new/mdds_0.11.1/include/mdds/quad_node.hpp --- old/mdds_0.11.0/include/mdds/quad_node.hpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/include/mdds/quad_node.hpp 2014-10-03 02:44:03.000000000 +0200 @@ -232,20 +232,25 @@ node_ptr get_quadrant_node(node_quadrant_t quad) const { + node_ptr ret; switch (quad) { case quad_northeast: - return northeast; + ret = northeast; + break; case quad_northwest: - return northwest; + ret = northwest; + break; case quad_southeast: - return southeast; + ret = southeast; + break; case quad_southwest: - return southwest; + ret = southwest; + break; default: throw general_error("unknown quadrant type"); } - return node_ptr(); + return ret; } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/include/mdds/segment_tree.hpp new/mdds_0.11.1/include/mdds/segment_tree.hpp --- old/mdds_0.11.0/include/mdds/segment_tree.hpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/include/mdds/segment_tree.hpp 2014-10-03 02:44:03.000000000 +0200 @@ -771,15 +771,17 @@ }; template<typename _Key, typename _Data> -segment_tree<_Key, _Data>::segment_tree() : - m_valid_tree(false) +segment_tree<_Key, _Data>::segment_tree() + : m_root_node(NULL) + , m_valid_tree(false) { } template<typename _Key, typename _Data> -segment_tree<_Key, _Data>::segment_tree(const segment_tree& r) : - m_segment_data(r.m_segment_data), - m_valid_tree(r.m_valid_tree) +segment_tree<_Key, _Data>::segment_tree(const segment_tree& r) + : m_segment_data(r.m_segment_data) + , m_root_node(NULL) + , m_valid_tree(r.m_valid_tree) { if (m_valid_tree) build_tree(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/misc/sorted_string_map_perf.cpp new/mdds_0.11.1/misc/sorted_string_map_perf.cpp --- old/mdds_0.11.0/misc/sorted_string_map_perf.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/mdds_0.11.1/misc/sorted_string_map_perf.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -0,0 +1,166 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * Copyright (c) 2014 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 "../include/mdds/sorted_string_map.hpp" + +#include <cstdlib> +#include <iostream> +#include <cstring> + +#include <boost/unordered_map.hpp> + +using namespace std; + +#include <stdio.h> +#include <string> +#include <sys/time.h> + +namespace { + +class stack_printer +{ +public: + explicit stack_printer(const char* msg) : + m_msg(msg) + { + fprintf(stdout, "%s: --begin\n", m_msg.c_str()); + m_start_time = getTime(); + } + + ~stack_printer() + { + double end_time = getTime(); + fprintf(stdout, "%s: --end (duration: %g sec)\n", m_msg.c_str(), (end_time - m_start_time)); + } + + void printTime(int line) const + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", m_msg.c_str(), line, (fEndTime - m_start_time)); + } + +private: + double getTime() const + { + timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + tv.tv_usec / 1000000.0; + } + + ::std::string m_msg; + double m_start_time; +}; + +} + +enum name_type { + name_none = 0, + name_andy, + name_bruce, + name_charlie, + name_david +}; + +typedef mdds::sorted_string_map<name_type> map_type; + +map_type::entry entries[] = +{ + { "andy", name_andy }, + { "andy1", name_andy }, + { "andy13", name_andy }, + { "bruce", name_bruce }, + { "charlie", name_charlie }, + { "david", name_david }, +}; + +typedef boost::unordered_map<std::string, name_type> hashmap_type; + +void init_hash_map(hashmap_type& hm) +{ + size_t n = sizeof(entries) / sizeof(entries[0]); + const map_type::entry* p = entries; + const map_type::entry* pend = p + n; + for (; p != pend; ++p) + hm.insert(hashmap_type::value_type(p->key, p->value)); +} + +void run(map_type& sm, const char* input) +{ + name_type type = sm.find(input, strlen(input)); +} + +void run_hash(hashmap_type& hm, const char* input) +{ + name_type type = name_none; + hashmap_type::const_iterator it = hm.find(input); + if (it != hm.end()) + type = it->second; +} + +const char* tests[] = { + "andy", + "david", + "charlie", + "andy1", + "bruce", + "blah", + "andy13" +}; + +int main() +{ + static const size_t repeat_count = 10000000; + + map_type sorted_map(entries, sizeof(entries)/sizeof(entries[0]), name_none); + size_t n = sorted_map.size(); + cout << "entry count = " << n << endl; + + { + stack_printer __stack_printer__("sorted entry"); + for (size_t rep = 0; rep < repeat_count; ++rep) + { + for (size_t i = 0; i < n; ++i) + run(sorted_map, tests[i]); + } + } + + hashmap_type hm; + init_hash_map(hm); + { + stack_printer __stack_printer__("hash map"); + for (size_t rep = 0; rep < repeat_count; ++rep) + { + for (size_t i = 0; i < n; ++i) + run_hash(hm, tests[i]); + } + } + + return EXIT_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/src/flat_segment_tree_test.cpp new/mdds_0.11.1/src/flat_segment_tree_test.cpp --- old/mdds_0.11.0/src/flat_segment_tree_test.cpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/src/flat_segment_tree_test.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -1930,65 +1930,73 @@ int main (int argc, char **argv) { - cmd_options opt; - if (!parse_cmd_options(argc, argv, opt)) - return EXIT_FAILURE; - - if (opt.test_func) + try { - fst_test_equality(); - fst_test_copy_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); - } + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; + if (opt.test_func) { - 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); + fst_test_equality(); + fst_test_copy_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_tree_build(); + fst_test_tree_search(); + 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_clear(); + fst_test_assignment(); } + if (opt.test_perf) { - 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_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(); } - - fst_test_leaf_search(); - fst_test_tree_build(); - fst_test_tree_search(); - 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_clear(); - fst_test_assignment(); } - - if (opt.test_perf) + catch (const std::exception& e) { - 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(); + fprintf(stdout, "Test failed: %s\n", e.what()); + return EXIT_FAILURE; } fprintf(stdout, "Test finished successfully!\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/src/mixed_type_matrix_test.cpp new/mdds_0.11.1/src/mixed_type_matrix_test.cpp --- old/mdds_0.11.0/src/mixed_type_matrix_test.cpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/src/mixed_type_matrix_test.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -947,48 +947,56 @@ int main(int argc, char** argv) { - cmd_options opt; - if (!parse_cmd_options(argc, argv, opt)) - return EXIT_FAILURE; - - if (opt.test_func) + try { - run_tests_on_all_density_types(mtm_test_resize); - run_tests_on_all_density_types(mtm_test_value_store); - run_tests_on_all_density_types(mtm_test_transpose); - run_tests_on_all_density_types(mtm_test_assignment); - - mtm_test_initial_elements(); - mtm_test_numeric_matrix(); - mtm_test_assign(matrix_density_filled_zero, matrix_density_filled_zero); - mtm_test_assign(matrix_density_filled_empty, matrix_density_filled_zero); - mtm_test_assign(matrix_density_filled_zero, matrix_density_filled_empty); - mtm_test_assign(matrix_density_filled_empty, matrix_density_filled_empty); - - run_tests_on_all_density_types(mtm_test_flag_storage); - - mtm_test_iterator_access_filled<mx_type::filled_storage_type>(1, 1); - mtm_test_iterator_access_filled<mx_type::filled_storage_type>(3, 1); - mtm_test_iterator_access_filled<mx_type::filled_storage_type>(1, 3); - mtm_test_iterator_access_filled<mx_type::filled_storage_type>(3, 3); - mtm_test_iterator_access_filled<mx_type::filled_storage_type>(0, 0); - - mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(1, 1); - mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(3, 1); - mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(1, 3); - mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(3, 3); - mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(0, 0); - - mtm_test_iterator_access_sparse(); - - mtm_test_const_iterator(); + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; + + if (opt.test_func) + { + run_tests_on_all_density_types(mtm_test_resize); + run_tests_on_all_density_types(mtm_test_value_store); + run_tests_on_all_density_types(mtm_test_transpose); + run_tests_on_all_density_types(mtm_test_assignment); + + mtm_test_initial_elements(); + mtm_test_numeric_matrix(); + mtm_test_assign(matrix_density_filled_zero, matrix_density_filled_zero); + mtm_test_assign(matrix_density_filled_empty, matrix_density_filled_zero); + mtm_test_assign(matrix_density_filled_zero, matrix_density_filled_empty); + mtm_test_assign(matrix_density_filled_empty, matrix_density_filled_empty); + + run_tests_on_all_density_types(mtm_test_flag_storage); + + mtm_test_iterator_access_filled<mx_type::filled_storage_type>(1, 1); + mtm_test_iterator_access_filled<mx_type::filled_storage_type>(3, 1); + mtm_test_iterator_access_filled<mx_type::filled_storage_type>(1, 3); + mtm_test_iterator_access_filled<mx_type::filled_storage_type>(3, 3); + mtm_test_iterator_access_filled<mx_type::filled_storage_type>(0, 0); + + mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(1, 1); + mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(3, 1); + mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(1, 3); + mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(3, 3); + mtm_test_iterator_access_filled<mx_type::filled_storage_zero_type>(0, 0); + + mtm_test_iterator_access_sparse(); + + mtm_test_const_iterator(); + } + + if (opt.test_perf) + { + mtm_perf_test_storage_creation(); + mtm_perf_test_storage_set_numeric(); + mtm_perf_test_iterate_elements(); + } } - - if (opt.test_perf) + catch (const std::exception& e) { - mtm_perf_test_storage_creation(); - mtm_perf_test_storage_set_numeric(); - mtm_perf_test_iterate_elements(); + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; } cout << "Test finished successfully!" << endl; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/src/multi_type_matrix_test.cpp new/mdds_0.11.1/src/multi_type_matrix_test.cpp --- old/mdds_0.11.0/src/multi_type_matrix_test.cpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/src/multi_type_matrix_test.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -969,34 +969,42 @@ int main (int argc, char **argv) { - cmd_options opt; - if (!parse_cmd_options(argc, argv, opt)) - return EXIT_FAILURE; - - if (opt.test_func) + try { - mtm_test_construction(); - mtm_test_data_insertion(); - mtm_test_data_insertion_multiple(); - mtm_test_set_empty(); - mtm_test_swap(); - mtm_test_transpose(); - mtm_test_resize(); - mtm_test_copy(); - mtm_test_assignment(); - mtm_test_numeric(); - mtm_test_walk(); - mtm_test_custom_string(); - mtm_test_position(); - mtm_test_set_data_via_position(); - } + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; - if (opt.test_perf) + if (opt.test_func) + { + mtm_test_construction(); + mtm_test_data_insertion(); + mtm_test_data_insertion_multiple(); + mtm_test_set_empty(); + mtm_test_swap(); + mtm_test_transpose(); + mtm_test_resize(); + mtm_test_copy(); + mtm_test_assignment(); + mtm_test_numeric(); + mtm_test_walk(); + 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) { - mtm_perf_test_storage_creation(); - mtm_perf_test_storage_set_numeric(); - mtm_perf_test_iterate_elements(); - mtm_perf_test_insert_via_position_object(); + fprintf(stdout, "Test failed: %s\n", e.what()); + return EXIT_FAILURE; } cout << "Test finished successfully!" << endl; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/src/multi_type_vector_test_custom.cpp new/mdds_0.11.1/src/multi_type_vector_test_custom.cpp --- old/mdds_0.11.0/src/multi_type_vector_test_custom.cpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/src/multi_type_vector_test_custom.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -76,6 +76,7 @@ muser_cell() : value(0.0) {} muser_cell(const muser_cell& r) : value(r.value) {} muser_cell(double _v) : value(_v) {} + ~muser_cell() {} }; struct date @@ -1449,6 +1450,69 @@ 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); + + assert(db1.check_block_integrity()); + assert(db2.check_block_integrity()); } void mtv_test_custom_block_func3() @@ -1569,17 +1633,25 @@ int main (int argc, char **argv) { - mtv_test_types(); - mtv_test_block_identifier(); - mtv_test_basic(); - mtv_test_equality(); - mtv_test_managed_block(); - mtv_test_custom_block_func1(); - mtv_test_transfer(); - mtv_test_swap(); - mtv_test_custom_block_func3(); - mtv_test_release(); - mtv_test_construction_with_array(); + try + { + mtv_test_types(); + mtv_test_block_identifier(); + mtv_test_basic(); + mtv_test_equality(); + mtv_test_managed_block(); + mtv_test_custom_block_func1(); + mtv_test_transfer(); + mtv_test_swap(); + mtv_test_custom_block_func3(); + mtv_test_release(); + mtv_test_construction_with_array(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } cout << "Test finished successfully!" << endl; return EXIT_SUCCESS; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/src/multi_type_vector_test_default.cpp new/mdds_0.11.1/src/multi_type_vector_test_default.cpp --- old/mdds_0.11.0/src/multi_type_vector_test_default.cpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/src/multi_type_vector_test_default.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -2964,7 +2964,7 @@ it = db.set(6, string("text")); assert(it->size == 1); assert(it->type == mtv::element_type_string); - assert(it->position = 6); + assert(it->position == 6); check = db.begin(); std::advance(check, 2); assert(it == check); @@ -5071,40 +5071,48 @@ int main (int argc, char **argv) { - mtv_test_types(); - mtv_test_construction(); - mtv_test_basic(); - mtv_test_empty_cells(); - mtv_test_swap(); - mtv_test_equality(); - mtv_test_clone(); - mtv_test_resize(); - mtv_test_erase(); - mtv_test_insert_empty(); - mtv_test_set_cells(); - mtv_test_insert_cells(); - mtv_test_iterators(); - mtv_test_data_iterators(); - mtv_test_non_const_data_iterators(); - mtv_test_iterator_private_data(); - mtv_test_set_return_iterator(); - mtv_test_set2_return_iterator(); - mtv_test_insert_cells_return_iterator(); - mtv_test_set_empty_return_iterator(); - mtv_test_insert_empty_return_iterator(); - mtv_test_set_with_position(); - mtv_test_set_cells_with_position(); - mtv_test_insert_cells_with_position(); - mtv_test_set_empty_with_position(); - mtv_test_insert_empty_with_position(); - mtv_test_position(); - mtv_test_next_position(); - mtv_test_swap_range(); - mtv_test_value_type(); - mtv_test_block_identifier(); - mtv_test_transfer(); - mtv_test_push_back(); - mtv_test_capacity(); + try + { + mtv_test_types(); + mtv_test_construction(); + mtv_test_basic(); + mtv_test_empty_cells(); + mtv_test_swap(); + mtv_test_equality(); + mtv_test_clone(); + mtv_test_resize(); + mtv_test_erase(); + mtv_test_insert_empty(); + mtv_test_set_cells(); + mtv_test_insert_cells(); + mtv_test_iterators(); + mtv_test_data_iterators(); + mtv_test_non_const_data_iterators(); + mtv_test_iterator_private_data(); + mtv_test_set_return_iterator(); + mtv_test_set2_return_iterator(); + mtv_test_insert_cells_return_iterator(); + mtv_test_set_empty_return_iterator(); + mtv_test_insert_empty_return_iterator(); + mtv_test_set_with_position(); + mtv_test_set_cells_with_position(); + mtv_test_insert_cells_with_position(); + mtv_test_set_empty_with_position(); + mtv_test_insert_empty_with_position(); + mtv_test_position(); + mtv_test_next_position(); + mtv_test_swap_range(); + mtv_test_value_type(); + mtv_test_block_identifier(); + mtv_test_transfer(); + mtv_test_push_back(); + mtv_test_capacity(); + } + catch (const std::exception& e) + { + cout << "Test failed: " << e.what() << endl; + return EXIT_FAILURE; + } cout << "Test finished successfully!" << endl; return EXIT_SUCCESS; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/src/point_quad_tree_test.cpp new/mdds_0.11.1/src/point_quad_tree_test.cpp --- old/mdds_0.11.0/src/point_quad_tree_test.cpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/src/point_quad_tree_test.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -188,7 +188,8 @@ db.remove(x, y); size_t n = db.size(); cout << "removing node at (" << x << "," << y << ") " << "size after removal: " << n << endl; - assert(--node_count == n); + --node_count; + assert(node_count == n); } } } @@ -454,15 +455,24 @@ int main() { - 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); + 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/src/rectangle_set_test.cpp new/mdds_0.11.1/src/rectangle_set_test.cpp --- old/mdds_0.11.0/src/rectangle_set_test.cpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/src/rectangle_set_test.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -943,24 +943,32 @@ int main(int argc, char** argv) { - cmd_options opt; - if (!parse_cmd_options(argc, argv, opt)) - return EXIT_FAILURE; - if (opt.test_func) + try { - rect_test_insertion_removal(); - rect_test_search(); - rect_test_copy_constructor(); - rect_test_assignment(); - rect_test_equality(); - rect_test_search_result_iterator(); - rect_test_invalid_range(); - } + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; + if (opt.test_func) + { + rect_test_insertion_removal(); + rect_test_search(); + rect_test_copy_constructor(); + rect_test_assignment(); + rect_test_equality(); + rect_test_search_result_iterator(); + rect_test_invalid_range(); + } - if (opt.test_perf) + if (opt.test_perf) + { + rect_test_perf_insertion_fixed_x(); + rect_test_perf_insertion_fixed_y(); + } + } + catch (const std::exception& e) { - rect_test_perf_insertion_fixed_x(); - rect_test_perf_insertion_fixed_y(); + fprintf(stdout, "Test failed: %s\n", e.what()); + return EXIT_FAILURE; } fprintf(stdout, "Test finished successfully!\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.11.0/src/segment_tree_test.cpp new/mdds_0.11.1/src/segment_tree_test.cpp --- old/mdds_0.11.0/src/segment_tree_test.cpp 2014-09-18 20:06:38.000000000 +0200 +++ new/mdds_0.11.1/src/segment_tree_test.cpp 2014-10-03 02:44:03.000000000 +0200 @@ -1084,36 +1084,43 @@ int main(int argc, char** argv) { - cmd_options opt; - if (!parse_cmd_options(argc, argv, opt)) - return EXIT_FAILURE; - - if (opt.test_func) + try { - 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(); - } + cmd_options opt; + if (!parse_cmd_options(argc, argv, opt)) + return EXIT_FAILURE; - if (opt.test_perf) - { - st_test_perf_insertion(); - } + 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(); + } - // 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); + 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; } -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de