From 28d117820ae6dfc93f989df1c5d666446adda8e3 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 13 Aug 2015 18:29:00 +0200 Subject: [PATCH] investigation: Segfault in GDB (II) narrow down involved parts --- research/try.cpp | 103 +++++------------------------------------------ 1 file changed, 10 insertions(+), 93 deletions(-) diff --git a/research/try.cpp b/research/try.cpp index 7330f2263..6ea46275b 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -36,116 +36,33 @@ */ #include "lib/test/test-helper.hpp" -#include "lib/util.hpp" #include "lib/format-util.hpp" -#include "lib/diff/record.hpp" -#include "lib/itertools.hpp" -#include "lib/util.hpp" //////TODO necessary? #include -//#include #include #include using std::string; -using util::isSameObject; -using util::isnil; using std::vector; -//using std::swap; using std::cout; using std::endl; -namespace lib { -namespace diff{ -namespace test{ - -// using lumiera::error::LUMIERA_ERROR_LOGIC; - using lumiera::error::LUMIERA_ERROR_INVALID; - using lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE; - - namespace {//Test fixture.... - - using Seq = vector; - using RecS = Record; - - template - inline Seq - contents (IT const& it) - { - Seq collected; - append_all (it, collected); - return collected; - } - - inline Seq - contents (RecS const& rec_of_strings) - { - return contents (rec_of_strings.begin()); - } - - template - inline Seq - strings (std::initializer_list const& con) - { - Seq collected; - for (auto elm : con) - collected.push_back(elm); - return collected; - } - - - }//(End)Test fixture - - - - - - - - /*************************************************************************************//** - * @test Verify properties of a special collection type meant for external representation - * of object-like data. - * - * @see IndexTable - * @see DiffListApplication_test - */ - class GenericRecordRepresentation_test// : public Test - { - public: - virtual void - run () - { - simpleUsage(); - } - - - void - simpleUsage() - { - RecS enterprise("starship" - , strings ({"Name = USS Enterprise" - ,"Registry = NCC-1701-D" - ,"Class = Galaxy" - ,"Owner = United Federation of Planets" - ,"built=2363" - }) - , strings ({"Picard", "Riker", "Data", "Troi", "Worf", "Crusher", "La Forge"}) - ); - - cout << "enterprise = " << string(enterprise)< crew; + crew.push_back("Picard"); + crew.push_back("Riker"); + crew.push_back("Data"); + crew.push_back("Troi"); + crew.push_back("Worf"); + crew.push_back("Crusher"); + crew.push_back("La Forge"); + + cout << "enterprise = " << util::join(crew)<