Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44fb2df

Browse files
committed
Upgrade googletest
1 parent f3fe878 commit 44fb2df

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

googletest

Submodule googletest updated 284 files

test/AH/Containers/test-Array.cpp

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33

44
USING_AH_NAMESPACE;
55

6+
template <class T, size_t N>
7+
std::ostream &operator<<(std::ostream &os, const AH::Array<T, N> &a) {
8+
if (N < 1)
9+
return os << "{}";
10+
os << '{';
11+
for (size_t i = 0; i < N - 1; ++i)
12+
os << a[i] << ", ";
13+
return os << a[N - 1] << '}';
14+
}
15+
16+
template <class T, size_t N, bool Reverse, bool Const>
17+
std::ostream &operator<<(std::ostream &os,
18+
const AH::ArraySlice<T, N, Reverse, Const> &a) {
19+
if (N < 1)
20+
return os << "{}";
21+
os << '{';
22+
for (size_t i = 0; i < N - 1; ++i)
23+
os << a[i] << ", ";
24+
return os << a[N - 1] << '}';
25+
}
26+
627
TEST(Array, initializeAndRetrieve) {
728
Array<int, 6> arr = {0, 1, 2, 3, 4, 5};
829
for (int i = 0; i < 6; i++)
@@ -266,12 +287,16 @@ TEST(generateArray, simpleNoType) {
266287
EXPECT_EQ(x, y);
267288
}
268289

290+
struct S {
291+
int i;
292+
float f;
293+
bool operator!=(S o) const { return this->i != o.i || this->f != o.f; }
294+
friend std::ostream &operator<<(std::ostream &os, S s) {
295+
return os << "S{" << s.i << ", " << s.f << "}";
296+
}
297+
};
298+
269299
TEST(fillArray, simple) {
270-
struct S {
271-
int i;
272-
float f;
273-
bool operator!=(S o) const { return this->i != o.i || this->f != o.f; }
274-
};
275300
auto x = fillArray<S, 4>(2, 3.14f);
276301
Array<S, 4> y = {{{2, 3.14f}, {2, 3.14f}, {2, 3.14f}, {2, 3.14f}}};
277302
EXPECT_EQ(x, y);

0 commit comments

Comments
 (0)