You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2007/02/21 16:58:56 UTC
svn commit: r510071 [1/5] - in /incubator/stdcxx/trunk/tests: algorithms/
containers/ include/ numerics/ self/ src/ utilities/
Author: faridz
Date: Wed Feb 21 07:58:53 2007
New Revision: 510071
URL: http://svn.apache.org/viewvc?view=rev&rev=510071
Log:
2007-02-21 Farid Zaripov <fa...@kyiv.vdiweb.com>
ChangeLog:
* rw_value.h (struct X): Renamed to struct UserClass.
* value.cpp: The same.
* 25.adjacent.find.cpp: Updated copyright notice.
#included rw_value.h; used struct UserClass instead of struct X.
* 25.binary.search.cpp: The same.
* 25.copy.cpp: The same.
* 25.equal.cpp: The same.
* 25.equal.range.cpp: The same.
* 25.fill.cpp: The same.
* 25.find.cpp: The same.
* 25.find.end.cpp: The same.
* 25.find.first.cpp: The same.
* 25.for.each.cpp: The same.
* 25.generate.cpp: The same.
* 25.heap.cpp: The same.
* 25.includes.cpp: The same.
* 25.lex.comparison.cpp: The same.
* 25.libc.cpp: The same.
* 25.lower.bound.cpp: The same.
* 25.merge.cpp: The same.
* 25.min.max.cpp: The same.
* 25.mismatch.cpp: The same.
* 25.nth.element.cpp: The same.
* 25.partial.sort.cpp: The same.
* 25.partitions.cpp: The same.
* 25.permutation.cpp: The same.
* 25.random.shuffle.cpp: The same.
* 25.remove.cpp: The same.
* 25.replace.cpp: The same.
* 25.reverse.cpp: The same.
* 25.rotate.cpp: The same.
* 25.search.cpp: The same.
* 25.set.difference.cpp: The same.
* 25.set.intersection.cpp: The same.
* 25.set.sym.difference.cpp: The same.
* 25.set.union.cpp: The same.
* 25.sort.cpp: The same.
* 25.swap.cpp: The same.
* 25.transform.cpp: The same.
* 25.unique.cpp: The same.
* 25.upper.bound.cpp: The same.
* 23.deque.modifiers.cpp: The same.
* 23.deque.special.cpp: The same.
* 23.vector.capacity.cpp: The same.
* 23.vector.cons.cpp: The same.
* 23.vector.modifiers.cpp: The same.
* 26.accumulate.cpp: The same.
* 26.adjacent.diff.cpp: The same.
* 26.inner.product.cpp: The same.
* 26.partial.sum.cpp: The same.
* 26.valarray.cons.cpp: The same.
* 0.inputiter.cpp: The same.
* 20.pairs.cpp: The same.
Modified:
incubator/stdcxx/trunk/tests/algorithms/25.adjacent.find.cpp
incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp
incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp
incubator/stdcxx/trunk/tests/algorithms/25.equal.cpp
incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp
incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp
incubator/stdcxx/trunk/tests/algorithms/25.find.cpp
incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp
incubator/stdcxx/trunk/tests/algorithms/25.find.first.cpp
incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp
incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp
incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp
incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp
incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp
incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp
incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp
incubator/stdcxx/trunk/tests/algorithms/25.merge.cpp
incubator/stdcxx/trunk/tests/algorithms/25.min.max.cpp
incubator/stdcxx/trunk/tests/algorithms/25.mismatch.cpp
incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp
incubator/stdcxx/trunk/tests/algorithms/25.partial.sort.cpp
incubator/stdcxx/trunk/tests/algorithms/25.partitions.cpp
incubator/stdcxx/trunk/tests/algorithms/25.permutation.cpp
incubator/stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp
incubator/stdcxx/trunk/tests/algorithms/25.remove.cpp
incubator/stdcxx/trunk/tests/algorithms/25.replace.cpp
incubator/stdcxx/trunk/tests/algorithms/25.reverse.cpp
incubator/stdcxx/trunk/tests/algorithms/25.rotate.cpp
incubator/stdcxx/trunk/tests/algorithms/25.search.cpp
incubator/stdcxx/trunk/tests/algorithms/25.set.difference.cpp
incubator/stdcxx/trunk/tests/algorithms/25.set.intersection.cpp
incubator/stdcxx/trunk/tests/algorithms/25.set.sym.difference.cpp
incubator/stdcxx/trunk/tests/algorithms/25.set.union.cpp
incubator/stdcxx/trunk/tests/algorithms/25.sort.cpp
incubator/stdcxx/trunk/tests/algorithms/25.swap.cpp
incubator/stdcxx/trunk/tests/algorithms/25.transform.cpp
incubator/stdcxx/trunk/tests/algorithms/25.unique.cpp
incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp
incubator/stdcxx/trunk/tests/containers/23.deque.modifiers.cpp
incubator/stdcxx/trunk/tests/containers/23.deque.special.cpp
incubator/stdcxx/trunk/tests/containers/23.vector.capacity.cpp
incubator/stdcxx/trunk/tests/containers/23.vector.cons.cpp
incubator/stdcxx/trunk/tests/containers/23.vector.modifiers.cpp
incubator/stdcxx/trunk/tests/include/rw_value.h
incubator/stdcxx/trunk/tests/numerics/26.accumulate.cpp
incubator/stdcxx/trunk/tests/numerics/26.adjacent.diff.cpp
incubator/stdcxx/trunk/tests/numerics/26.inner.product.cpp
incubator/stdcxx/trunk/tests/numerics/26.partial.sum.cpp
incubator/stdcxx/trunk/tests/numerics/26.valarray.cons.cpp
incubator/stdcxx/trunk/tests/self/0.inputiter.cpp
incubator/stdcxx/trunk/tests/src/value.cpp
incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp
Modified: incubator/stdcxx/trunk/tests/algorithms/25.adjacent.find.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.adjacent.find.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.adjacent.find.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.adjacent.find.cpp Wed Feb 21 07:58:53 2007
@@ -6,22 +6,23 @@
*
***************************************************************************
*
- * Copyright 2005-2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
*
- * Copyright 2004-2006 Rogue Wave Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2004-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -29,11 +30,12 @@
#include <cstring> // for size_t, strlen()
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h>
/**************************************************************************/
-// used to initialize an array of objects of type X
+// used to initialize an array of objects of type UserClass
static const char *xinit_begin;
int xinit ()
@@ -97,11 +99,11 @@
if (std::size_t (-1) == resoff)
resoff = nsrc;
- // have the X default ctor initialize objects from `src'
+ // have the UserClass default ctor initialize objects from `src'
xinit_begin = src;
- X::gen_ = xinit;
+ UserClass::gen_ = xinit;
- X* const xsrc = new X [nsrc];
+ UserClass* const xsrc = new UserClass [nsrc];
const ForwardIterator first =
make_iter (xsrc, xsrc, xsrc + nsrc, dummy_iter);
@@ -110,7 +112,7 @@
make_iter (xsrc + nsrc, xsrc, xsrc + nsrc, dummy_iter);
// reset predicate counters
- X::n_total_op_eq_ = 0;
+ UserClass::n_total_op_eq_ = 0;
EqualityPredicate<T, T>::funcalls_ = 0;
// construct a predicate object
@@ -126,7 +128,7 @@
const std::size_t n_total_pred = predname ?
EqualityPredicate<T, T>::funcalls_
- : X::n_total_op_eq_;
+ : UserClass::n_total_op_eq_;
// verify that the returned iterator is set as expected
int success = res.cur_ == first.cur_ + resoff;
@@ -175,7 +177,8 @@
itname, 0 != predname, predname);
#define TEST(src, off) \
- do_test (__LINE__, src, std::size_t (off), dummy_iter, (X*)0, predname)
+ do_test (__LINE__, src, std::size_t (off), dummy_iter, \
+ (UserClass*)0, predname)
// +------------------ subject sequence
// | +-- offset of returned iterator,
@@ -238,21 +241,21 @@
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- run_tests (FwdIter<X>(), (X*)0, predname);
+ run_tests (FwdIter<UserClass>(), (UserClass*)0, predname);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- run_tests (BidirIter<X>(), (X*)0, predname);
+ run_tests (BidirIter<UserClass>(), (UserClass*)0, predname);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- run_tests (RandomAccessIter<X>(), (X*)0, predname);
+ run_tests (RandomAccessIter<UserClass>(), (UserClass*)0, predname);
}
}
@@ -267,7 +270,7 @@
rw_note (0, __FILE__, __LINE__, "Predicate test disabled");
}
else {
- test_adjacent_find ("EqualityPredicate<X, X>");
+ test_adjacent_find ("EqualityPredicate<UserClass, UserClass>");
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -31,6 +38,7 @@
#include <cstring> // for strlen()
#include <alg_test.h> // for iterators
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test(), ...
/**************************************************************************/
@@ -73,7 +81,7 @@
// implementation of the algorithms
struct Y
{
- X xval_;
+ UserClass xval_;
// not Default-Constructible
Y (int /* dummy */, int /*dummy */): xval_ () { }
@@ -88,13 +96,13 @@
inline bool
-operator< (const X &lhs, const Y &rhs)
+operator< (const UserClass &lhs, const Y &rhs)
{
return lhs < rhs.xval_;
}
inline bool
-operator< (const Y &lhs, const X &rhs)
+operator< (const Y &lhs, const UserClass &rhs)
{
return lhs.xval_ < rhs;
}
@@ -110,12 +118,12 @@
// return a type other than bool but one that is implicitly
// convertible to bool to detect incorrect assumptions
- bool operator() (const X &lhs, const Y &rhs) {
+ bool operator() (const UserClass &lhs, const Y &rhs) {
++funcalls_;
return lhs < rhs.xval_;
}
- bool operator() (const Y &lhs, const X &rhs) {
+ bool operator() (const Y &lhs, const UserClass &rhs) {
++funcalls_;
return lhs.xval_ < rhs;
}
@@ -140,7 +148,7 @@
{
RW_ASSERT (0 != src_str);
- const char* const tname = "X";
+ const char* const tname = "UserClass";
const char* const itname = type_name (it, (T*)0);
const char* const funname = predicate ? "LessThan" : "operator<()";
@@ -204,7 +212,8 @@
const char* const itname = type_name (it, (T*)0);
const char* const funname = predicate ? "LessThan" : "operator<()";
- rw_info (0, 0, 0, "std::binary_search (%s, %1$s, const X&%{?}, %s%{;})",
+ rw_info (0, 0, 0,
+ "std::binary_search (%s, %1$s, const UserClass&%{?}, %s%{;})",
itname, predicate, funname);
#define TEST(str, val, res, comp) \
@@ -260,7 +269,7 @@
rw_info (0, 0, 0, "template <class %s, class %s%{?}, class %s%{;}> "
"bool std::binary_search (%1$s, %1$s, const %2$s&%{?}, %s%{;})",
- "ForwardIterator", "X", predicate, "Compare", predicate,
+ "ForwardIterator", "UserClass", predicate, "Compare", predicate,
"Compare");
if (rw_opt_no_fwd_iter) {
@@ -290,14 +299,14 @@
static int
run_test (int, char*[])
{
- test_binary_search ((X*)0, false);
+ test_binary_search ((UserClass*)0, false);
if (rw_opt_no_predicate) {
rw_note (0, __FILE__, __LINE__,
"test of the Predicate form of std::binary_search disabled");
}
else {
- test_binary_search ((X*)0, true);
+ test_binary_search ((UserClass*)0, true);
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -23,6 +30,7 @@
#include <cstddef> // for size_t
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()...
/**************************************************************************/
@@ -238,14 +246,15 @@
rw_note (0, __FILE__, __LINE__, "OutputIterator test disabled");
}
else {
- test_copy (N, dummy, OutputIter<X>((X*)0, (X*)0, (X*)0), (X*)0);
+ test_copy (N, dummy, OutputIter<UserClass>((UserClass*)0,
+ (UserClass*)0, (UserClass*)0), (UserClass*)0);
}
if (rw_opt_no_fwd_iter) {
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_copy (N, dummy, FwdIter<X>(), (X*)0);
+ test_copy (N, dummy, FwdIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_bidir_iter) {
@@ -253,7 +262,7 @@
"BidirectionalIterator test disabled");
}
else {
- test_copy (N, dummy, BidirIter<X>(), (X*)0);
+ test_copy (N, dummy, BidirIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_rnd_iter) {
@@ -261,7 +270,7 @@
"RandomAccessIterator test disabled");
}
else {
- test_copy (N, dummy, RandomAccessIter<X>(), (X*)0);
+ test_copy (N, dummy, RandomAccessIter<UserClass>(), (UserClass*)0);
}
}
@@ -279,14 +288,15 @@
rw_note (0, __FILE__, __LINE__, "InputIterator test disabled");
}
else {
- test_copy (N, InputIter<X>((X*)0, (X*)0, (X*)0), (X*)0);
+ test_copy (N, InputIter<UserClass>((UserClass*)0, (UserClass*)0,
+ (UserClass*)0), (UserClass*)0);
}
if (rw_opt_no_fwd_iter) {
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_copy (N, FwdIter<X>(), (X*)0);
+ test_copy (N, FwdIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_bidir_iter) {
@@ -294,7 +304,7 @@
"BidirectionalIterator test disabled");
}
else {
- test_copy (N, BidirIter<X>(), (X*)0);
+ test_copy (N, BidirIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_rnd_iter) {
@@ -302,7 +312,7 @@
"RandomAccessIterator test disabled");
}
else {
- test_copy (N, RandomAccessIter<X>(), (X*)0);
+ test_copy (N, RandomAccessIter<UserClass>(), (UserClass*)0);
}
}
@@ -316,7 +326,7 @@
"BidirectionalIterator test disabled");
}
else {
- test_copy_backward (N, dummy, BidirIter<X>(), (X*)0);
+ test_copy_backward (N, dummy, BidirIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_rnd_iter) {
@@ -324,7 +334,8 @@
"RandomAccessIterator test disabled");
}
else {
- test_copy_backward (N, dummy, RandomAccessIter<X>(), (X*)0);
+ test_copy_backward (N, dummy, RandomAccessIter<UserClass>(),
+ (UserClass*)0);
}
}
@@ -343,7 +354,7 @@
"BidirectionalIterator test disabled");
}
else {
- test_copy_backward (N, BidirIter<X>(), (X*)0);
+ test_copy_backward (N, BidirIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_rnd_iter) {
@@ -351,7 +362,7 @@
"RandomAccessIterator test disabled");
}
else {
- test_copy_backward (N, RandomAccessIter<X>(), (X*)0);
+ test_copy_backward (N, RandomAccessIter<UserClass>(), (UserClass*)0);
}
}
Modified: incubator/stdcxx/trunk/tests/algorithms/25.equal.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.equal.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.equal.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.equal.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -24,6 +31,7 @@
#include <cstddef> // for size_t
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()...
/**************************************************************************/
@@ -66,35 +74,36 @@
rw_info (0, 0, 0, "std::equal (%s, %1$s, %s%{?}, %s%{;})",
it1name, it2name, 0 != predicate, predicate);
- // generate sequential values for each default constructed X
+ // generate sequential values for each default constructed UserClass
// for both lists
- X::gen_ = gen_seq_2lists;
+ UserClass::gen_ = gen_seq_2lists;
// use ::operator new() to prevent default initialization
- X *buf1 = _RWSTD_STATIC_CAST (X*, ::operator new (N * sizeof (X)));
- X *buf2 = _RWSTD_STATIC_CAST (X*, ::operator new (N * sizeof (X)));
+ const std::size_t size = N * sizeof (UserClass);
+ UserClass *buf1 = _RWSTD_STATIC_CAST (UserClass*, ::operator new (size));
+ UserClass *buf2 = _RWSTD_STATIC_CAST (UserClass*, ::operator new (size));
const std::size_t mid_inx = N / 2;
for (std::size_t i = 0; i != N; ++i) {
- // default-construct a new X at the end of the array
- new (buf1 + i) X ();
+ // default-construct a new UserClass at the end of the array
+ new (buf1 + i) UserClass ();
// build a nearly identical array only missing the N/2-th element
if (i != mid_inx)
- new (buf2 + i) X ();
+ new (buf2 + i) UserClass ();
}
- new (buf2 + mid_inx) X ();
+ new (buf2 + mid_inx) UserClass ();
for (std::size_t i = 0; i != N; ++i) {
// exercise 25.1.8 - std::equal()
- std::size_t last_n_op_eq = X::n_total_op_eq_;
+ std::size_t last_n_op_eq = UserClass::n_total_op_eq_;
- X* const buf1_end = buf1 + i + 1;
- X* const buf2_end = buf2 + i + 1;
+ UserClass* const buf1_end = buf1 + i + 1;
+ UserClass* const buf2_end = buf2 + i + 1;
const InputIterator1 first1 =
make_iter (buf1, buf1, buf1_end, it1_dummy);
@@ -108,7 +117,8 @@
bool res;
if (predicate) {
- res = std::equal (first1, last1, first2, std::equal_to<X>());
+ res = std::equal (first1, last1, first2,
+ std::equal_to<UserClass>());
}
else {
res = std::equal (first1, last1, first2);
@@ -126,13 +136,13 @@
equal_expected, res);
// verify 25.1.8, p2
- success = X::n_total_op_eq_ - last_n_op_eq <= (N + 1);
+ success = UserClass::n_total_op_eq_ - last_n_op_eq <= (N + 1);
rw_assert (success, 0, __LINE__,
"%zu. equal(%s, %2$s, %s%s%{?}, %s%{;}) complexity: "
"%zu <= %zu",
i + 1, it1name, it2name,
0 != predicate, predicate,
- X::n_total_op_eq_, i + 1);
+ UserClass::n_total_op_eq_, i + 1);
if (!success)
break;
@@ -160,7 +170,8 @@
rw_note (0, __FILE__, __LINE__, "InputIterator test disabled");
}
else {
- test_equal (N, dummy, InputIter<X>((X*)0, (X*)0, (X*)0), (X*)0,
+ test_equal (N, dummy, InputIter<UserClass>((UserClass*)0,
+ (UserClass*)0, (UserClass*)0), (UserClass*)0,
predicate);
}
@@ -168,21 +179,22 @@
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_equal (N, dummy, FwdIter<X>(), (X*)0, predicate);
+ test_equal (N, dummy, FwdIter<UserClass>(), (UserClass*)0, predicate);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- test_equal (N, dummy, BidirIter<X>(), (X*)0, predicate);
+ test_equal (N, dummy, BidirIter<UserClass>(), (UserClass*)0, predicate);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- test_equal (N, dummy, RandomAccessIter<X>(), (X*)0, predicate);
+ test_equal (N, dummy, RandomAccessIter<UserClass>(), (UserClass*)0,
+ predicate);
}
}
@@ -202,28 +214,29 @@
rw_note (0, __FILE__, __LINE__, "InputIterator test disabled");
}
else {
- test_equal (InputIter<X>((X*)0, (X*)0, (X*)0), (X*)0, predicate);
+ test_equal (InputIter<UserClass>((UserClass*)0, (UserClass*)0,
+ (UserClass*)0), (UserClass*)0, predicate);
}
if (rw_opt_no_fwd_iter) {
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_equal (FwdIter<X>(), (X*)0, predicate);
+ test_equal (FwdIter<UserClass>(), (UserClass*)0, predicate);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- test_equal (BidirIter<X>(), (X*)0, predicate);
+ test_equal (BidirIter<UserClass>(), (UserClass*)0, predicate);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- test_equal (RandomAccessIter<X>(), (X*)0, predicate);
+ test_equal (RandomAccessIter<UserClass>(), (UserClass*)0, predicate);
}
}
@@ -239,7 +252,7 @@
rw_note (0, __FILE__, __LINE__, "Predicate test disabled");
}
else {
- test_equal ("std::equal_to<X>");
+ test_equal ("std::equal_to<UserClass>");
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp Wed Feb 21 07:58:53 2007
@@ -6,22 +6,23 @@
*
***************************************************************************
*
- * Copyright 2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
*
- * Copyright 2006 Rogue Wave Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2006 Rogue Wave Software.
*
**************************************************************************/
@@ -37,6 +38,7 @@
#include <cstring> // for strlen()
#include <alg_test.h> // for iterators
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test(), ...
/**************************************************************************/
@@ -71,7 +73,7 @@
// implementation of the algorithms
struct Y
{
- X xval_;
+ UserClass xval_;
// not Default-Constructible
Y (char val, int /*dummy */): xval_ () {
@@ -89,13 +91,13 @@
inline conv_to_bool
-operator< (const X &lhs, const Y &rhs)
+operator< (const UserClass &lhs, const Y &rhs)
{
return conv_to_bool::make (lhs < rhs.xval_);
}
inline conv_to_bool
-operator< (const Y &lhs, const X &rhs)
+operator< (const Y &lhs, const UserClass &rhs)
{
return conv_to_bool::make (lhs.xval_ < rhs);
}
@@ -111,12 +113,12 @@
// return a type other than bool but one that is implicitly
// convertible to bool to detect incorrect assumptions
- conv_to_bool operator() (const X &lhs, const Y &rhs) {
+ conv_to_bool operator() (const UserClass &lhs, const Y &rhs) {
++funcalls_;
return conv_to_bool::make (lhs < rhs.xval_);
}
- conv_to_bool operator() (const Y &lhs, const X &rhs) {
+ conv_to_bool operator() (const Y &lhs, const UserClass &rhs) {
++funcalls_;
return conv_to_bool::make (lhs.xval_ < rhs);
}
@@ -142,7 +144,7 @@
{
RW_ASSERT (0 != src_str);
- const char* const tname = "X";
+ const char* const tname = "UserClass";
const char* const itname = type_name (it, (T*)0);
const char* const funname = predicate ? "LessThan" : "operator<()";
@@ -213,7 +215,8 @@
const char* const itname = type_name (it, (T*)0);
const char* const funname = predicate ? "LessThan" : "operator<()";
- rw_info (0, 0, 0, "std::equal_range (%s, %1$s, const X&%{?}, %s%{;})",
+ rw_info (0, 0, 0,
+ "std::equal_range (%s, %1$s, const UserClass&%{?}, %s%{;})",
itname, predicate, funname);
#define TEST(str, val, loff, uoff, comp) \
@@ -275,7 +278,7 @@
rw_info (0, 0, 0, "template <class %s, class %s%{?}, class %s%{;}> "
"std::pair<%1$s, %1$s> std::equal_range "
"(%1$s, %1$s, const %2$s&%{?}, %s%{;})",
- "ForwardIterator", "X", predicate, "Compare",
+ "ForwardIterator", "UserClass", predicate, "Compare",
predicate, "Compare");
if (rw_opt_no_fwd_iter) {
@@ -305,14 +308,14 @@
static int
run_test (int, char*[])
{
- test_equal_range ((X*)0, false);
+ test_equal_range ((UserClass*)0, false);
if (rw_opt_no_predicate) {
rw_note (0, __FILE__, __LINE__,
"test of the Predicate form of std::equal_range disabled");
}
else {
- test_equal_range ((X*)0, true);
+ test_equal_range ((UserClass*)0, true);
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -23,6 +30,7 @@
#include <cstddef> // for size_t
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()
/**************************************************************************/
@@ -54,7 +62,7 @@
const T*)
{
static const char* const itname = type_name (dummy_iter, (T*)0);
- static const char* const tname = "X";
+ static const char* const tname = "UserClass";
rw_info (0, 0, 0, "void std::fill (%s, %1$s, const %s&)", itname, tname);
@@ -120,7 +128,7 @@
{
static const char* const itname = type_name (dummy_iter, (T*)0);
static const char* const szname = "Size<int>";
- static const char* const tname = "X";
+ static const char* const tname = "UserClass";
rw_info (0, 0, 0, "void std::fill_n (%s, %s, const %s&)",
itname, szname, tname);
@@ -199,21 +207,21 @@
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_fill (N, FwdIter<X>(), (X*)0);
+ test_fill (N, FwdIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- test_fill (N, BidirIter<X>(), (X*)0);
+ test_fill (N, BidirIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- test_fill (N, RandomAccessIter<X>(), (X*)0);
+ test_fill (N, RandomAccessIter<UserClass>(), (UserClass*)0);
}
}
@@ -231,28 +239,30 @@
rw_note (0, __FILE__, __LINE__, "OutputIterator test disabled");
}
else {
- test_fill_n (N, OutputIter<X>(0, 0, 0), (Size<int>*)0, (X*)0);
+ test_fill_n (N, OutputIter<UserClass>(0, 0, 0), (Size<int>*)0,
+ (UserClass*)0);
}
if (rw_opt_no_fwd_iter) {
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_fill_n (N, FwdIter<X>(), (Size<int>*)0, (X*)0);
+ test_fill_n (N, FwdIter<UserClass>(), (Size<int>*)0, (UserClass*)0);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- test_fill_n (N, BidirIter<X>(), (Size<int>*)0, (X*)0);
+ test_fill_n (N, BidirIter<UserClass>(), (Size<int>*)0, (UserClass*)0);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- test_fill_n (N, RandomAccessIter<X>(), (Size<int>*)0, (X*)0);
+ test_fill_n (N, RandomAccessIter<UserClass>(), (Size<int>*)0,
+ (UserClass*)0);
}
}
Modified: incubator/stdcxx/trunk/tests/algorithms/25.find.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.find.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.find.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.find.cpp Wed Feb 21 07:58:53 2007
@@ -6,22 +6,23 @@
*
***************************************************************************
*
- * Copyright 2005-2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
*
- * Copyright 2000-2006 Rogue Wave Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2000-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -29,6 +30,7 @@
#include <cstring> // for size_t, strlen()
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()
/**************************************************************************/
@@ -95,7 +97,7 @@
InputIterator dummy_iter,
bool test_pred)
{
- static const char* const itname = type_name (dummy_iter, (X*)0);
+ static const char* const itname = type_name (dummy_iter, (UserClass*)0);
static const char* const pname = test_pred ? "Predicate" : "operator==";
const std::size_t nsrc = std::strlen (src);
@@ -105,9 +107,9 @@
findoff = nsrc;
// create always at least 1 element (used to test failed searches)
- X* const tsrc = X::from_char (src, nsrc + 1);
- X* const src_begin = tsrc;
- X* const src_end = tsrc + nsrc;
+ UserClass* const tsrc = UserClass::from_char (src, nsrc + 1);
+ UserClass* const src_begin = tsrc;
+ UserClass* const src_end = tsrc + nsrc;
// current [first, last)
const InputIterator first (src_begin, src_begin, src_end);
@@ -116,13 +118,13 @@
// get a reference to the object to find (when findoff == nsrc
// the sought for element is outside the source range and won't
// be found)
- const X &to_find = tsrc [findoff];
+ const UserClass &to_find = tsrc [findoff];
// construct a predicate object to use with find_if
- const Predicate<X> pred (to_find, 0 /* dummy */);
+ const Predicate<UserClass> pred (to_find, 0 /* dummy */);
// reset the operator==() counter
- X::n_total_op_eq_ = 0;
+ UserClass::n_total_op_eq_ = 0;
// invoke find() or find_if(), depending on the predicate flag
const InputIterator res = test_pred ?
@@ -148,7 +150,8 @@
// The complexity when find is successful is actually
// (res - first) applications of the corresponding predicate.
- const std::size_t npreds = test_pred ? pred.funcalls_ : X::n_total_op_eq_;
+ const std::size_t npreds =
+ test_pred ? pred.funcalls_ : UserClass::n_total_op_eq_;
rw_assert (npreds <= findoff + 1, 0, line,
"line %d: find%{?}_if%{;} (%s = \"%s\", ..., '%c') "
@@ -164,10 +167,10 @@
template <class InputIterator>
void test_find (InputIterator dummy_iter, bool test_pred)
{
- static const char* const itname = type_name (dummy_iter, (X*)0);
+ static const char* const itname = type_name (dummy_iter, (UserClass*)0);
rw_info (0, 0, 0, "std::find%{?}_if%{;} (%s, %2$s, "
- "%{?}Predicate%{:}const X&%{;})",
+ "%{?}Predicate%{:}const UserClass&%{;})",
test_pred, itname, test_pred);
#define TEST(src, off_find) \
@@ -221,31 +224,31 @@
rw_note (0, __FILE__, __LINE__, "InputIterator test disabled");
}
else {
- test_find (InputIter<X>(0, 0, 0), test_pred);
+ test_find (InputIter<UserClass>(0, 0, 0), test_pred);
}
if (rw_opt_no_fwd_iter) {
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_find (ConstFwdIter<X>(), test_pred);
- test_find (FwdIter<X>(), test_pred);
+ test_find (ConstFwdIter<UserClass>(), test_pred);
+ test_find (FwdIter<UserClass>(), test_pred);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- test_find (ConstBidirIter<X>(), test_pred);
- test_find (BidirIter<X>(), test_pred);
+ test_find (ConstBidirIter<UserClass>(), test_pred);
+ test_find (BidirIter<UserClass>(), test_pred);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- test_find (ConstRandomAccessIter<X>(), test_pred);
- test_find (RandomAccessIter<X>(), test_pred);
+ test_find (ConstRandomAccessIter<UserClass>(), test_pred);
+ test_find (RandomAccessIter<UserClass>(), test_pred);
}
}
Modified: incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -24,6 +31,7 @@
#include <cstring> // for size_t, strlen()
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()
/**************************************************************************/
@@ -183,7 +191,7 @@
#define TEST(src, fnd, off_res) \
do_test (__LINE__, src, fnd, std::size_t (off_res), \
- dummy_iter1, dummy_iter2, (X*)0, predicate)
+ dummy_iter1, dummy_iter2, (UserClass*)0, predicate)
// +------------------ subject sequence
// | +--- sequence to be found
@@ -282,21 +290,22 @@
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- run_test_find_end (FwdIter<X>(), (X*)0, predicate);
+ run_test_find_end (FwdIter<UserClass>(), (UserClass*)0, predicate);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- run_test_find_end (BidirIter<X>(), (X*)0, predicate);
+ run_test_find_end (BidirIter<UserClass>(), (UserClass*)0, predicate);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- run_test_find_end (RandomAccessIter<X>(), (X*)0, predicate);
+ run_test_find_end (RandomAccessIter<UserClass>(), (UserClass*)0,
+ predicate);
}
}
@@ -311,7 +320,7 @@
rw_note (0, __FILE__, __LINE__, "Predicate test disabled");
}
else {
- test_find_end ("std::equal_to<X>");
+ test_find_end ("std::equal_to<UserClass>");
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.find.first.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.find.first.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.find.first.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.find.first.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -23,6 +30,7 @@
#include <cstring> // for size_t, strlen()
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test
/**************************************************************************/
@@ -196,7 +204,7 @@
#define TEST(src, fnd, off_res) \
do_test (__LINE__, src, fnd, std::size_t (off_res), \
- dummy_iter1, dummy_iter2, (X*)0, pred)
+ dummy_iter1, dummy_iter2, (UserClass*)0, pred)
// +------------------ subject sequence
// | +--- sequence to be found
@@ -299,28 +307,28 @@
"ForwardIterator1", "ForwardIterator2",
0 != test_predicate, "Predicate");
- const EqualityPredicate<X, X>* const pred = test_predicate ?
- (EqualityPredicate<X, X>*)1 : (EqualityPredicate<X, X>*)0;
+ typedef EqualityPredicate<UserClass, UserClass> EqPred;
+ const EqPred* const pred = test_predicate ? (EqPred*)1 : (EqPred*)0;
if (rw_opt_no_fwd_iter) {
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- run_test (FwdIter<X>(), (X*)0, pred);
+ run_test (FwdIter<UserClass>(), (UserClass*)0, pred);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- run_test (BidirIter<X>(), (X*)0, pred);
+ run_test (BidirIter<UserClass>(), (UserClass*)0, pred);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- run_test (RandomAccessIter<X>(), (X*)0, pred);
+ run_test (RandomAccessIter<UserClass>(), (UserClass*)0, pred);
}
}
Modified: incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -23,6 +30,7 @@
#include <cstddef> // for ptrdiff_t
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test(), ...
/**************************************************************************/
@@ -53,7 +61,7 @@
// from being default constructible
ConstFunction (int, int): FunctionBase (true) { }
- void operator() (X val) /* not const */ {
+ void operator() (UserClass val) /* not const */ {
++funcalls_;
sum_ += val.val_;
}
@@ -68,7 +76,7 @@
// from being default constructible
MutableFunction (int, int): FunctionBase (false) { }
- void operator() (X &val) /* not const */ {
+ void operator() (UserClass &val) /* not const */ {
++funcalls_;
val.val_ = -val.val_;
}
@@ -86,16 +94,16 @@
rw_info (0, 0, 0, "std::for_each (%s, %1$s, %s)", itname, fnname);
- // generate sequential values for each default constructed X
- X::gen_ = gen_seq;
+ // generate sequential values for each default constructed UserClass
+ UserClass::gen_ = gen_seq;
- X *buf = new X [N];
+ UserClass *buf = new UserClass [N];
const int first_val = buf [0].val_;
for (std::size_t i = 0; i != N; ++i) {
- X* const buf_end = buf + i;
+ UserClass* const buf_end = buf + i;
const InputIterator first (buf, buf, buf_end);
const InputIterator last (buf_end, buf_end, buf_end);
@@ -182,34 +190,44 @@
rw_note (0, __FILE__, __LINE__, "InputIterator test disabled");
}
else {
- test_for_each (N, InputIter<X>(0, 0, 0), (X*)0, (ConstFunction*)0);
+ test_for_each (N, InputIter<UserClass>(0, 0, 0), (UserClass*)0,
+ (ConstFunction*)0);
}
if (rw_opt_no_fwd_iter) {
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_for_each (N, ConstFwdIter<X>(), (X*)0, (ConstFunction*)0);
- test_for_each (N, FwdIter<X>(), (X*)0, (ConstFunction*)0);
- test_for_each (N, FwdIter<X>(), (X*)0, (MutableFunction*)0);
+ test_for_each (N, ConstFwdIter<UserClass>(), (UserClass*)0,
+ (ConstFunction*)0);
+ test_for_each (N, FwdIter<UserClass>(), (UserClass*)0,
+ (ConstFunction*)0);
+ test_for_each (N, FwdIter<UserClass>(), (UserClass*)0,
+ (MutableFunction*)0);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- test_for_each (N, ConstBidirIter<X>(), (X*)0, (ConstFunction*)0);
- test_for_each (N, BidirIter<X>(), (X*)0, (ConstFunction*)0);
- test_for_each (N, BidirIter<X>(), (X*)0, (MutableFunction*)0);
+ test_for_each (N, ConstBidirIter<UserClass>(), (UserClass*)0,
+ (ConstFunction*)0);
+ test_for_each (N, BidirIter<UserClass>(), (UserClass*)0,
+ (ConstFunction*)0);
+ test_for_each (N, BidirIter<UserClass>(), (UserClass*)0,
+ (MutableFunction*)0);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- test_for_each (N, ConstRandomAccessIter<X>(), (X*)0, (ConstFunction*)0);
- test_for_each (N, RandomAccessIter<X>(), (X*)0, (ConstFunction*)0);
- test_for_each (N, RandomAccessIter<X>(), (X*)0, (MutableFunction*)0);
+ test_for_each (N, ConstRandomAccessIter<UserClass>(), (UserClass*)0,
+ (ConstFunction*)0);
+ test_for_each (N, RandomAccessIter<UserClass>(), (UserClass*)0,
+ (ConstFunction*)0);
+ test_for_each (N, RandomAccessIter<UserClass>(), (UserClass*)0,
+ (MutableFunction*)0);
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -23,6 +30,7 @@
#include <cstddef> // for size_t
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()
/**************************************************************************/
@@ -43,19 +51,19 @@
_RWSTD_SPECIALIZED_CLASS
-struct Generator<X>
+struct Generator<UserClass>
{
// dummy arguments provided to prevent Generator
// from being DefaultConstructible
Generator (int, int /* dummy */) {
// use the generator of sequential values
- X::gen_ = gen_seq;
+ UserClass::gen_ = gen_seq;
}
- X operator() () /* non-const */ {
- // return a default-constructed X intialized
+ UserClass operator() () /* non-const */ {
+ // return a default-constructed UserClass intialized
// to the next sequential value
- return X ();
+ return UserClass ();
}
};
@@ -96,7 +104,7 @@
// generate sequential values for each default constructed T
T::gen_ = gen_seq;
- T *buf = new X [N];
+ T *buf = new UserClass [N];
for (std::size_t i = 0; i < N; ++i) {
@@ -167,7 +175,7 @@
// generate sequential values for each default constructed T
T::gen_ = gen_seq;
- T *buf = new X [N];
+ T *buf = new UserClass [N];
for (std::size_t i = 0; i <= N; ++i) {
@@ -238,21 +246,21 @@
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_generate (N, FwdIter<X>(), (X*)0);
+ test_generate (N, FwdIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- test_generate (N, BidirIter<X>(), (X*)0);
+ test_generate (N, BidirIter<UserClass>(), (UserClass*)0);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- test_generate (N, RandomAccessIter<X>(), (X*)0);
+ test_generate (N, RandomAccessIter<UserClass>(), (UserClass*)0);
}
}
@@ -270,28 +278,31 @@
rw_note (0, __FILE__, __LINE__, "OutputIterator test disabled");
}
else {
- test_generate_n (N, OutputIter<X>(0, 0, 0), (Size<int>*)0, (X*)0);
+ test_generate_n (N, OutputIter<UserClass>(0, 0, 0), (Size<int>*)0,
+ (UserClass*)0);
}
if (rw_opt_no_fwd_iter) {
rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled");
}
else {
- test_generate_n (N, FwdIter<X>(), (Size<int>*)0, (X*)0);
+ test_generate_n (N, FwdIter<UserClass>(), (Size<int>*)0, (UserClass*)0);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled");
}
else {
- test_generate_n (N, BidirIter<X>(), (Size<int>*)0, (X*)0);
+ test_generate_n (N, BidirIter<UserClass>(), (Size<int>*)0,
+ (UserClass*)0);
}
if (rw_opt_no_rnd_iter) {
rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled");
}
else {
- test_generate_n (N, RandomAccessIter<X>(), (Size<int>*)0, (X*)0);
+ test_generate_n (N, RandomAccessIter<UserClass>(), (Size<int>*)0,
+ (UserClass*)0);
}
}
Modified: incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -28,6 +35,7 @@
#include <cstring> // for strlen, size_t
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()
/**************************************************************************/
@@ -437,14 +445,14 @@
static int run_test (int, char*[])
{
- test_heap_operations ((X*)0, (Less<X>*)0);
+ test_heap_operations ((UserClass*)0, (Less<UserClass>*)0);
if (rw_opt_no_predicate) {
rw_note (0, __FILE__, __LINE__,
"heap operations predicate test disabled");
}
else {
- test_heap_operations ((X*)0, (Less<X>*)1);
+ test_heap_operations ((UserClass*)0, (Less<UserClass>*)1);
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -23,6 +30,7 @@
#include <cstring> // for strlen, size_t
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()
/**************************************************************************/
@@ -296,14 +304,14 @@
static int run_test (int, char*[])
{
- test_includes ((X*)0, (Less<X>*)0);
+ test_includes ((UserClass*)0, (Less<UserClass>*)0);
if (rw_opt_no_predicate) {
rw_note (0, __FILE__, __LINE__,
"std::includes predicate test disabled");
}
else {
- test_includes ((X*)0, (Less<X>*)1);
+ test_includes ((UserClass*)0, (Less<UserClass>*)1);
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -23,6 +30,7 @@
#include <cstring> // for strlen, size_t
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()
/**************************************************************************/
@@ -291,14 +299,14 @@
static int run_test (int, char*[])
{
- test_lex_compare ((X*)0, (Less<X>*)0);
+ test_lex_compare ((UserClass*)0, (Less<UserClass>*)0);
if (rw_opt_no_predicate) {
rw_note (0, __FILE__, __LINE__,
"std::lexicographical_compare predicate test disabled");
}
else {
- test_lex_compare ((X*)0, (Less<X>*)1);
+ test_lex_compare ((UserClass*)0, (Less<UserClass>*)1);
}
return 0;
Modified: incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http:www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
***************************************************************************/
@@ -24,6 +31,7 @@
#include <csetjmp> // for setjmp, longjmp
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test()
/**************************************************************************/
@@ -54,8 +62,8 @@
#endif // _RWSTD_NO_EXCEPTIONS
- return (*_RWSTD_STATIC_CAST (const X*, x)).val_
- - (*_RWSTD_STATIC_CAST (const X*, y)).val_;
+ return (*_RWSTD_STATIC_CAST (const UserClass*, x)).val_
+ - (*_RWSTD_STATIC_CAST (const UserClass*, y)).val_;
}
}
@@ -71,8 +79,8 @@
#endif // _RWSTD_NO_EXCEPTIONS
- return (*_RWSTD_STATIC_CAST (const X*, x)).val_
- - (*_RWSTD_STATIC_CAST (const X*, y)).val_;
+ return (*_RWSTD_STATIC_CAST (const UserClass*, x)).val_
+ - (*_RWSTD_STATIC_CAST (const UserClass*, y)).val_;
}
}
@@ -85,8 +93,8 @@
std::size_t nsrc,
bool cxx)
{
- X* const xsrc = X::from_char (src, nsrc);
- X* const xsrc_end = xsrc + nsrc;
+ UserClass* const xsrc = UserClass::from_char (src, nsrc);
+ UserClass* const xsrc_end = xsrc + nsrc;
RW_ASSERT (0 == nsrc || 0 != xsrc);
if (cxx)
@@ -166,24 +174,25 @@
std::size_t res,
bool cxx)
{
- X* const xsrc = X::from_char (src, nsrc, true); // must be sorted
+ UserClass* const xsrc = UserClass::from_char (src, nsrc,
+ true); // must be sorted
RW_ASSERT (0 == nsrc || 0 != xsrc);
- X key;
+ UserClass key;
key.val_ = key_val;
const void* result = cxx ?
std::bsearch (&key, xsrc, nsrc, sizeof *xsrc, cxx_comp)
: std::bsearch (&key, xsrc, nsrc, sizeof *xsrc, c_comp);
- const X* exp_res = res == _RWSTD_SIZE_MAX ? 0 : xsrc + res;
+ const UserClass* exp_res = res == _RWSTD_SIZE_MAX ? 0 : xsrc + res;
bool success = result == exp_res;
rw_assert (success, 0, line,
"line %d: extern \"C%{?}++%{;}\" bsearch (\"%s\", %#c, ...) "
"== %p, got %p, difference is %td elements",
__LINE__, cxx, src, key_val, result, exp_res,
- _RWSTD_STATIC_CAST (const X*, result) - exp_res);
+ _RWSTD_STATIC_CAST (const UserClass*, result) - exp_res);
delete[] xsrc;
}
Modified: incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp?view=diff&rev=510071&r1=510070&r2=510071
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp Wed Feb 21 07:58:53 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -31,16 +38,17 @@
#include <cstring>
#include <alg_test.h>
+#include <rw_value.h> // for UserClass
#include <driver.h>
/**************************************************************************/
-// distinct and not Less-Than-Comparable with class X (except as
+// distinct and not Less-Than-Comparable with class UserClass (except as
// defined below) to detect unwarranted assumptions made by the
// implementation of the algorithms
struct Y
{
- X xval_;
+ UserClass xval_;
// not Default-Constructible
Y (int /* dummy */, int /*dummy */): xval_ () { }
@@ -54,7 +62,7 @@
};
inline conv_to_bool
-operator< (const X &lhs, const Y &rhs)
+operator< (const UserClass &lhs, const Y &rhs)
{
return conv_to_bool::make (lhs < rhs.xval_);
}
@@ -72,7 +80,7 @@
// return a type other than bool but one that is implicitly
// convertible to bool to detect incorrect assumptions
- conv_to_bool operator() (const X &lhs, const Y &rhs) {
+ conv_to_bool operator() (const UserClass &lhs, const Y &rhs) {
++funcalls_;
return conv_to_bool::make (lhs < rhs.xval_);
}
@@ -98,7 +106,7 @@
RW_ASSERT (0 != src_str);
const std::size_t nsrc = std::strlen (src_str);
- X* const xsrc = X::from_char (src_str, nsrc);
+ UserClass* const xsrc = UserClass::from_char (src_str, nsrc);
if (nsrc < result_off)
result_off = nsrc;
@@ -117,8 +125,8 @@
// when `predicate' is true
const LessThan comp (0, 0 /* dummy arguments */);
- // reset the counter of invocations of X::operator<()
- X::n_total_op_lt_ = 0;
+ // reset the counter of invocations of UserClass::operator<()
+ UserClass::n_total_op_lt_ = 0;
// invoke the appropriate form of the algorithm, storing
// the resturned value
@@ -141,7 +149,7 @@
// verify complexity
const std::size_t funcalls = predicate
- ? LessThan::funcalls_ : X::n_total_op_lt_;
+ ? LessThan::funcalls_ : UserClass::n_total_op_lt_;
rw_assert (funcalls <= ncomp, 0, line,
"lower_bound(%s = \"%s\", ...%{?}%#c%{;}) complexity: "
@@ -164,7 +172,8 @@
std::size_t (comp), (ForwardIterator*)0, \
itname, predicate)
- rw_info (0, 0, 0, "std::lower_bound (%s, %1$s, const X&%{?}, %s%{;})",
+ rw_info (0, 0, 0,
+ "std::lower_bound (%s, %1$s, const UserClass&%{?}, %s%{;})",
itname, predicate, "LessThan");
// +--------------- source sequence
@@ -213,29 +222,30 @@
test_lower_bound (bool predicate)
{
rw_info (0, 0, 0, "template <class %s, class %s%{?}, class %s%{;}> "
- "std::lower_bound (%1$s, %1$s, const X&%{?}, %4$s%{;})",
- "ForwardIterator", "X", predicate, "Compare", predicate);
+ "std::lower_bound (%1$s, %1$s, const UserClass&%{?}, %4$s%{;})",
+ "ForwardIterator", "UserClass", predicate, "Compare", predicate);
if (rw_opt_no_fwd_iter) {
rw_note (0, 0, 0, "ForwardIterator test disabled");
}
else {
- test_lower_bound ((FwdIter<X>*)0, "ForwardIterator", predicate);
+ test_lower_bound ((FwdIter<UserClass>*)0, "ForwardIterator", predicate);
}
if (rw_opt_no_bidir_iter) {
rw_note (0, 0, 0, "BidirectionalIterator test disabled");
}
else {
- test_lower_bound ((BidirIter<X>*)0, "BidirectionalIterator", predicate);
+ test_lower_bound ((BidirIter<UserClass>*)0, "BidirectionalIterator",
+ predicate);
}
if (rw_opt_no_fwd_iter) {
rw_note (0, 0, 0, "RandomAccessIterator test disabled");
}
else {
- test_lower_bound ((RandomAccessIter<X>*)0, "RandomAccessIterator",
- predicate);
+ test_lower_bound ((RandomAccessIter<UserClass>*)0,
+ "RandomAccessIterator", predicate);
}
}
Re: svn commit: r510071 [1/5] - in /incubator/stdcxx/trunk/tests:
algorithms/ containers/ include/ numerics/ self/ src/ utilities/
Posted by Martin Sebor <se...@roguewave.com>.
faridz@apache.org wrote:
> Author: faridz
> Date: Wed Feb 21 07:58:53 2007
> New Revision: 510071
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=510071
> Log:
> 2007-02-21 Farid Zaripov <fa...@kyiv.vdiweb.com>
>
> ChangeLog:
> * rw_value.h (struct X): Renamed to struct UserClass.
> * value.cpp: The same.
> * 25.adjacent.find.cpp: Updated copyright notice.
Thanks for updating the copyright/license notices! There are
still plenty left for me to do but this will help quite a bit!
Martin