|
Boost-Commit : |
From: hervebronnimann_at_[hidden]
Date: 2007-06-29 00:57:02
Author: hervebronnimann
Date: 2007-06-29 00:57:00 EDT (Fri, 29 Jun 2007)
New Revision: 7310
URL: http://svn.boost.org/trac/boost/changeset/7310
Log:
Add the test driver of hds_concept_archetype (compiles and tests correctly).
Add Makefile, ad corrections to the archetype.
Added:
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/Makefile.dbg_exc_mt
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/boost/
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/boost/hdstl (contents, props changed)
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.t.cpp
Text files modified:
sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.hpp | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/Makefile.dbg_exc_mt
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/Makefile.dbg_exc_mt 2007-06-29 00:57:00 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,99 @@
+CXX=g++
+CXXFLAGS=-pedantic -W -Wall -I${BOOST} -I.
+
+LD=g++
+
+TARGET=dbg_exc_mt
+
+PACKAGE_OBJECTS=backward_hds_concept_archetype.o \
+ bidirectional_hds_concept_archetype.o \
+ facet_hds_concept_archetype.o \
+ forward_hds_concept_archetype.o \
+ hds_concept_archetype.o \
+ mutable_forward_hds_concept_archetype.o \
+ mutable_hds_concept_archetype.o \
+ vertex_hds_concept_archetype.o
+
+PACKAGE_LIBRARY=libhds_archetypes.a
+
+TEST_DRIVERS=backward_hds_concept_archetype.t \
+ bidirectional_hds_concept_archetype.t \
+ facet_hds_concept_archetype.t \
+ forward_hds_concept_archetype.t \
+ hds_concept_archetype.t \
+ mutable_forward_hds_concept_archetype.t \
+ mutable_hds_concept_archetype.t \
+ vertex_hds_concept_archetype.t
+
+.SUFFIXES:
+.SUFFIXES: ${TARGET}.o .o .cpp .hpp
+
+all: package_library test
+
+
+### BUILDING PACKAGE LIBRARY AND DEPENDENCIES
+
+package_library: ${PACKAGE_OBJECTS}
+ ar -rv ${PACKAGE_LIBRARY} ${PACKAGE_OBJECTS}
+
+%.o: %.cpp %.h
+ ${CXX} ${CXXFLAGS} ${CXXINCLUDES} -c -o $*.o $<
+
+backward_hds_concept.o: hds_concept.hpp
+bidirectional_hds_concept.o: forward_hds_concept.hpp \
+ backward_hds_concept.hpp hds_concept.hpp
+facet_hds_concept.o: hds_concept.hpp
+forward_hds_concept.o: hds_concept.hpp
+hds_concept.o:
+mutable_forward_hds_concept.o: forward_hds_concept.hpp \
+ hds_concept.hpp mutable_hds_concept.hpp
+mutable_hds_concept.o: hds_concept.hpp
+vertex_hds_concept.o: hds_concept.hpp
+
+
+### BUILDING TEST DRIVERS AND DEPENDENCIES OF TEST DRIVER
+
+test: ${TEST_DRIVERS}
+ for file in ${TEST_DRIVERS}; do echo "******* TESTING $$file *********"; ./$$file; done
+
+%.t: %.t.o %.o
+ ${LD} ${LDFLAGS} -o $*.t $^
+
+backward_hds_concept_archetype.t.o: hds_concept.hpp
+bidirectional_hds_concept_archetype.t.o: forward_hds_concept.hpp \
+ backward_hds_concept.hpp hds_concept.hpp
+facet_hds_concept_archetype.t.o: hds_concept.hpp
+forward_hds_concept_archetype.t.o: hds_concept.hpp
+hds_concept_archetype.t.o:
+mutable_forward_hds_concept_archetype.t.o: forward_hds_concept.hpp \
+ hds_concept.hpp mutable_hds_concept.hpp
+mutable_hds_concept_archetype.t.o: hds_concept.hpp
+vertex_hds_concept_archetype.t.o: hds_concept.hpp
+
+%.t.o: %.t.cpp %.h
+ ${CXX} ${CXXFLAGS} ${CXXINCLUDES} -c -o $*.t.o $<
+
+backward_hds_concept.t: hds_concept_archetype.o
+bidirectional_hds_concept.t: forward_hds_concept_archetype.o \
+ backward_hds_concept_archetype.o hds_concept.o
+facet_hds_concept.t.o: hds_concept_archetype.o
+forward_hds_concept.t.o: hds_concept_archetype.o
+hds_concept.t.o:
+mutable_forward_hds_concept.t.o: forward_hds_concept_archetype.o \
+ hds_concept_archetype.o mutable_hds_concept.o
+mutable_hds_concept.t.o: hds_concept_archetype.o
+vertex_hds_concept.t.o: hds_concept_archetype.o
+
+
+## UTILITIES
+
+clean: testclean
+
+testclean:
+ - rm *.t.o
+ - rm *.t
+
+realclean:
+ - rm *.o
+ - rm ${PACKAGE_LIBRARY}
+
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/boost/hdstl
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/boost/hdstl 2007-06-29 00:57:00 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1 @@
+link ../../
\ No newline at end of file
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.cpp 2007-06-29 00:57:00 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,4 @@
+// hds_concept_archetype.cpp -*- C++ -*-
+
+#include <boost/hdstl/hds_archetypes/hds_concept_archetype.hpp>
+
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.hpp 2007-06-29 00:57:00 EDT (Fri, 29 Jun 2007)
@@ -31,6 +31,7 @@
#ifndef BOOST_HDSTL_HDS_CONCEPT_ARCHETYPE_HPP
#define BOOST_HDSTL_HDS_CONCEPT_ARCHETYPE_HPP
+#include <boost/hdstl/hds_traits.hpp>
#include <boost/concept_archetype.hpp>
namespace boost {
@@ -49,6 +50,10 @@
boost::equality_comparable_archetype<
boost::assignable_archetype<> > > > halfedge_descriptor;
// Halfedge descriptor type for the 'HDSConcept' archetype.
+
+ enum { supports_facets = false };
+ enum { supports_vertices = false };
+
};
class HDSConcept_archetype {
@@ -59,7 +64,7 @@
// 'HDS' concept.
// PRIVATE TYPES
- typedef typename hds_traits<HDSConcept_archetype
+ typedef hds_traits<HDSConcept_archetype
>::halfedge_descriptor halfedge_descriptor;
public:
@@ -69,11 +74,13 @@
};
// MANIPULATORS
-typename hds_traits<HDSConcept_archetype>::halfedge_descriptor
-HDSConcept_archetype::opposite(ForwardHDSConcept_archetype const& hds,
- halfedge_descriptor h)
+inline
+hds_traits<HDSConcept_archetype>::halfedge_descriptor
+opposite(hds_traits<HDSConcept_archetype>::halfedge_descriptor h,
+ const HDSConcept_archetype& hds)
{
- return halfedge_descriptor();
+ (void)hds; // eliminate unused variable warning
+ return h;
}
} // end namespace hdstl
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.t.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/hds_archetypes/hds_concept_archetype.t.cpp 2007-06-29 00:57:00 EDT (Fri, 29 Jun 2007)
@@ -0,0 +1,40 @@
+//hds_concept_archetype.t.cpp -*- C++ -*-
+//
+//@OVERVIEW: The component under test is a concept-archetype class. We
+// proceed with the standard test plan for such a class.
+//
+//@TEST_PLAN: Verify (using the Boost.ConceptCheck library macros) that the
+// class 'hds_concept_archetype' satisfies all the concept requirements of the
+// 'HDS' concept.
+
+#include <boost/hdstl/hds_archetypes/hds_concept_archetype.hpp>
+#include <boost/hdstl/hds_concepts/hds_concept.hpp>
+#include <boost/test/minimal.hpp>
+#include <boost/concept_check.hpp>
+
+// ===========================================================================
+// BOOST TEST APPARATUS
+// ===========================================================================
+
+template <class HDS>
+struct class_concept_requirements
+{
+ BOOST_CLASS_REQUIRE(HDS, boost::hdstl::concepts, HDSConcept);
+};
+
+template <class HDS>
+bool concept_requirements()
+{
+ using namespace boost;
+ function_requires<hdstl::concepts::HDSConcept<HDS> >();
+ class_concept_requirements<HDS>(); // force instantiation
+ BOOST_CHECK(false == hdstl::hds_traits<HDS>::supports_vertices);
+ BOOST_CHECK(false == hdstl::hds_traits<HDS>::supports_facets);
+ return true;
+}
+
+int test_main(int, char **)
+{
+ BOOST_CHECK(( concept_requirements<boost::hdstl::HDSConcept_archetype>() ));
+ return 0;
+}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk