Author: faridz
Date: Thu Mar 29 06:01:55 2007
New Revision: 523692
URL: http://svn.apache.org/viewvc?view=rev&rev=523692
Log:
2007-03-29 Farid Zaripov <[EMAIL PROTECTED]>
* 23.list.assign.cpp: Used std::size_t instead of size_t.
* 23.list.capacity.cpp: Ditto.
* 23.list.cons.cpp: Ditto.
* 23.list.erase.cpp: Ditto.
* 23.list.insert.cpp: Ditto.
* 23.list.iterators.cpp: Ditto.
Modified:
incubator/stdcxx/trunk/tests/containers/23.list.assign.cpp
incubator/stdcxx/trunk/tests/containers/23.list.capacity.cpp
incubator/stdcxx/trunk/tests/containers/23.list.cons.cpp
incubator/stdcxx/trunk/tests/containers/23.list.erase.cpp
incubator/stdcxx/trunk/tests/containers/23.list.insert.cpp
incubator/stdcxx/trunk/tests/containers/23.list.iterators.cpp
Modified: incubator/stdcxx/trunk/tests/containers/23.list.assign.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/containers/23.list.assign.cpp?view=diff&rev=523692&r1=523691&r2=523692
==============================================================================
--- incubator/stdcxx/trunk/tests/containers/23.list.assign.cpp (original)
+++ incubator/stdcxx/trunk/tests/containers/23.list.assign.cpp Thu Mar 29
06:01:55 2007
@@ -370,10 +370,10 @@
// for convenience
static const int cwidth = sizeof (T);
- const size_t got_size = lst.size ();
+ const std::size_t got_size = lst.size ();
char* const got = new char [got_size + 1];
- size_t index = 0;
+ std::size_t index = 0;
for (ListCIter it = lst.begin (),
end = lst.end (); it != end; ++it) {
got [index++] = char (it->data_.val_);
Modified: incubator/stdcxx/trunk/tests/containers/23.list.capacity.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/containers/23.list.capacity.cpp?view=diff&rev=523692&r1=523691&r2=523692
==============================================================================
--- incubator/stdcxx/trunk/tests/containers/23.list.capacity.cpp (original)
+++ incubator/stdcxx/trunk/tests/containers/23.list.capacity.cpp Thu Mar 29
06:01:55 2007
@@ -25,7 +25,7 @@
**************************************************************************/
#include <list> // for list
-#include <stddef.h> // for size_t
+#include <cstddef> // for size_t
#include <stdexcept> // for exception
#include <23.list.h> // for ListMembers
#include <driver.h> // for rw_test()
@@ -370,7 +370,7 @@
// iterate for`throw_after' starting at the next call to operator new,
// forcing each call to throw an exception, until the function finally
// succeeds (i.e, no exception is thrown)
- size_t throw_count;
+ std::size_t throw_count;
for (throw_count = 0; ; ++throw_count) {
// (name of) expected and caught exception
@@ -402,12 +402,12 @@
const bool is_class = ListIds::UserClass == func.elem_id_;
- const size_t x_count_save = UserClass::count_;
+ const std::size_t x_count_save = UserClass::count_;
// start checking for memory leaks
rw_check_leaks (lst.get_allocator ());
- size_t res = 0;
+ std::size_t res = 0;
try {
@@ -451,15 +451,15 @@
|| func.which_ == ListIds::resize_size
|| func.which_ == ListIds::resize_size_val)) {
- size_t nctors = tdata.reslen_ > tdata.strlen_ ?
+ std::size_t nctors = tdata.reslen_ > tdata.strlen_ ?
tdata.reslen_ - tdata.strlen_ : 0;
- size_t ndtors = tdata.reslen_ < tdata.strlen_ ?
+ std::size_t ndtors = tdata.reslen_ < tdata.strlen_ ?
tdata.strlen_ - tdata.reslen_ : 0;
- size_t new_count = x_count_save + nctors - ndtors;
+ std::size_t new_count = x_count_save + nctors - ndtors;
- size_t ndefctors = 0;
+ std::size_t ndefctors = 0;
if (func.which_ == ListIds::resize_size_val)
++nctors;
@@ -488,7 +488,7 @@
}
if (func.which_ == ListIds::max_size_void) {
- size_t cur_sz = clst.size ();
+ std::size_t cur_sz = clst.size ();
rw_assert (cur_sz <= res, 0, tcase.line,
"line %d. %{$FUNCALL} == %zu, expected res > %zu",
@@ -502,10 +502,10 @@
// for convenience
static const int cwidth = sizeof (T);
- const size_t got_size = lst.size ();
+ const std::size_t got_size = lst.size ();
char* const got = new char [got_size + 1];
- size_t index = 0;
+ std::size_t index = 0;
for (ListCIter it = lst.begin (),
end = lst.end (); it != end; ++it) {
got [index++] = char (it->data_.val_);
@@ -525,7 +525,8 @@
// if the result length matches the expected length
// (and only then), also verify that the modified
// list matches the expected result
- const size_t match = rw_match (tcase.res, got, got_size);
+ const std::size_t match = rw_match (tcase.res,
+ got, got_size);
rw_assert (match == tdata.reslen_, 0, tcase.line,
"line %d. %{$FUNCALL} expected \"%{X=*}\", "
@@ -568,7 +569,7 @@
// FIXME: verify the number of blocks the function call
// is expected to allocate and detect any memory leaks
rw_check_leaks (lst.get_allocator (), tcase.line,
- size_t (-1), size_t (-1));
+ std::size_t (-1), std::size_t (-1));
if (caught) {
// verify that an exception thrown during allocation
@@ -615,7 +616,7 @@
TEST (ListIds::empty_void, empty_void)
};
- const size_t test_count = sizeof tests / sizeof *tests;
+ const std::size_t test_count = sizeof tests / sizeof *tests;
return rw_run_cont_test (argc, argv, __FILE__,
"lib.list.capacity",
Modified: incubator/stdcxx/trunk/tests/containers/23.list.cons.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/containers/23.list.cons.cpp?view=diff&rev=523692&r1=523691&r2=523692
==============================================================================
--- incubator/stdcxx/trunk/tests/containers/23.list.cons.cpp (original)
+++ incubator/stdcxx/trunk/tests/containers/23.list.cons.cpp Thu Mar 29
06:01:55 2007
@@ -482,7 +482,7 @@
const bool is_class = ListIds::UserClass == func.elem_id_;
- const size_t x_count_save = UserClass::count_;
+ const std::size_t x_count_save = UserClass::count_;
try {
ListIds::OverloadId which =
@@ -542,11 +542,11 @@
if (is_class) {
- size_t def_ctor = (Cons (size) == which);
+ std::size_t def_ctor = (Cons (size) == which);
// verify that the list ctor calls only copy ctor
// of UserClass and only the given number of times each
- bool success = UserClass::is_total (size_t (-1),
+ bool success = UserClass::is_total (std::size_t (-1),
def_ctor,
tdata.reslen_,
0, 0, 0);
@@ -561,10 +561,10 @@
def_ctor, tdata.reslen_);
}
- const size_t got_size = ret_ptr->size ();
+ const std::size_t got_size = ret_ptr->size ();
char* const got = new char [got_size + 1];
- size_t index = 0;
+ std::size_t index = 0;
for (ListCIter it = ret_ptr->begin (),
end = ret_ptr->end (); it != end; ++it) {
got [index++] = char (it->data_.val_);
@@ -640,7 +640,7 @@
// disable UserClass::CopyCtor exception
if (!caught)
- UserClass::copy_ctor_throw_count_ = size_t (-1);
+ UserClass::copy_ctor_throw_count_ = std::size_t (-1);
/* const */ std::size_t nbytes;
const std::size_t nblocks = rwt_check_leaks (&nbytes, 0);
@@ -763,8 +763,8 @@
if (is_class && &lst != &arg_list) {
- const size_t total_copy = UserClass::n_total_copy_ctor_ +
- UserClass::n_total_op_assign_;
+ const std::size_t total_copy = UserClass::n_total_copy_ctor_ +
+ UserClass::n_total_op_assign_;
bool success = 0 == UserClass::n_total_def_ctor_
&& total_copy == tdata.reslen_;
@@ -781,10 +781,10 @@
// for convenience
static const int cwidth = sizeof (T);
- const size_t got_size = lst.size ();
+ const std::size_t got_size = lst.size ();
char* const got = new char [got_size + 1];
- size_t index = 0;
+ std::size_t index = 0;
for (ListCIter it = lst.begin (),
end = lst.end (); it != end; ++it) {
got [index++] = char (it->data_.val_);
Modified: incubator/stdcxx/trunk/tests/containers/23.list.erase.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/containers/23.list.erase.cpp?view=diff&rev=523692&r1=523691&r2=523692
==============================================================================
--- incubator/stdcxx/trunk/tests/containers/23.list.erase.cpp (original)
+++ incubator/stdcxx/trunk/tests/containers/23.list.erase.cpp Thu Mar 29
06:01:55 2007
@@ -254,10 +254,10 @@
}
template<class InputIterator>
-inline size_t
+inline std::size_t
_rw_distance(InputIterator first, InputIterator last)
{
- size_t dist = 0;
+ std::size_t dist = 0;
for (; first != last; ++first)
++dist;
@@ -312,7 +312,7 @@
const bool is_class = ListIds::UserClass == func.elem_id_;
- const size_t x_count_save = UserClass::count_;
+ const std::size_t x_count_save = UserClass::count_;
try {
// reset function call counters
@@ -372,7 +372,7 @@
if (ListIds::pop_front_void != func.which_
&& ListIds::pop_back_void != func.which_) {
// verify the returned value
- size_t dist = _rw_distance (lst.begin (), res_iter);
+ std::size_t dist = _rw_distance (lst.begin (), res_iter);
rw_assert (dist <= lst.size(), 0, tcase.line,
"line %d. %{$FUNCALL} returned invalid iterator, "
"difference with begin is %zu",
@@ -396,10 +396,10 @@
// for convenience
static const int cwidth = sizeof (T);
- const size_t got_size = lst.size ();
+ const std::size_t got_size = lst.size ();
char* const got = new char [got_size + 1];
- size_t index = 0;
+ std::size_t index = 0;
for (ListCIter it = lst.begin (),
end = lst.end (); it != end; ++it) {
got [index++] = char (it->data_.val_);
Modified: incubator/stdcxx/trunk/tests/containers/23.list.insert.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/containers/23.list.insert.cpp?view=diff&rev=523692&r1=523691&r2=523692
==============================================================================
--- incubator/stdcxx/trunk/tests/containers/23.list.insert.cpp (original)
+++ incubator/stdcxx/trunk/tests/containers/23.list.insert.cpp Thu Mar 29
06:01:55 2007
@@ -358,10 +358,10 @@
}
template<class InputIterator>
-inline size_t
+inline std::size_t
_rw_distance(InputIterator first, InputIterator last)
{
- size_t dist = 0;
+ std::size_t dist = 0;
for (; first != last; ++first)
++dist;
@@ -552,7 +552,7 @@
const bool is_class = ListIds::UserClass == func.elem_id_;
- const size_t x_count_save = UserClass::count_;
+ const std::size_t x_count_save = UserClass::count_;
try {
// reset function call counters
@@ -637,10 +637,10 @@
// for convenience
static const int cwidth = sizeof (T);
- const size_t got_size = lst.size ();
+ const std::size_t got_size = lst.size ();
char* const got = new char [got_size + 1];
- size_t index = 0;
+ std::size_t index = 0;
for (ListCIter it = lst.begin (),
end = lst.end (); it != end; ++it) {
got [index++] = char (it->data_.val_);
Modified: incubator/stdcxx/trunk/tests/containers/23.list.iterators.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/containers/23.list.iterators.cpp?view=diff&rev=523692&r1=523691&r2=523692
==============================================================================
--- incubator/stdcxx/trunk/tests/containers/23.list.iterators.cpp (original)
+++ incubator/stdcxx/trunk/tests/containers/23.list.iterators.cpp Thu Mar 29
06:01:55 2007
@@ -182,7 +182,7 @@
// construct the constant list object
const List clst (tdata.str_, tdata.str_ + tdata.strlen_, alloc);
- const size_t s_size = test_const_list ? clst.size () : lst.size ();
+ const std::size_t s_size = test_const_list ? clst.size () : lst.size ();
// save the state of the list object before the call
// to detect exception safety violations (changes to
@@ -381,7 +381,7 @@
// FIXME: verify the number of blocks the function call
// is expected to allocate and detect any memory leaks
rw_check_leaks (lst.get_allocator (), tcase.line,
- size_t (-1), size_t (-1));
+ std::size_t (-1), std::size_t (-1));
// verify that state of the object didn't changed
lst_state.assert_equal (ListState (lst),
@@ -418,7 +418,7 @@
TEST (ListIds::get_allocator_void, get_allocator_void)
};
- const size_t test_count = sizeof tests / sizeof *tests;
+ const std::size_t test_count = sizeof tests / sizeof *tests;
return rw_run_cont_test (argc, argv, __FILE__,
"lib.list.iterators", ContainerIds::List,