From b4f99d66b590ad1d8bb66211450fd62ed202b873 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorsten=20J=C3=B8rgen=20Ottosen?=
Date: Tue, 24 Jun 2008 15:38:50 +0000
Subject: [PATCH] bug-fixes from trunk
[SVN r46649]
---
doc/history_ack.html | 4 ++--
doc/intro.html | 2 +-
doc/style.html | 2 +-
doc/utility_class.html | 6 +++---
index.html | 2 +-
test/Jamfile.v2 | 4 ++--
test/partial_workaround.cpp | 8 +++++++-
test/string.cpp | 34 ++++++++++++++++------------------
8 files changed, 33 insertions(+), 29 deletions(-)
mode change 100755 => 100644 doc/history_ack.html
mode change 100755 => 100644 doc/intro.html
mode change 100755 => 100644 doc/style.html
mode change 100755 => 100644 index.html
mode change 100755 => 100644 test/partial_workaround.cpp
mode change 100755 => 100644 test/string.cpp
diff --git a/doc/history_ack.html b/doc/history_ack.html
old mode 100755
new mode 100644
index c8527ba..3191dd0
--- a/doc/history_ack.html
+++ b/doc/history_ack.html
@@ -19,9 +19,9 @@
History and Acknowledgement
The library was under way for a long time. Dietmar Kühl originally intended
- to submit an array_traits
class template which had most of
+ to submit an array_traits
class template which had most of
the functionality present now, but only for arrays and standard containers.
- I believe this was back in 2001 or 2002.
+ I believe this was back in 2001 or 2002.
diff --git a/doc/intro.html b/doc/intro.html
old mode 100755
new mode 100644
index 9f41c72..82f10dc
--- a/doc/intro.html
+++ b/doc/intro.html
@@ -24,7 +24,7 @@
to a somewhat clumsy use of the algorithms with redundant specification
of container names. Therefore we would like to raise the abstraction level
for algorithms so they specify their interface in terms of Ranges as much as possible.
+ href="range.html">Ranges as much as possible.
diff --git a/doc/style.html b/doc/style.html
old mode 100755
new mode 100644
index cd82c94..4240a8c
--- a/doc/style.html
+++ b/doc/style.html
@@ -53,7 +53,7 @@
Bidirectional Range
Random Access Range
- Notice how we have used the categories from the new
+ Notice how we have used the categories from the new
style iterators .
diff --git a/doc/utility_class.html b/doc/utility_class.html
index ea51503..e100859 100644
--- a/doc/utility_class.html
+++ b/doc/utility_class.html
@@ -27,9 +27,9 @@
@@ -329,7 +329,7 @@ class can propagate constness since it knows what a corresponding
const value_type & operator []( difference_type at ) const ;
public :
- };
}
diff --git a/index.html b/index.html
old mode 100755
new mode 100644
index 5313690..56ba4eb
--- a/index.html
+++ b/index.html
@@ -22,7 +22,7 @@
Use, modification and distribution is subject to the Boost Software License, Version 1.0
- (see
+ (see
http://www.boost.org/LICENSE_1_0.txt ).
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index b6942ca..c82a6c9 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -12,9 +12,9 @@ rule range-test ( name : includes * )
{
return [
run $(name).cpp /boost/test//boost_unit_test_framework/ static
+ :
:
- :
- : $(includes)
+ : gcc:"-Wall -Wunused "
] ;
}
diff --git a/test/partial_workaround.cpp b/test/partial_workaround.cpp
old mode 100755
new mode 100644
index 8ac6f66..76d902f
--- a/test/partial_workaround.cpp
+++ b/test/partial_workaround.cpp
@@ -10,6 +10,8 @@
#include
#include
+#include
+#include
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
# pragma warn -8091 // supress warning in Boost.Test
@@ -30,7 +32,6 @@
#include
#include
-#include
#include
#include
@@ -91,6 +92,11 @@ void check_partial_workaround()
void check_partial_workaround()
{
+ //
+ // test if warnings are generated
+ //
+ std::size_t s = boost::range_detail::array_size( "foo" );
+ BOOST_CHECK_EQUAL( s, 4u );
}
#endif
diff --git a/test/string.cpp b/test/string.cpp
old mode 100755
new mode 100644
index 9a2e5a8..127f70a
--- a/test/string.cpp
+++ b/test/string.cpp
@@ -137,14 +137,7 @@ void check_char()
BOOST_CHECK_EQUAL( str_end( char_s ), str_end1 );
BOOST_CHECK_EQUAL( str_empty( char_s ), (char_s == 0 || char_s[0] == char()) );
BOOST_CHECK_EQUAL( sz, std::char_traits::length( char_s ) );
-/*
- BOOST_CHECK_EQUAL( str_begin( char_s2 ), char_s2 );
- std::size_t sz2 = size( char_s2 );
- const char* str_end12 = str_begin( char_s2 ) + sz;
- BOOST_CHECK_EQUAL( str_end( char_s2 ), str_end12 );
- BOOST_CHECK_EQUAL( empty( char_s2 ), (char_s2 == 0 || char_s2[0] == char()) );
- BOOST_CHECK_EQUAL( sz2, std::char_traits::length( char_s2 ) );
-*/
+
BOOST_CHECK_EQUAL( str_begin( my_string ), my_string );
range_iterator::type str_end2 = str_begin( my_string ) + str_size(my_string);
range_iterator::type str_end3 = str_end(my_string);
@@ -165,6 +158,20 @@ void check_char()
BOOST_CHECK( find_const( as_array( my_string ), to_search ) != str_end(my_string) );
BOOST_CHECK( find_const( as_array( my_const_string ), to_search ) != str_end(my_string) );
+
+ //
+ // Test that as_literal() always scan for null terminator
+ //
+ char an_array[] = "foo\0bar";
+ BOOST_CHECK_EQUAL( str_begin( an_array ), an_array );
+ BOOST_CHECK_EQUAL( str_end( an_array ), an_array + 3 );
+ BOOST_CHECK_EQUAL( str_size( an_array ), 3 );
+
+ const char a_const_array[] = "foobar\0doh";
+ BOOST_CHECK_EQUAL( str_begin( a_const_array ), a_const_array );
+ BOOST_CHECK_EQUAL( str_end( a_const_array ), a_const_array + 6 );
+ BOOST_CHECK_EQUAL( str_size( a_const_array ), 6 );
+
}
@@ -172,9 +179,6 @@ void check_char()
void check_string()
{
check_char();
-// check_char();
-// check_char();
-// check_char();
#ifndef BOOST_NO_STD_WSTRING
typedef wchar_t* wchar_iterator_t;
@@ -197,13 +201,7 @@ void check_string()
BOOST_CHECK_EQUAL( str_end(char_ws), (str_begin( char_ws ) + sz) );
BOOST_CHECK_EQUAL( str_empty( char_ws ), (char_ws == 0 || char_ws[0] == wchar_t()) );
BOOST_CHECK_EQUAL( sz, std::char_traits::length( char_ws ) );
- /*
- std::size_t sz2 = size( char_ws2 );
- BOOST_CHECK_EQUAL( str_begin( char_ws2 ), char_ws2 );
- BOOST_CHECK_EQUAL( str_end( char_ws2 ), (begin( char_ws2 ) + sz2) );
- BOOST_CHECK_EQUAL( empty( char_ws2 ), (char_ws2 == 0 || char_ws2[0] == wchar_t()) );
- BOOST_CHECK_EQUAL( sz2, std::char_traits::length( char_ws2 ) );
- */
+
wchar_t to_search = L'n';
BOOST_CHECK( find( char_ws, to_search ) != str_end(char_ws) );