From: Braden M. <br...@us...> - 2007-10-06 09:29:12
|
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22593/tests Modified Files: Tag: OpenVRML-0_16-BRANCH Makefile.am browser.cpp color.cpp image.cpp mat4f.cpp node_interface_set.cpp node_metatype_id.cpp rotation.cpp Log Message: Test fixes for Boost 1.34.1. Index: node_interface_set.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/node_interface_set.cpp,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** node_interface_set.cpp 11 Jul 2007 07:57:46 -0000 1.3.2.1 --- node_interface_set.cpp 6 Oct 2007 09:29:13 -0000 1.3.2.2 *************** *** 1,4 **** ! # define BOOST_TEST_DYN_LINK # define BOOST_TEST_MAIN # include <boost/test/unit_test.hpp> # include <openvrml/node.h> --- 1,24 ---- ! // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- ! // ! // Copyright 2007 Braden McDaniel ! // ! // 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 2 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, write to the Free Software ! // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // ! # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE node_interface_set + # include <boost/test/unit_test.hpp> # include <openvrml/node.h> *************** *** 13,17 **** using namespace openvrml; ! void insert_eventin() { node_interface_set interfaces; --- 33,37 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(insert_eventin) { node_interface_set interfaces; *************** *** 22,26 **** } ! void insert_exactly_conflicting_eventin() { node_interface_set interfaces; --- 42,46 ---- } ! BOOST_AUTO_TEST_CASE(insert_exactly_conflicting_eventin) { node_interface_set interfaces; *************** *** 36,40 **** } ! void insert_conflicting_exposedfield() { node_interface_set interfaces; --- 56,60 ---- } ! BOOST_AUTO_TEST_CASE(insert_conflicting_exposedfield) { node_interface_set interfaces; *************** *** 49,53 **** } ! void insert_eventout() { node_interface_set interfaces; --- 69,73 ---- } ! BOOST_AUTO_TEST_CASE(insert_eventout) { node_interface_set interfaces; *************** *** 62,66 **** } ! void insert_exactly_conflicting_eventout() { node_interface_set interfaces; --- 82,86 ---- } ! BOOST_AUTO_TEST_CASE(insert_exactly_conflicting_eventout) { node_interface_set interfaces; *************** *** 75,79 **** } ! void insert_field() { node_interface_set interfaces; --- 95,99 ---- } ! BOOST_AUTO_TEST_CASE(insert_field) { node_interface_set interfaces; *************** *** 92,96 **** } ! void insert_exposedfield() { node_interface_set interfaces; --- 112,116 ---- } ! BOOST_AUTO_TEST_CASE(insert_exposedfield) { node_interface_set interfaces; *************** *** 113,117 **** } ! void find_exposedfield_matching_eventin() { node_interface_set interfaces; --- 133,137 ---- } ! BOOST_AUTO_TEST_CASE(find_exposedfield_matching_eventin) { node_interface_set interfaces; *************** *** 125,142 **** BOOST_REQUIRE(interface == *pos); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = - BOOST_TEST_SUITE("node_interface_set"); - suite->add(BOOST_TEST_CASE(&insert_eventin)); - suite->add(BOOST_TEST_CASE(&insert_exactly_conflicting_eventin)); - suite->add(BOOST_TEST_CASE(&insert_conflicting_exposedfield)); - suite->add(BOOST_TEST_CASE(&insert_eventout)); - suite->add(BOOST_TEST_CASE(&insert_exactly_conflicting_eventout)); - suite->add(BOOST_TEST_CASE(&insert_field)); - suite->add(BOOST_TEST_CASE(&insert_exposedfield)); - suite->add(BOOST_TEST_CASE(&find_exposedfield_matching_eventin)); - return suite; - } --- 145,146 ---- Index: rotation.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/rotation.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** rotation.cpp 23 Aug 2006 06:49:49 -0000 1.1.2.2 --- rotation.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE rotation + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_extraction_fail_on_nonnormalized_axis() { string rotation_str = "2.0 2.0 0.0 0.0"; --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_extraction_fail_on_nonnormalized_axis) { string rotation_str = "2.0 2.0 0.0 0.0"; *************** *** 33,42 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("rotation"); - suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_nonnormalized_axis)); - return suite; - } --- 36,37 ---- Index: color.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/color.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** color.cpp 23 Aug 2006 06:49:49 -0000 1.1.2.2 --- color.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE color + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_extraction_without_commas() { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_extraction_without_commas) { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; *************** *** 36,40 **** } ! void stream_extraction_with_commas() { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; --- 39,43 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_with_commas) { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; *************** *** 47,51 **** } ! void stream_extraction_fail_on_invalid_intensity() { color c; --- 50,54 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_fail_on_invalid_intensity) { color c; *************** *** 55,66 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("color"); - suite->add(BOOST_TEST_CASE(&stream_extraction_without_commas)); - suite->add(BOOST_TEST_CASE(&stream_extraction_with_commas)); - suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_invalid_intensity)); - return suite; - } --- 58,59 ---- Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/browser.cpp,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** browser.cpp 28 Jul 2006 07:11:10 -0000 1.7 --- browser.cpp 6 Oct 2007 09:29:12 -0000 1.7.2.1 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE browser + # include <fstream> # include <sstream> *************** *** 31,35 **** using namespace boost::multi_index::detail; // for scope_guard ! void create_vrml_from_stream() { test_browser b; --- 34,38 ---- using namespace boost::multi_index::detail; // for scope_guard ! BOOST_AUTO_TEST_CASE(create_vrml_from_stream) { test_browser b; *************** *** 46,50 **** } ! void create_vrml_from_stream_with_externproto() { { --- 49,53 ---- } ! BOOST_AUTO_TEST_CASE(create_vrml_from_stream_with_externproto) { { *************** *** 54,58 **** } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); --- 57,61 ---- } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove<boost::filesystem::path>, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); *************** *** 71,75 **** } ! void create_vrml_from_url() { class children_listener : public openvrml::mfnode_listener { --- 74,78 ---- } ! BOOST_AUTO_TEST_CASE(create_vrml_from_url) { class children_listener : public openvrml::mfnode_listener { *************** *** 106,110 **** } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); --- 109,113 ---- } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove<boost::filesystem::path>, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); *************** *** 144,155 **** BOOST_CHECK_EQUAL(children[0]->type().id(), "Shape"); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("browser"); - suite->add(BOOST_TEST_CASE(&create_vrml_from_stream)); - suite->add(BOOST_TEST_CASE(&create_vrml_from_stream_with_externproto)); - suite->add(BOOST_TEST_CASE(&create_vrml_from_url)); - return suite; - } --- 147,148 ---- Index: image.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/image.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** image.cpp 23 Aug 2006 06:49:49 -0000 1.1.2.2 --- image.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE image + # include <sstream> # include <boost/array.hpp> *************** *** 26,30 **** using namespace openvrml; ! void stream_insertion() { const image img(2, 2, 1); --- 29,33 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_insertion) { const image img(2, 2, 1); *************** *** 36,40 **** } ! void stream_extraction() { const boost::array<unsigned char, 4> pixels = { 0xFF, 0x00, 0xFF, 0x00 }; --- 39,43 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction) { const boost::array<unsigned char, 4> pixels = { 0xFF, 0x00, 0xFF, 0x00 }; *************** *** 48,52 **** } ! void stream_extraction_insufficient_pixel_values() { const string image_str = "2 2 1 0xFF 0x00 0xFF"; --- 51,55 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_insufficient_pixel_values) { const string image_str = "2 2 1 0xFF 0x00 0xFF"; *************** *** 56,67 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("image"); - suite->add(BOOST_TEST_CASE(&stream_insertion)); - suite->add(BOOST_TEST_CASE(&stream_extraction)); - suite->add(BOOST_TEST_CASE(&stream_extraction_insufficient_pixel_values)); - return suite; - } --- 59,60 ---- Index: mat4f.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/mat4f.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** mat4f.cpp 23 Aug 2006 06:49:49 -0000 1.1.2.2 --- mat4f.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE mat4f + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_insertion() { mat4f m; --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_insertion) { mat4f m; *************** *** 37,41 **** } ! void stream_extraction_numbers_only() { const mat4f m1(1, 0, 0, 0, --- 40,44 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_numbers_only) { const mat4f m1(1, 0, 0, 0, *************** *** 53,57 **** } ! void stream_extraction_numbers_with_commas() { const mat4f m1(1, 0, 0, 0, --- 56,60 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_numbers_with_commas) { const mat4f m1(1, 0, 0, 0, *************** *** 68,79 **** BOOST_REQUIRE_EQUAL(m1, m2); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("mat4f"); - suite->add(BOOST_TEST_CASE(&stream_insertion)); - suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_only)); - suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_with_commas)); - return suite; - } --- 71,72 ---- Index: node_metatype_id.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/node_metatype_id.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** node_metatype_id.cpp 25 Jul 2006 15:32:22 -0000 1.1 --- node_metatype_id.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.1 *************** *** 1,2 **** --- 1,24 ---- + // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- + // + // Copyright 2007 Braden McDaniel + // + // 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 2 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, write to the Free Software + // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + // + + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE node_metatype_id + # include <boost/test/unit_test.hpp> # include <openvrml/browser.h> *************** *** 5,29 **** using namespace openvrml; ! void construct_from_urn() { node_metatype_id id("urn:foo:bar"); } ! void construct_from_url() { node_metatype_id id("http://example.com"); } ! void construct_from_url_with_fragment_id() { node_metatype_id id("http://example.com#Foo"); } ! void construct_nested_proto_id() { node_metatype_id id("http://example.com#Foo#Bar"); } ! void construct_from_relative_url() { BOOST_CHECK_THROW(node_metatype_id id("../foo/bar"), --- 27,51 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(construct_from_urn) { node_metatype_id id("urn:foo:bar"); } ! BOOST_AUTO_TEST_CASE(construct_from_url) { node_metatype_id id("http://example.com"); } ! BOOST_AUTO_TEST_CASE(construct_from_url_with_fragment_id) { node_metatype_id id("http://example.com#Foo"); } ! BOOST_AUTO_TEST_CASE(construct_nested_proto_id) { node_metatype_id id("http://example.com#Foo#Bar"); } ! BOOST_AUTO_TEST_CASE(construct_from_relative_url) { BOOST_CHECK_THROW(node_metatype_id id("../foo/bar"), *************** *** 31,49 **** } ! void construct_from_arbitrary_string() { BOOST_CHECK_THROW(node_metatype_id id("string"), std::invalid_argument); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("node_metatype_id"); - suite->add(BOOST_TEST_CASE(&construct_from_urn)); - suite->add(BOOST_TEST_CASE(&construct_from_url)); - suite->add(BOOST_TEST_CASE(&construct_from_url_with_fragment_id)); - suite->add(BOOST_TEST_CASE(&construct_nested_proto_id)); - suite->add(BOOST_TEST_CASE(&construct_from_relative_url)); - suite->add(BOOST_TEST_CASE(&construct_from_arbitrary_string)); - return suite; - } --- 53,58 ---- } ! BOOST_AUTO_TEST_CASE(construct_from_arbitrary_string) { BOOST_CHECK_THROW(node_metatype_id id("string"), std::invalid_argument); } Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/Makefile.am,v retrieving revision 1.14.2.2 retrieving revision 1.14.2.3 diff -C2 -d -r1.14.2.2 -r1.14.2.3 *** Makefile.am 21 May 2007 04:19:11 -0000 1.14.2.2 --- Makefile.am 6 Oct 2007 09:29:12 -0000 1.14.2.3 *************** *** 1,7 **** AM_CPPFLAGS = \ -I$(top_builddir)/src/libopenvrml \ ! -I$(top_srcdir)/src/libopenvrml ! AM_CXXFLAGS = @PTHREAD_CFLAGS@ ! AM_LDFLAGS = @OPENVRML_RPATH@ TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed --- 1,8 ---- AM_CPPFLAGS = \ -I$(top_builddir)/src/libopenvrml \ ! -I$(top_srcdir)/src/libopenvrml \ ! -DBOOST_TEST_DYN_LINK ! AM_CXXFLAGS = $(PTHREAD_CFLAGS) ! AM_LDFLAGS = $(OPENVRML_RPATH) TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed |