-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdatasource_fixture.cpp
73 lines (68 loc) · 2.15 KB
/
datasource_fixture.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "datasource_fixture.hpp"
bool operator==(const AType& a, const AType& b)
{
return a.a == b.a && a.b == b.b && a.c == b.c && a.ai == b.ai && std::equal(a.vd.begin(), a.vd.end(), b.vd.begin());
}
std::ostream& operator<<(std::ostream& os, const AType& a)
{
os << "{ " << a.a << ", " << a.b << ", " << a.c << ", < ";
for (unsigned int i = 0; i != a.ai.size(); ++i)
os << a.ai[i] << " ";
os <<">, ( ";
for (unsigned int i = 0; i != a.vd.size(); ++i)
os << a.vd[i] << " ";
os << ") }";
return os;
}
std::ostream& operator<<(std::ostream& os, const ATypes& as)
{
os << '[';
for (unsigned int i = 0; i != as.size(); ++i)
os << as[i] << (i+1 == as.size() ? "]": ", ");
return os;
}
bool operator==(const BType& a, const BType& b)
{
return a.a == b.a && a.b == b.b && strcmp(a.c, b.c) == 0 && a.ai[3] == b.ai[3] && a.vd[3] == b.vd[3];
}
std::ostream& operator<<(std::ostream& os, const BType& a)
{
os << "{ " << a.a << ", " << a.b << ", " << a.c << ", < ";
for (unsigned int i = 0; i != 5; ++i)
os << a.ai[i] << " ";
os <<">, ( ";
for (unsigned int i = 0; i != 10; ++i)
os << a.vd[i] << " ";
os << ") }";
return os;
}
std::ostream& operator<<(std::ostream& os, const BTypes& bs)
{
os << '[';
for (unsigned int i = 0; i != bs.size(); ++i)
os << bs[i] << (i+1 == bs.size() ? "]": ", ");
return os;
}
bool operator==(const CType& a, const CType& b)
{
return a.a == b.a && a.b == b.b && std::equal(a.av.begin(), a.av.end(), b.av.begin()) && std::equal(a.bv.begin(), a.bv.end(), b.bv.begin());
}
std::ostream& operator<<(std::ostream& os, const CType& a)
{
os << "{ (" << a.a << ", " << endl <<" " << a.b << endl<< " )"<<endl;
os << " <";
for (unsigned int i = 0; i != 5; ++i)
os << a.av[i] << " ";
os <<" >,"<<endl<<" <";
for (unsigned int i = 0; i != 10; ++i)
os << a.bv[i] << " ";
os <<" >"<<endl <<"}";
return os;
}
std::ostream& operator<<(std::ostream& os, const CTypes& cs)
{
os << '[';
for (unsigned int i = 0; i != cs.size(); ++i)
os << cs[i] << (i+1 == cs.size() ? "]": ", ");
return os;
}