author | Huie-Ying Lee <huieying.lee@oracle.com> |
Thu, 17 Nov 2011 16:59:01 -0800 | |
changeset 588 | a72cfdd57701 |
parent 402 | 94ae4d75524c |
permissions | -rw-r--r-- |
402
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
1 |
--- stdcxx-4.2.1/tests/numerics/26.gslice.array.cassign.cpp 2011-01-05 09:49:03.984545142 -0500 |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
2 |
+++ stdcxx-4.2.1/tests/numerics/26.gslice.array.cassign.cpp 2011-01-04 19:01:52.275234131 -0500 |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
3 |
@@ -0,0 +1,585 @@ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
4 |
+/*************************************************************************** |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
5 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
6 |
+ * 26.gslice.array.cassign.cpp - tests exercising valarray computed assignment |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
7 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
8 |
+ * $Id$ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
9 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
10 |
+ *************************************************************************** |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
11 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
12 |
+ * Licensed to the Apache Software Foundation (ASF) under one or more |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
13 |
+ * contributor license agreements. See the NOTICE file distributed |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
14 |
+ * with this work for additional information regarding copyright |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
15 |
+ * ownership. The ASF licenses this file to you under the Apache |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
16 |
+ * License, Version 2.0 (the "License"); you may not use this file |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
17 |
+ * except in compliance with the License. You may obtain a copy of |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
18 |
+ * the License at |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
19 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
20 |
+ * http://www.apache.org/licenses/LICENSE-2.0 |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
21 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
22 |
+ * Unless required by applicable law or agreed to in writing, software |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
23 |
+ * distributed under the License is distributed on an "AS IS" BASIS, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
24 |
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
25 |
+ * implied. See the License for the specific language governing |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
26 |
+ * permissions and limitations under the License. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
27 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
28 |
+ * Copyright (C) 2007-2008 Rogue Wave Software, Inc. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
29 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
30 |
+ *************************************************************************** |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
31 |
+ * http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/numerics/26.gslice.array.cassign.cpp?view=markup&pathrev=663373 |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
32 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
33 |
+ *************************************************************************** |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
34 |
+ * 2008-06-04 Travis Vitek <[email protected]> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
35 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
36 |
+ * STDCXX-901 |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
37 |
+ * * include/valarray (gslice_array<>::operator=): Don't skip |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
38 |
+ * loop body if the slice is reset but has one element. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
39 |
+ * (gslice_array<>::operator*=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
40 |
+ * (gslice_array<>::operator/=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
41 |
+ * (gslice_array<>::operator+=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
42 |
+ * (gslice_array<>::operator-=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
43 |
+ * (gslice_array<>::operator%=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
44 |
+ * (gslice_array<>::operator^=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
45 |
+ * (gslice_array<>::operator&=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
46 |
+ * (gslice_array<>::operator|=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
47 |
+ * (gslice_array<>::operator<<=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
48 |
+ * (gslice_array<>::operator>>=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
49 |
+ * (valarray<>::ctor): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
50 |
+ * (valarray<>::operator=): Ditto. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
51 |
+ * * tests/numerics/26.gslice.array.cassign.cpp: New test |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
52 |
+ * for slice computed assignment operators. |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
53 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
54 |
+ *************************************************************************** |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
55 |
+ * |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
56 |
+ **************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
57 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
58 |
+#include <cstdlib> // for free(), strtod(), size_t |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
59 |
+#include <valarray> // for indirect_array, valarray |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
60 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
61 |
+#include <rw_value.h> // for UserClass |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
62 |
+#include <driver.h> // for rw_test() |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
63 |
+#include <rw_printf.h> // for rw_asnprintf() |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
64 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
65 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
66 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
67 |
+// returns an array of size elements of type T constructed from a string |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
68 |
+// of comma-separated values |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
69 |
+static std::valarray<std::size_t> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
70 |
+make_array (const char *s) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
71 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
72 |
+ std::size_t buf [256]; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
73 |
+ bool repeat = false; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
74 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
75 |
+ std::size_t i = 0; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
76 |
+ while (s && *s) { |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
77 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
78 |
+ char *end; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
79 |
+ unsigned long val = std::strtoul (s, &end, 10); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
80 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
81 |
+ RW_ASSERT ('\0' == *end || ',' == *end || '@' == *end); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
82 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
83 |
+ if (!repeat) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
84 |
+ { |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
85 |
+ buf [i++] = std::size_t (val); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
86 |
+ } |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
87 |
+ else |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
88 |
+ { |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
89 |
+ const std::size_t n = buf [i-1]; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
90 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
91 |
+ for (std::size_t j = 0; j < (val - 1); ++j) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
92 |
+ buf [i+j] = n; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
93 |
+ i += (val - 1); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
94 |
+ } |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
95 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
96 |
+ if ('\0' == *end) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
97 |
+ break; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
98 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
99 |
+ s = end + 1; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
100 |
+ repeat = '@' == *end; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
101 |
+ } |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
102 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
103 |
+ return std::valarray<std::size_t>(buf, i); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
104 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
105 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
106 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
107 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
108 |
+void |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
109 |
+test_op_assign (void*, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
110 |
+ void (std::gslice_array<std::size_t>::*op_assign)(const std::valarray<std::size_t>&) const, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
111 |
+ const char *tname, // T's type name |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
112 |
+ const char *opname, // which assignment operator |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
113 |
+ int line, // test case line number |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
114 |
+ std::size_t start, // start index of slice |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
115 |
+ const char *length_str,// number of strides |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
116 |
+ const char *stride_str,// length of stride |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
117 |
+ const char *lhs_str, // original array |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
118 |
+ const char *rhs_str, // right hand side of assignment |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
119 |
+ const char *res_str) // result of assignment |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
120 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
121 |
+ // create an array of values from the string length_str |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
122 |
+ // representing the length array of the slice |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
123 |
+ const std::valarray<std::size_t> lengths (make_array (length_str)); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
124 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
125 |
+ // create an array of values from the string stride_str |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
126 |
+ // representing the stride array of the slice |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
127 |
+ const std::valarray<std::size_t> strides (make_array (stride_str)); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
128 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
129 |
+ // valarray(s)[gslice(start, length, stride)] op= rhs |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
130 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
131 |
+ const std::gslice gsl (start, lengths, strides); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
132 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
133 |
+ // create an array of values from the string lhs_str |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
134 |
+ // representing the left-hand side array before slicing |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
135 |
+ /* const */ std::valarray<std::size_t> lhs_va (make_array (lhs_str)); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
136 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
137 |
+ // create an array of values from the string rhs_str |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
138 |
+ // representing the right-hand side argument of the assignment |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
139 |
+ const std::valarray<std::size_t> rhs_va (make_array (rhs_str)); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
140 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
141 |
+ // create an array of values from the string res_str |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
142 |
+ // representing the result of the assignment |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
143 |
+ const std::valarray<std::size_t> res_va (make_array (res_str)); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
144 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
145 |
+ // verify sizes match |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
146 |
+ RW_ASSERT (lhs_va.size () == res_va.size ()); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
147 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
148 |
+ // take a gslice of lhs_va, this is the lhs of the assignment |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
149 |
+ const std::gslice_array<std::size_t>& lhs_ga = lhs_va [gsl]; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
150 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
151 |
+ char* fname = 0; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
152 |
+ std::size_t size = 0; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
153 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
154 |
+ // format the name of the function call to be used in diagnostic |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
155 |
+ // messages below |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
156 |
+ rw_asnprintf (&fname, &size, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
157 |
+ "gslice_array<%s>(%s) %s std::valarray<%1$s>(%s)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
158 |
+ tname, lhs_str, opname, rhs_str); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
159 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
160 |
+ // invoke the assignment operator through the member pointer |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
161 |
+ (lhs_ga.*op_assign)(rhs_va); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
162 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
163 |
+ // verify the element values |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
164 |
+ for (std::size_t i = 0; i != lhs_va.size (); ++i) { |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
165 |
+ if (!rw_assert (lhs_va [i] == res_va [i], 0, line, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
166 |
+ "line %d. %s: element at index %zu == %zu, got %zu", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
167 |
+ __LINE__, fname, i, res_va [i], lhs_va [i])) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
168 |
+ break; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
169 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
170 |
+ } |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
171 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
172 |
+ std::free (fname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
173 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
174 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
175 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
176 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
177 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
178 |
+#define OP(start, lengths, strides, lhs, rhs, res) \ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
179 |
+ test_op_assign ((T*)0, op, tname, opname, __LINE__, start, lengths, strides, lhs, rhs, res) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
180 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
181 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
182 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
183 |
+void test_mul_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
184 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
185 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
186 |
+ "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
187 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
188 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
189 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
190 |
+ &std::gslice_array<T>::operator*=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
191 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
192 |
+ // +- start |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
193 |
+ // | +- lengths |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
194 |
+ // | | +- strides +- rhs |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
195 |
+ // | | | +- lhs | +- expect |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
196 |
+ // v v v v v v |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
197 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
198 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
199 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
200 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
201 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
202 |
+ OP (0, "1", "1", "1@4", "5", "5,1@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
203 |
+ OP (2, "1", "1", "1@4", "5", "1,1,5,1"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
204 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
205 |
+ OP (1, "2", "1", "1@4", "3,4", "1,3,4,1"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
206 |
+ OP (1, "1", "2", "2@4", "2", "2,4,2,2"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
207 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
208 |
+ OP (0, "2,1", "2,3", "2@4", "3,7", "6,2,14,2"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
209 |
+ OP (1, "1,0", "2,3", "3@4", "3", "3,9,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
210 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
211 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
212 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
213 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
214 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
215 |
+void test_div_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
216 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
217 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
218 |
+ "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
219 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
220 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
221 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
222 |
+ &std::gslice_array<T>::operator/=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
223 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
224 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
225 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
226 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
227 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
228 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
229 |
+ OP (0, "1", "1", "10@4", "5", "2,10@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
230 |
+ OP (2, "1", "1", "12@4", "5", "12,12,2,12"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
231 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
232 |
+ OP (1, "2", "1", "12@4", "3,4", "12,4,3,12"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
233 |
+ OP (1, "1", "2", "6@4", "2", "6,3,6,6"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
234 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
235 |
+ OP (0, "2,1", "2,3", "42@4", "3,7", "14,42,6,42"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
236 |
+ OP (1, "1,0", "2,3", "3@4", "3", "3,1,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
237 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
238 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
239 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
240 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
241 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
242 |
+void test_mod_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
243 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
244 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
245 |
+ "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
246 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
247 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
248 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
249 |
+ &std::gslice_array<T>::operator%=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
250 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
251 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
252 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
253 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
254 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
255 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
256 |
+ OP (0, "1", "1", "10@4", "5", "0,10@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
257 |
+ OP (2, "1", "1", "12@4", "5", "12,12,2,12"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
258 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
259 |
+ OP (1, "2", "1", "12@4", "3,4", "12,0,0,12"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
260 |
+ OP (1, "1", "2", "7@4", "2", "7,1,7,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
261 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
262 |
+ OP (0, "2,1", "2,3", "14@4", "3,7", "2,14,0,14"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
263 |
+ OP (1, "1,0", "2,3", "3@4", "3", "3,0,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
264 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
265 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
266 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
267 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
268 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
269 |
+void test_add_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
270 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
271 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
272 |
+ "std::valarray<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
273 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
274 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
275 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
276 |
+ &std::gslice_array<T>::operator+=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
277 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
278 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
279 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
280 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
281 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
282 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
283 |
+ OP (0, "1", "1", "1@4", "5", "6,1@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
284 |
+ OP (2, "1", "1", "2@4", "5", "2,2,7,2"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
285 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
286 |
+ OP (1, "2", "1", "3@4", "3,4", "3,6,7,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
287 |
+ OP (1, "1", "2", "7@4", "2", "7,9,7,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
288 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
289 |
+ OP (0, "2,1", "2,3", "1@4", "3,7", "4,1,8,1"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
290 |
+ OP (1, "1,0", "2,3", "3@4", "3", "3,6,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
291 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
292 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
293 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
294 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
295 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
296 |
+void test_sub_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
297 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
298 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
299 |
+ "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
300 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
301 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
302 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
303 |
+ &std::gslice_array<T>::operator-=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
304 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
305 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
306 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
307 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
308 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
309 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
310 |
+ OP (0, "1", "1", "9@4", "5", "4,9@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
311 |
+ OP (2, "1", "1", "7@4", "5", "7,7,2,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
312 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
313 |
+ OP (1, "2", "1", "3@4", "3,2", "3,0,1,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
314 |
+ OP (1, "1", "2", "7@4", "2", "7,5,7,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
315 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
316 |
+ OP (0, "2,1", "2,3", "7@4", "3,7", "4,7,0,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
317 |
+ OP (1, "1,0", "2,3", "3@4", "3", "3,0,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
318 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
319 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
320 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
321 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
322 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
323 |
+void test_xor_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
324 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
325 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
326 |
+ "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
327 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
328 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
329 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
330 |
+ &std::gslice_array<T>::operator^=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
331 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
332 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
333 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
334 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
335 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
336 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
337 |
+ OP (0, "1", "1", "9@4", "5", "12,9@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
338 |
+ OP (2, "1", "1", "7@4", "5", "7,7,2,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
339 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
340 |
+ OP (1, "2", "1", "3@4", "3,4", "3,0,7,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
341 |
+ OP (1, "1", "2", "7@4", "2", "7,5,7,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
342 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
343 |
+ OP (0, "2,1", "2,3", "7@4", "3,7", "4,7,0,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
344 |
+ OP (1, "1,0", "2,3", "3@4", "3", "3,0,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
345 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
346 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
347 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
348 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
349 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
350 |
+void test_and_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
351 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
352 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
353 |
+ "std::valarray<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
354 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
355 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
356 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
357 |
+ &std::gslice_array<T>::operator&=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
358 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
359 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
360 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
361 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
362 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
363 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
364 |
+ OP (0, "1", "1", "9@4", "5", "1,9@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
365 |
+ OP (2, "1", "1", "7@4", "5", "7,7,5,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
366 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
367 |
+ OP (1, "2", "1", "3@4", "3,4", "3,3,0,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
368 |
+ OP (1, "1", "2", "7@4", "2", "7,2,7,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
369 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
370 |
+ OP (0, "2,1", "2,3", "7@4", "3,2", "3,7,2,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
371 |
+ OP (1, "1,0", "2,3", "3@4", "1", "3,1,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
372 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
373 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
374 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
375 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
376 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
377 |
+void test_or_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
378 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
379 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
380 |
+ "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
381 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
382 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
383 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
384 |
+ &std::gslice_array<T>::operator|=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
385 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
386 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
387 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
388 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
389 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
390 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
391 |
+ OP (0, "1", "1", "9@4", "5", "13,9@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
392 |
+ OP (2, "1", "1", "7@4", "5", "7,7,7,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
393 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
394 |
+ OP (1, "2", "1", "3@4", "3,4", "3,3,7,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
395 |
+ OP (1, "1", "2", "7@4", "2", "7,7,7,7"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
396 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
397 |
+ OP (0, "2,1", "2,3", "4@4", "3,7", "7,4,7,4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
398 |
+ OP (1, "1,0", "2,3", "3@4", "4", "3,7,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
399 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
400 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
401 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
402 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
403 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
404 |
+void test_shl_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
405 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
406 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
407 |
+ "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
408 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
409 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
410 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
411 |
+ &std::gslice_array<T>::operator<<=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
412 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
413 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
414 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
415 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
416 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
417 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
418 |
+ OP (0, "1", "1", "1@4", "1", "2,1@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
419 |
+ OP (2, "1", "1", "2@4", "1", "2,2,4,2"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
420 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
421 |
+ OP (1, "2", "1", "1@4", "3,4", "1,4,8,1"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
422 |
+ OP (1, "1", "2", "3@4", "2", "3,12,3,3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
423 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
424 |
+ OP (0, "2,1", "2,3", "1@4", "3,2", "8,1,4,1"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
425 |
+ OP (1, "1,0", "2,3", "5@4", "3", "5,20,5,5"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
426 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
427 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
428 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
429 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
430 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
431 |
+void test_shr_assign (const T*, const char *tname, const char *opname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
432 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
433 |
+ rw_info (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
434 |
+ "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
435 |
+ tname, opname); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
436 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
437 |
+ void (std::gslice_array<T>::*op)(const std::valarray<T>&) const = |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
438 |
+ &std::gslice_array<T>::operator>>=; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
439 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
440 |
+ OP (0, "", "", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
441 |
+ OP (0, "0", "1", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
442 |
+ OP (2, "0", "9", "1@4", "2", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
443 |
+ OP (3, "0", "2", "1@4", "7", "1@4"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
444 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
445 |
+ OP (0, "1", "1", "1@4", "1", "0,1@3"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
446 |
+ OP (2, "1", "1", "2@4", "1", "2,2,1,2"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
447 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
448 |
+ OP (1, "2", "1", "9@4", "3,4", "9,1,0,9"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
449 |
+ OP (1, "1", "2", "9@4", "2", "9,2,9,9"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
450 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
451 |
+ OP (0, "2,1", "2,3", "14@4", "3,2", "1,14,3,14"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
452 |
+ OP (1, "1,0", "2,3", "5@4", "3", "5,0,5,5"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
453 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
454 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
455 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
456 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
457 |
+enum { |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
458 |
+ inx_mul_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
459 |
+ inx_div_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
460 |
+ inx_mod_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
461 |
+ inx_add_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
462 |
+ inx_sub_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
463 |
+ inx_xor_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
464 |
+ inx_and_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
465 |
+ inx_or_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
466 |
+ inx_shl_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
467 |
+ inx_shr_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
468 |
+ n_assign_ops |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
469 |
+}; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
470 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
471 |
+static int opt_assign [n_assign_ops]; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
472 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
473 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
474 |
+template <class T> |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
475 |
+void test_op_assign (const T*, const char *tname) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
476 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
477 |
+ const std::size_t nassigns = sizeof opt_assign / sizeof *opt_assign; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
478 |
+ for (std::size_t i = 0; i != nassigns; ++i) { |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
479 |
+ if (0 < opt_assign [i]) { |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
480 |
+ for (std::size_t j = 0; j != nassigns; ++j) { |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
481 |
+ if (0 == opt_assign [j]) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
482 |
+ opt_assign [j] = -1; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
483 |
+ } |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
484 |
+ break; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
485 |
+ } |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
486 |
+ } |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
487 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
488 |
+ if (rw_note (0 <= opt_assign [inx_mul_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
489 |
+ "tests of operator*= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
490 |
+ test_mul_assign ((const T*)0, tname, "*="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
491 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
492 |
+ if (rw_note (0 <= opt_assign [inx_div_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
493 |
+ "tests of operator/= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
494 |
+ test_div_assign ((const T*)0, tname, "/="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
495 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
496 |
+ if (rw_note (0 <= opt_assign [inx_mod_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
497 |
+ "tests of operator%= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
498 |
+ test_mod_assign ((const T*)0, tname, "%="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
499 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
500 |
+ if (rw_note (0 <= opt_assign [inx_add_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
501 |
+ "tests of operator+= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
502 |
+ test_add_assign ((const T*)0, tname, "+="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
503 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
504 |
+ if (rw_note (0 <= opt_assign [inx_sub_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
505 |
+ "tests of operator-= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
506 |
+ test_sub_assign ((const T*)0, tname, "-="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
507 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
508 |
+ if (rw_note (0 <= opt_assign [inx_xor_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
509 |
+ "tests of operator^= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
510 |
+ test_xor_assign ((const T*)0, tname, "^="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
511 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
512 |
+ if (rw_note (0 <= opt_assign [inx_and_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
513 |
+ "tests of operator&= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
514 |
+ test_and_assign ((const T*)0, tname, "&="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
515 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
516 |
+ if (rw_note (0 <= opt_assign [inx_or_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
517 |
+ "tests of operator|= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
518 |
+ test_or_assign ((const T*)0, tname, "|="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
519 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
520 |
+ if (rw_note (0 <= opt_assign [inx_shl_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
521 |
+ "tests of operator<<= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
522 |
+ test_shr_assign ((const T*)0, tname, "<<="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
523 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
524 |
+ if (rw_note (0 <= opt_assign [inx_shr_assign], 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
525 |
+ "tests of operator>>= disabled")) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
526 |
+ test_shr_assign ((const T*)0, tname, ">>="); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
527 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
528 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
529 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
530 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
531 |
+static int |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
532 |
+run_test (int, char**) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
533 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
534 |
+#undef TEST |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
535 |
+#define TEST(T) test_op_assign ((const T*)0, #T) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
536 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
537 |
+ TEST (std::size_t); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
538 |
+// TEST (double); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
539 |
+// |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
540 |
+//#if 0x04020100 >= _RWSTD_VER |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
541 |
+// |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
542 |
+// // test fails to compile with stdcxx 4.2.1 and prior due to |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
543 |
+// // STDCXX-512: http://issues.apache.org/jira/browse/STDCXX-512 |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
544 |
+// rw_warn (0, 0, __LINE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
545 |
+// "test of UserClass disabled in stdcxx 4.2.0 and prior " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
546 |
+// "due to STDCXX-512"); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
547 |
+// |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
548 |
+//#else // stdcxx >= 4.2.1 |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
549 |
+// |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
550 |
+// //TEST (UserClass); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
551 |
+// |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
552 |
+//#endif // stdcxx version |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
553 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
554 |
+ return 0; |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
555 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
556 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
557 |
+/**************************************************************************/ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
558 |
+ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
559 |
+int main (int argc, char *argv[]) |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
560 |
+{ |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
561 |
+ // FIXME: add command line options to enable/disable each operator |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
562 |
+ return rw_test (argc, argv, __FILE__, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
563 |
+ "gslice.array.comp.assign", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
564 |
+ 0 /* no comment */, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
565 |
+ run_test, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
566 |
+ "|-times~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
567 |
+ "|-divide~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
568 |
+ "|-modulo~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
569 |
+ "|-plus~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
570 |
+ "|-minus~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
571 |
+ "|-xor~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
572 |
+ "|-and~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
573 |
+ "|-or~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
574 |
+ "|-shift_left~ " |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
575 |
+ "|-shift_right~", |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
576 |
+ opt_assign + inx_mul_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
577 |
+ opt_assign + inx_div_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
578 |
+ opt_assign + inx_mod_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
579 |
+ opt_assign + inx_add_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
580 |
+ opt_assign + inx_sub_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
581 |
+ opt_assign + inx_xor_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
582 |
+ opt_assign + inx_and_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
583 |
+ opt_assign + inx_or_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
584 |
+ opt_assign + inx_shl_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
585 |
+ opt_assign + inx_shr_assign, |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
586 |
+ (void*)0 /* sentinel */); |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
587 |
+} |
94ae4d75524c
7064836 stdcxx to Userland
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
588 |
+ |