Repository navigation
Expand file tree
/
Copy pathpredicates.h
More file actions
59 lines (46 loc) · 1.64 KB
/
Copy pathpredicates.h
File metadata and controls
59 lines (46 loc) · 1.64 KB
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
#include "array/zfparray1.h"
#include "gtest/gtest.h"
testing::AssertionResult ExpectEqPrintHexPred(const char* expected_expr, const char* actual_expr, uint64 expected, uint64 actual)
{
if (actual == expected)
return testing::AssertionSuccess();
std::stringstream ss, msg;
std::string expected_str, actual_str;
ss.str("");
ss << std::showbase << std::hex << expected;
expected_str = ss.str();
ss.str("");
ss << std::showbase << std::hex << actual;
actual_str = ss.str();
msg << "\t Expected: " << expected_expr;
if (expected_str != expected_expr) {
msg << "\n\t Which is: " << std::showbase << std::hex << expected;
}
msg << "\nTo be equal to: " << actual_expr;
if (actual_str != actual_expr) {
msg << "\n\t Which is: " << std::showbase << std::hex << actual;
}
return testing::AssertionFailure() << msg.str();
}
testing::AssertionResult ExpectNeqPrintHexPred(const char* expected_expr, const char* actual_expr, uint64 expected, uint64 actual)
{
if (actual != expected)
return testing::AssertionSuccess();
std::stringstream ss, msg;
std::string expected_str, actual_str;
ss.str("");
ss << std::showbase << std::hex << expected;
expected_str = ss.str();
ss.str("");
ss << std::showbase << std::hex << actual;
actual_str = ss.str();
msg << "\t Expected: " << expected_expr;
if (expected_str != expected_expr) {
msg << "\n\t Which is: " << std::showbase << std::hex << expected;
}
msg << "\nNot to be equal to: " << actual_expr;
if (actual_str != actual_expr) {
msg << "\n\t Which is: " << std::showbase << std::hex << actual;
}
return testing::AssertionFailure() << msg.str();
}