diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /contrib/utility/Test | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'contrib/utility/Test')
35 files changed, 0 insertions, 1556 deletions
diff --git a/contrib/utility/Test/ExH/Compound/Makefile b/contrib/utility/Test/ExH/Compound/Makefile deleted file mode 100644 index b596cd2fbce..00000000000 --- a/contrib/utility/Test/ExH/Compound/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ExH/Compound/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := compound.cpp - -module_base := compound -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ExH/Compound/compound.cpp b/contrib/utility/Test/ExH/Compound/compound.cpp deleted file mode 100644 index d3319f5d7dc..00000000000 --- a/contrib/utility/Test/ExH/Compound/compound.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// file : Test/ExH/Compound/compound.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ExH/Compound.hpp" - -#include <string> - -using namespace Utility::ExH; - -struct E {}; - -void postcondition (bool p) throw (E) -{ - if (!p) throw E (); -} - -class Base -{ -protected: - Base () throw () - { - } - - void - init (char const* description) throw () - { - str_ = description; - } - - char const* - what () const throw () - { - return str_.c_str (); - } - -public: - std::string str_; -}; - -class A_ {}; -typedef -Compound<A_, Base> -A; - -struct StringHolder -{ - StringHolder (char const* s) - : str_ (s) - { - } - - operator std::string () const - { - return str_; - } - - std::string str_; -}; - - -int main () -{ - try - { - // Compound (char const*) - // - { - A a ("hello"); - - postcondition (a.str_ == "hello"); - } - - // Compound (T const&) - // - { - StringHolder a ("hello"); - A b (a); - - postcondition (b.str_ == "hello"); - } - - // Compound (Compound const&) - // - { - A a ("hello"); - A b (a); - - postcondition (b.str_ == "hello"); - } - - // ~Compound () - // - - // operator= (Compound const&) - // - { - A a ("hello"); - A b ("foo"); - b = a; - - postcondition (b.str_ == "hello"); - } - - // Compound () - // - - } - catch (...) - { - return -1; - } -} -//$Id$ diff --git a/contrib/utility/Test/ExH/Converter/Makefile b/contrib/utility/Test/ExH/Converter/Makefile deleted file mode 100644 index 3f37652482d..00000000000 --- a/contrib/utility/Test/ExH/Converter/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ExH/Converter/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := converter.cpp - -module_base := converter -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ExH/Converter/converter.cpp b/contrib/utility/Test/ExH/Converter/converter.cpp deleted file mode 100644 index 396b616e6a6..00000000000 --- a/contrib/utility/Test/ExH/Converter/converter.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// file : Test/ExH/Converter/converter.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ExH/Converter.hpp" -#include "Utility/ExH/StringStreamConverter.hpp" - -#include <string> -#include <sstream> - -using std::string; -using namespace Utility::ExH; - -struct E {}; - -void postcondition (bool p) throw (E) -{ - if (!p) throw E (); -} - -int -main () -{ - try - { - // template<T> - // converter (T const&) - // - { - postcondition (converter ("hello") == string("hello")); - } - - // template<> - // converter (std::ostringstream const&) - // - { - std::ostringstream ostr; - ostr << "hello"; - postcondition (converter (ostr) == string("hello")); - } - } - catch (...) - { - return -1; - } -} -//$Id$ diff --git a/contrib/utility/Test/ExH/Inline/Makefile b/contrib/utility/Test/ExH/Inline/Makefile deleted file mode 100644 index 26606c35669..00000000000 --- a/contrib/utility/Test/ExH/Inline/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ExH/Inline/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := inline.cpp unit.cpp - -module_base := inline -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ExH/Inline/inline.cpp b/contrib/utility/Test/ExH/Inline/inline.cpp deleted file mode 100644 index 7700728932f..00000000000 --- a/contrib/utility/Test/ExH/Inline/inline.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : Test/ExH/Inline/inline.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -// -// This is a link-time test to detect any problems with inline functions -// (notably missing inline specifier). -// - -#include "Utility/ExH/ExH.hpp" - -int -main () -{ -} - -//$Id$ diff --git a/contrib/utility/Test/ExH/Inline/unit.cpp b/contrib/utility/Test/ExH/Inline/unit.cpp deleted file mode 100644 index 8a57af7d759..00000000000 --- a/contrib/utility/Test/ExH/Inline/unit.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// file : Test/ExH/Inline/unit.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ExH/ExH.hpp" - -//$Id$ diff --git a/contrib/utility/Test/ExH/Logic/DescriptiveException/Makefile b/contrib/utility/Test/ExH/Logic/DescriptiveException/Makefile deleted file mode 100644 index 6ca8e6029ee..00000000000 --- a/contrib/utility/Test/ExH/Logic/DescriptiveException/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ExH/Logic/DescriptiveException/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := descriptive_exception.cpp - -module_base := descriptive_exception -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ExH/Logic/DescriptiveException/descriptive_exception.cpp b/contrib/utility/Test/ExH/Logic/DescriptiveException/descriptive_exception.cpp deleted file mode 100644 index 7c3246df491..00000000000 --- a/contrib/utility/Test/ExH/Logic/DescriptiveException/descriptive_exception.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// file : Test/ExH/Logic/DescriptiveException/descriptive_exception.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ExH/Logic/DescriptiveException.hpp" - -#include <string> - -using std::string; -using namespace Utility::ExH::Logic; - -struct E {}; - -void postcondition (bool p) throw (E) -{ - if (!p) throw E (); -} - -struct StringHolder -{ - StringHolder (char const* s) - : str_ (s) - { - } - - operator std::string () const - { - return str_; - } - - string str_; -}; - -int -main () -{ - try - { - // DescriptiveException (char const*) - // - { - DescriptiveException a ("hello"); - - postcondition (a.what () == string ("hello")); - } - - // DescriptiveException (std::string const&) - // - { - DescriptiveException a (string ("hello")); - - postcondition (a.what () == string ("hello")); - } - - - // DescriptiveException (T const&) - // - { - StringHolder a ("hello"); - - DescriptiveException b (a); - - postcondition (b.what () == string ("hello")); - } - - // DescriptiveException (DescriptiveException const&) - // - { - DescriptiveException a ("hello"); - DescriptiveException b (a); - - postcondition (b.what () == string ("hello")); - } - - // ~DescriptiveException - // - - // operator= (DescriptiveException const&) - // - { - DescriptiveException a ("hello"); - DescriptiveException b ("foo"); - b = a; - - postcondition (b.what () == string ("hello")); - } - - // DescriptiveException () - // - - // init (char const*) - // - - // what () - // - { - DescriptiveException a ("hello"); - - postcondition (a.what () == string ("hello")); - } - } - catch (...) - { - return -1; - } -} -//$Id$ diff --git a/contrib/utility/Test/ExH/Logic/Makefile b/contrib/utility/Test/ExH/Logic/Makefile deleted file mode 100644 index 042b3a172a4..00000000000 --- a/contrib/utility/Test/ExH/Logic/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# file : Test/ExH/Logic/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Recursion.pre.rules) - -target_makefile_list := -target_directory_list := DescriptiveException - -$(call include, $(root)/BuildRules/Recursion.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ExH/Makefile b/contrib/utility/Test/ExH/Makefile deleted file mode 100644 index 161884a439c..00000000000 --- a/contrib/utility/Test/ExH/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# file : Test/ExH/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Recursion.pre.rules) - -target_makefile_list := -target_directory_list := Compound Converter Inline Logic System - -$(call include, $(root)/BuildRules/Recursion.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ExH/System/DescriptiveException/Makefile b/contrib/utility/Test/ExH/System/DescriptiveException/Makefile deleted file mode 100644 index 9fd89d86ade..00000000000 --- a/contrib/utility/Test/ExH/System/DescriptiveException/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ExH/System/DescriptiveException/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := descriptive_exception.cpp - -module_base := descriptive_exception -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ExH/System/DescriptiveException/descriptive_exception.cpp b/contrib/utility/Test/ExH/System/DescriptiveException/descriptive_exception.cpp deleted file mode 100644 index 4cd14da8627..00000000000 --- a/contrib/utility/Test/ExH/System/DescriptiveException/descriptive_exception.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// file : Test/ExH/System/DescriptiveException/descriptive_exception.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ExH/System/DescriptiveException.hpp" - -#include <string> - -using std::string; -using namespace Utility::ExH::System; - -struct E {}; - -void postcondition (bool p) throw (E) -{ - if (!p) throw E (); -} - -struct StringHolder -{ - StringHolder (char const* s) - : str_ (s) - { - } - - operator std::string () const - { - return str_; - } - - string str_; -}; - -int -main () -{ - try - { - // DescriptiveException (char const*) - // - { - DescriptiveException a ("hello"); - - postcondition (a.what () == string ("hello")); - } - - // DescriptiveException (std::string const&) - // - { - DescriptiveException a (string ("hello")); - - postcondition (a.what () == string ("hello")); - } - - // DescriptiveException (T const&) - // - { - StringHolder a ("hello"); - - DescriptiveException b (a); - - postcondition (b.what () == string ("hello")); - } - - // DescriptiveException (DescriptiveException const&) - // - { - DescriptiveException a ("hello"); - DescriptiveException b (a); - - postcondition (b.what () == string ("hello")); - } - - // ~DescriptiveException - // - - // operator= (DescriptiveException const&) - // - { - DescriptiveException a ("hello"); - DescriptiveException b ("foo"); - b = a; - - postcondition (b.what () == string ("hello")); - } - - // DescriptiveException () - // - - // init (char const*) - // - - // what () - // - { - DescriptiveException a ("hello"); - - postcondition (a.what () == string ("hello")); - } - } - catch (...) - { - return -1; - } -} -//$Id$ diff --git a/contrib/utility/Test/ExH/System/Makefile b/contrib/utility/Test/ExH/System/Makefile deleted file mode 100644 index 2ffea12a6ed..00000000000 --- a/contrib/utility/Test/ExH/System/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# file : Test/ExH/System/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Recursion.pre.rules) - -target_makefile_list := -target_directory_list := DescriptiveException - -$(call include, $(root)/BuildRules/Recursion.post.rules) -# $Id$ diff --git a/contrib/utility/Test/Introspection/Inline/Makefile b/contrib/utility/Test/Introspection/Inline/Makefile deleted file mode 100644 index fb7a72c1e2f..00000000000 --- a/contrib/utility/Test/Introspection/Inline/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/Introspection/Inline/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := inline.cpp unit.cpp - -module_base := inline -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/Introspection/Inline/inline.cpp b/contrib/utility/Test/Introspection/Inline/inline.cpp deleted file mode 100644 index 99ff8ff590f..00000000000 --- a/contrib/utility/Test/Introspection/Inline/inline.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : Test/Introspection/Inline/inline.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -// -// This is a link-time test to detect any problems with inline functions -// (notably missing inline specifier). -// - -#include "Utility/Introspection/Introspection.hpp" - -int -main () -{ -} - -//$Id$ diff --git a/contrib/utility/Test/Introspection/Inline/unit.cpp b/contrib/utility/Test/Introspection/Inline/unit.cpp deleted file mode 100644 index a5fe6f95b65..00000000000 --- a/contrib/utility/Test/Introspection/Inline/unit.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// file : Test/Introspection/Inline/unit.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/Introspection/Introspection.hpp" - -//$Id$ diff --git a/contrib/utility/Test/Introspection/Makefile b/contrib/utility/Test/Introspection/Makefile deleted file mode 100644 index 8ed18da5c41..00000000000 --- a/contrib/utility/Test/Introspection/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# file : Test/Introspection/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Recursion.pre.rules) - -target_makefile_list := -target_directory_list := Inline - -$(call include, $(root)/BuildRules/Recursion.post.rules) -# $Id$ diff --git a/contrib/utility/Test/Makefile b/contrib/utility/Test/Makefile deleted file mode 100644 index 4ac5c3530b8..00000000000 --- a/contrib/utility/Test/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# file : Test/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := .. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Recursion.pre.rules) - -target_makefile_list := -target_directory_list := ExH Introspection ReferenceCounting Synch - -ReferenceCounting : ExH Synch - -$(call include, $(root)/BuildRules/Recursion.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ReferenceCounting/DefaultImpl/Makefile b/contrib/utility/Test/ReferenceCounting/DefaultImpl/Makefile deleted file mode 100644 index c3f89dc7a9c..00000000000 --- a/contrib/utility/Test/ReferenceCounting/DefaultImpl/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ReferenceCounting/DefaultImpl/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := default_impl.cpp - -module_base := default_impl -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ReferenceCounting/DefaultImpl/default_impl.cpp b/contrib/utility/Test/ReferenceCounting/DefaultImpl/default_impl.cpp deleted file mode 100644 index 971751b6677..00000000000 --- a/contrib/utility/Test/ReferenceCounting/DefaultImpl/default_impl.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// file : Test/ReferenceCounting/DefaultImpl/default_impl.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ReferenceCounting/DefaultImpl.hpp" - -using namespace Utility::ReferenceCounting; - -struct Base : public virtual Interface -{ - virtual - ~Base () throw () - { - } -}; - - -class Impl : public virtual Base, - public virtual DefaultImpl <> -{ -public: - Impl (bool& destroyed) - : dummy_ (false), - destroyed_ (destroyed) - { - } - - Impl () - : dummy_ (false), - destroyed_ (dummy_) - { - } - - virtual - ~Impl () throw () - { - destroyed_ = true; - } - -public: - void - lock () - { - lock_i (); - } - -private: - bool dummy_; - bool& destroyed_; -}; - -struct E {}; - -void postcondition (bool p) throw (E) -{ - if (!p) throw E (); -} - -int main () -{ - try - { - // DefaultImpl - // - { - Impl* a (new Impl); - - postcondition (a->refcount_value () == 1); - - a->remove_ref (); - } - - // ~DefaultImpl - // - { - Impl* a (new Impl); - a->remove_ref (); - } - - // add_ref - // - { - Impl* a (new Impl); - - a->add_ref (); - - postcondition (a->refcount_value () == 2); - - a->remove_ref (); - a->remove_ref (); - } - - - // remove_ref - // - { - bool destroyed (false); - Impl* a (new Impl (destroyed)); - - a->add_ref (); - a->remove_ref (); - - postcondition (destroyed == false && a->refcount_value () == 1); - - a->remove_ref (); - - postcondition (destroyed == true); - } - - - // refcount_value - // - { - Impl* a (new Impl); - - postcondition (a->refcount_value () == 1); - } - - // lock_i - // - { - Impl* a (new Impl); - a->lock (); - } - } - catch (...) - { - return -1; - } -} -//$Id$ diff --git a/contrib/utility/Test/ReferenceCounting/Inline/Makefile b/contrib/utility/Test/ReferenceCounting/Inline/Makefile deleted file mode 100644 index 5ae9a840c8d..00000000000 --- a/contrib/utility/Test/ReferenceCounting/Inline/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ReferenceCounting/Inline/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := inline.cpp unit.cpp - -module_base := inline -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ReferenceCounting/Inline/inline.cpp b/contrib/utility/Test/ReferenceCounting/Inline/inline.cpp deleted file mode 100644 index 0ff2dfa9986..00000000000 --- a/contrib/utility/Test/ReferenceCounting/Inline/inline.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// file : Test/ReferenceCounting/Inline/inline.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -// -// This is a link-time test to detect any problems with inline functions -// (notably missing inline specifier). -// - -#include "Utility/ReferenceCounting/ReferenceCounting.hpp" - -int main () -{ -} -//$Id$ diff --git a/contrib/utility/Test/ReferenceCounting/Inline/unit.cpp b/contrib/utility/Test/ReferenceCounting/Inline/unit.cpp deleted file mode 100644 index 31dbfdb8708..00000000000 --- a/contrib/utility/Test/ReferenceCounting/Inline/unit.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// file : Test/ReferenceCounting/Inline/unit.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ReferenceCounting/ReferenceCounting.hpp" - -//$Id$ diff --git a/contrib/utility/Test/ReferenceCounting/Interface/Makefile b/contrib/utility/Test/ReferenceCounting/Interface/Makefile deleted file mode 100644 index 4327774eb54..00000000000 --- a/contrib/utility/Test/ReferenceCounting/Interface/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ReferenceCounting/Interface/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := interface.cpp - -module_base := interface -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ReferenceCounting/Interface/interface.cpp b/contrib/utility/Test/ReferenceCounting/Interface/interface.cpp deleted file mode 100644 index a9cb4d55824..00000000000 --- a/contrib/utility/Test/ReferenceCounting/Interface/interface.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// file : Test/ReferenceCounting/Interface/interface.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ReferenceCounting/Interface.hpp" - -using namespace Utility::ReferenceCounting; - -struct Obj : public virtual Interface -{ - Obj () - : ref_count_ (1) - { - } - - virtual - ~Obj () throw () - { - } - -public: - virtual void - add_ref () const throw () - { - add_ref_i (); - } - - - virtual void - remove_ref () const throw () - { - if (remove_ref_i ()) delete this; - } - - virtual count_t - refcount_value () const throw () - { - return refcount_value_i (); - } - -protected: - virtual void - add_ref_i () const throw () - { - ++ref_count_; - } - - - virtual bool - remove_ref_i () const throw () - { - return --ref_count_ == 0; - } - - virtual count_t - refcount_value_i () const throw () - { - return ref_count_; - } - -private: - mutable count_t ref_count_; -}; - - -struct E {}; - -void postcondition (bool p) throw (E) -{ - if (!p) throw E (); -} - -int main () -{ - try - { - // add_ref - // - { - Obj* a (new Obj); - - Obj* b (add_ref (a)); - - postcondition (a == b && a->refcount_value () == 2); - - a->remove_ref (); - b->remove_ref (); - } - - { - Obj* a (0); - - Obj* b (add_ref (a)); - - postcondition (b == 0); - } - } - catch (...) - { - return -1; - } -} -//$Id$ diff --git a/contrib/utility/Test/ReferenceCounting/Makefile b/contrib/utility/Test/ReferenceCounting/Makefile deleted file mode 100644 index 1f7d981c87f..00000000000 --- a/contrib/utility/Test/ReferenceCounting/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# file : Test/ReferenceCounting/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Recursion.pre.rules) - -target_makefile_list := -target_directory_list := Interface DefaultImpl Inline SmartPtr StrictPtr - -$(call include, $(root)/BuildRules/Recursion.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ReferenceCounting/SmartPtr/Makefile b/contrib/utility/Test/ReferenceCounting/SmartPtr/Makefile deleted file mode 100644 index 7bbc0456949..00000000000 --- a/contrib/utility/Test/ReferenceCounting/SmartPtr/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ReferenceCounting/SmartPtr/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := smart_ptr.cpp - -module_base := smart_ptr -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ReferenceCounting/SmartPtr/smart_ptr.cpp b/contrib/utility/Test/ReferenceCounting/SmartPtr/smart_ptr.cpp deleted file mode 100644 index 67f4442a359..00000000000 --- a/contrib/utility/Test/ReferenceCounting/SmartPtr/smart_ptr.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// file : Test/ReferenceCounting/SmartPtr/smart_ptr.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ReferenceCounting/SmartPtr.hpp" -#include "Utility/ReferenceCounting/DefaultImpl.hpp" - -using namespace Utility::ReferenceCounting; - -struct Base : public virtual Interface -{ - virtual - ~Base () throw () - { - } -}; - -typedef -SmartPtr<Base> -BasePtr; - -class Impl : public virtual Base, - public virtual DefaultImpl <> -{ -public: - Impl (bool& destroyed) - : dummy_ (false), - destroyed_ (destroyed) - { - } - - Impl () - : dummy_ (false), - destroyed_ (dummy_) - { - } - - virtual - ~Impl () throw () - { - destroyed_ = true; - } - -private: - bool dummy_; - bool& destroyed_; -}; - -typedef -SmartPtr<Impl> -ImplPtr; - -struct E {}; - -void postcondition (bool p) throw (E) -{ - if (!p) throw E (); -} - -int main () -{ - try - { - // SmartPtr () - // - { - BasePtr a; - - postcondition (a.in () == 0); - } - - // SmartPtr (Type*) - // - { - Impl* a (new Impl); - ImplPtr b (a); - - postcondition (b.in () == a && a->refcount_value () == 1); - } - - // SmartPtr (SmartPtr<Type> const&) - // - { - ImplPtr a (new Impl); - ImplPtr b (a); - - postcondition (a.in () == b.in () && a->refcount_value () == 2); - } - - // SmartPtr (SmartPtr<Other> const&) - // - { - ImplPtr a (new Impl); - BasePtr b (a); - - postcondition (b.in () == static_cast<Base*>(a.in ()) && - b->refcount_value () == 2); - } - - // ~SmartPtr - // - { - bool destroyed (false); - { - ImplPtr a (new Impl (destroyed)); - } - - postcondition (destroyed == true); - } - - // operator= (Type* ptr) - // - { - Impl* a (new Impl); - ImplPtr b; - b = a; - - postcondition (b.in () == a && a->refcount_value () == 1); - } - - // operator= (SmartPtr<Type> const&) - // - { - ImplPtr a (new Impl); - ImplPtr b; - b = a; - - postcondition (b.in () == a.in () && a->refcount_value () == 2); - } - - // operator= (SmartPtr<Other> const&) - // - { - ImplPtr a (new Impl); - BasePtr b; - b = a; - - postcondition (b.in () == static_cast<Base*>(a.in ()) && - b->refcount_value () == 2); - } - - // operator Type* - // - { - Impl* a (new Impl); - ImplPtr b (a); - Impl* c (b); - - postcondition (a == c); - } - - // operator-> - // - { - Impl* a (new Impl); - ImplPtr b (a); - Impl* c (b.operator-> ()); - - postcondition (a == c); - } - - // in - // - { - Impl* a (new Impl); - ImplPtr b (a); - Impl* c (b.in ()); - - postcondition (a == c); - } - - // retn - // - { - Impl* a (new Impl); - ImplPtr b (a); - Impl* c (b.retn ()); - - postcondition (a == c); - - b = a; // give ownership back - } - - // add_ref - // - { - ImplPtr a (new Impl); - ImplPtr b (add_ref (a)); - - postcondition (a.in () == b.in () && b->refcount_value () == 2); - } - - // smart_cast - // - { - BasePtr a (new Impl); - ImplPtr b (smart_cast<Impl>(a)); - - postcondition (b != 0 && b->refcount_value () == 2); - } - - // acquire - // - { - bool destroyed (false); - Base::count_t c (0); - { - c = acquire (new Impl (destroyed))->refcount_value (); - } - - postcondition (c == 1 && destroyed == true); - } - } - catch (...) - { - return -1; - } -} -//$Id$ diff --git a/contrib/utility/Test/ReferenceCounting/StrictPtr/Makefile b/contrib/utility/Test/ReferenceCounting/StrictPtr/Makefile deleted file mode 100644 index e078ef688fe..00000000000 --- a/contrib/utility/Test/ReferenceCounting/StrictPtr/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/ReferenceCounting/StrictPtr/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := strict_ptr.cpp - -module_base := strict_ptr -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/ReferenceCounting/StrictPtr/strict_ptr.cpp b/contrib/utility/Test/ReferenceCounting/StrictPtr/strict_ptr.cpp deleted file mode 100644 index 1fcee9448ea..00000000000 --- a/contrib/utility/Test/ReferenceCounting/StrictPtr/strict_ptr.cpp +++ /dev/null @@ -1,218 +0,0 @@ -// file : Test/ReferenceCounting/StrictPtr/strict_ptr.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/ReferenceCounting/StrictPtr.hpp" -#include "Utility/ReferenceCounting/DefaultImpl.hpp" - -using namespace Utility::ReferenceCounting; - -struct Base : public virtual Interface -{ - virtual - ~Base () throw () - { - } -}; - -typedef -StrictPtr<Base> -BasePtr; - -class Impl : public virtual Base, - public virtual DefaultImpl <> -{ -public: - Impl (bool& destroyed) - : dummy_ (false), - destroyed_ (destroyed) - { - } - - Impl () - : dummy_ (false), - destroyed_ (dummy_) - { - } - - virtual - ~Impl () throw () - { - destroyed_ = true; - } - -private: - bool dummy_; - bool& destroyed_; -}; - -typedef -StrictPtr<Impl> -ImplPtr; - -struct E {}; - -void postcondition (bool p) throw (E) -{ - if (!p) throw E (); -} - -int main () -{ - try - { - // StrictPtr () - // - { - BasePtr a; - - postcondition (a.in () == 0); - } - - // StrictPtr (Type*) - // - { - Impl* a (new Impl); - ImplPtr b (a); - - postcondition (b.in () == a && a->refcount_value () == 1); - } - - // StrictPtr (StrictPtr<Type> const&) - // - { - ImplPtr a (new Impl); - ImplPtr b (a); - - postcondition (a.in () == b.in () && a->refcount_value () == 2); - } - - // StrictPtr (StrictPtr<Other> const&) - // - { - ImplPtr a (new Impl); - BasePtr b (a); - - postcondition (b.in () == static_cast<Base*>(a.in ()) && - b->refcount_value () == 2); - } - - // ~StrictPtr - // - { - bool destroyed (false); - { - ImplPtr a (new Impl (destroyed)); - } - - postcondition (destroyed == true); - } - - // operator= (Type* ptr) - // - { - Impl* a (new Impl); - ImplPtr b; - b = a; - - postcondition (b.in () == a && a->refcount_value () == 1); - } - - // operator= (StrictPtr<Type> const&) - // - { - ImplPtr a (new Impl); - ImplPtr b; - b = a; - - postcondition (b.in () == a.in () && a->refcount_value () == 2); - } - - // operator= (StrictPtr<Other> const&) - // - { - ImplPtr a (new Impl); - BasePtr b; - b = a; - - postcondition (b.in () == static_cast<Base*>(a.in ()) && - b->refcount_value () == 2); - } - - // operator== - // - { - Impl* a (new Impl); - ImplPtr b (a); - bool r (b.in () == a); - - postcondition (r == true); - } - - // operator!= - // - { - Impl* a (new Impl); - ImplPtr b (a); - bool r (b.in () != a); - - postcondition (r == false); - } - - // operator-> - // - { - Impl* a (new Impl); - ImplPtr b (a); - Impl* c (b.operator-> ()); - - postcondition (a == c); - } - - // in - // - { - Impl* a (new Impl); - ImplPtr b (a); - Impl* c (b.in ()); - - postcondition (a == c); - } - - // retn - // - { - Impl* a (new Impl); - ImplPtr b (a); - Impl* c (b.retn ()); - - postcondition (a == c); - - b = a; // give ownership back - } - - // add_ref - // - { - ImplPtr a (new Impl); - ImplPtr b (add_ref (a)); - - postcondition (a.in () == b.in () && b->refcount_value () == 2); - } - - // strict_cast - // - { - BasePtr a (new Impl); - ImplPtr b (strict_cast<Impl>(a)); - - postcondition (b != 0 && b->refcount_value () == 2); - } - } - catch (...) - { - return -1; - } -} -//$Id$ diff --git a/contrib/utility/Test/Synch/Inline/Makefile b/contrib/utility/Test/Synch/Inline/Makefile deleted file mode 100644 index 2101cc3ee8c..00000000000 --- a/contrib/utility/Test/Synch/Inline/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# file : Test/Synch/Inline/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Executable.pre.rules) - - -cxx_translation_units := inline.cpp unit.cpp - -module_base := inline -module_prefix := -module_suffix := - - -CXX_PREPROCESS_FLAGS += -I $(root) - - -$(call include, $(root)/BuildRules/Executable.post.rules) -# $Id$ diff --git a/contrib/utility/Test/Synch/Inline/inline.cpp b/contrib/utility/Test/Synch/Inline/inline.cpp deleted file mode 100644 index 0b2db8a7d57..00000000000 --- a/contrib/utility/Test/Synch/Inline/inline.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : Test/Synch/Inline/inline.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -// -// This is a link-time test to detect any problems with inline functions -// (notably missing inline specifier). -// - -#include "Utility/Synch/Policy/Null.hpp" - -int -main () -{ -} - -//$Id$ diff --git a/contrib/utility/Test/Synch/Inline/unit.cpp b/contrib/utility/Test/Synch/Inline/unit.cpp deleted file mode 100644 index b570c97ae5e..00000000000 --- a/contrib/utility/Test/Synch/Inline/unit.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// file : Test/Synch/Inline/unit.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// copyright : Copyright (c) 2002-2003 Boris Kolpackov -// license : http://kolpackov.net/license.html - -#include "Utility/Synch/Policy/Null.hpp" - -//$Id$ diff --git a/contrib/utility/Test/Synch/Makefile b/contrib/utility/Test/Synch/Makefile deleted file mode 100644 index c4b730ca6a5..00000000000 --- a/contrib/utility/Test/Synch/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# file : Test/Synch/Makefile -# author : Boris Kolpackov <boris@kolpackov.net> -# copyright : Copyright (c) 2002-2003 Boris Kolpackov -# license : http://kolpackov.net/license.html - -root := ../.. - -include $(root)/BuildRules/Bootstrap.rules - -$(call include, $(root)/BuildRules/Recursion.pre.rules) - -target_makefile_list := -target_directory_list := Inline - -$(call include, $(root)/BuildRules/Recursion.post.rules) -# $Id$ |