Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2004-08-18 02:58:44


Rozental, Gennadiy wrote:

>>Because I get duplicated symbols when linking otherwise.
>>Therefore you need to use either
>>
>>c_literal_string LOG_LEVEL = "BOOST_TEST_LOG_LEVEL";
>>
>>or
>>
>>literal_string const LOG_LEVEL = "BOOST_TEST_LOG_LEVEL";
>>
>>in the header file.
>>
>
> I would unconditionally add static to all parameter definitions instead.
>

What about

const_string const LOG_LEVEL = "BOOST_TEST_LOG_LEVEL";

That would work too. Is that ok for you? If yes, the corresponding patch is
attached. If not, please just check in the workaround for
basic_cstring_fwd.hpp and change the other file to your liking.

Thanks, Markus

diff -ru boost-04-08-17-0400/boost/test/detail/basic_cstring/basic_cstring_fwd.hpp boost-cvs/boost/test/detail/basic_cstring/basic_cstring_fwd.hpp
--- boost-04-08-17-0400/boost/test/detail/basic_cstring/basic_cstring_fwd.hpp 2004-07-19 14:28:17.000000000 +0200
+++ boost-cvs/boost/test/detail/basic_cstring/basic_cstring_fwd.hpp 2004-08-17 17:39:02.000000000 +0200
@@ -16,13 +16,21 @@
 #ifndef BASIC_CSTRING_FWD_HPP_071894GER
 #define BASIC_CSTRING_FWD_HPP_071894GER
 
+#include <boost/detail/workaround.hpp>
+
 namespace boost {
 
 namespace unit_test {
 
 template<class CharT> class basic_cstring;
 typedef basic_cstring<char const> const_string;
+
+#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590041))
+typedef const_string literal_string;
+#else
 typedef const_string const literal_string;
+#endif
+
 typedef char const* const c_literal_string;
 
 } // namespace unit_test
diff -ru boost-04-08-17-0400/boost/test/detail/unit_test_parameters.hpp boost-cvs/boost/test/detail/unit_test_parameters.hpp
--- boost-04-08-17-0400/boost/test/detail/unit_test_parameters.hpp 2004-07-19 14:24:32.000000000 +0200
+++ boost-cvs/boost/test/detail/unit_test_parameters.hpp 2004-08-18 09:52:42.000000000 +0200
@@ -25,19 +25,19 @@
 namespace unit_test {
 
 // framework parameters and there corresponding command-line arguments
-literal_string LOG_LEVEL = "BOOST_TEST_LOG_LEVEL"; // --log_level
-literal_string NO_RESULT_CODE = "BOOST_TEST_RESULT_CODE"; // --result_code
-literal_string REPORT_LEVEL = "BOOST_TEST_REPORT_LEVEL"; // --report_level
-literal_string TESTS_TO_RUN = "BOOST_TESTS_TO_RUN"; // --run_test
-literal_string SAVE_TEST_PATTERN = "BOOST_TEST_SAVE_PATTERN"; // --save_pattern
-literal_string BUILD_INFO = "BOOST_TEST_BUILD_INFO"; // --build_info
-literal_string CATCH_SYS_ERRORS = "BOOST_TEST_CATCH_SYSTEM_ERRORS"; // --catch_system_errors
-literal_string REPORT_FORMAT = "BOOST_TEST_REPORT_FORMAT"; // --report_format
-literal_string LOG_FORMAT = "BOOST_TEST_LOG_FORMAT"; // --log_format
-literal_string OUTPUT_FORMAT = "BOOST_TEST_OUTPUT_FORMAT"; // --output_format
+const_string const LOG_LEVEL = "BOOST_TEST_LOG_LEVEL"; // --log_level
+const_string const NO_RESULT_CODE = "BOOST_TEST_RESULT_CODE"; // --result_code
+const_string const REPORT_LEVEL = "BOOST_TEST_REPORT_LEVEL"; // --report_level
+const_string const TESTS_TO_RUN = "BOOST_TESTS_TO_RUN"; // --run_test
+const_string const SAVE_TEST_PATTERN = "BOOST_TEST_SAVE_PATTERN"; // --save_pattern
+const_string const BUILD_INFO = "BOOST_TEST_BUILD_INFO"; // --build_info
+const_string const CATCH_SYS_ERRORS = "BOOST_TEST_CATCH_SYSTEM_ERRORS"; // --catch_system_errors
+const_string const REPORT_FORMAT = "BOOST_TEST_REPORT_FORMAT"; // --report_format
+const_string const LOG_FORMAT = "BOOST_TEST_LOG_FORMAT"; // --log_format
+const_string const OUTPUT_FORMAT = "BOOST_TEST_OUTPUT_FORMAT"; // --output_format
 
-enum report_level { CONFIRMATION_REPORT, SHORT_REPORT, DETAILED_REPORT, NO_REPORT, UNDEF_REPORT };
-literal_string report_level_names[] = { "confirm" , "short" , "detailed" , "no" };
+enum report_level { CONFIRMATION_REPORT, SHORT_REPORT, DETAILED_REPORT, NO_REPORT, UNDEF_REPORT };
+const_string const report_level_names[] = { "confirm" , "short" , "detailed" , "no" };
 
 enum output_format { HRF /* human readable format */, XML /* XML */ };
 


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk