-
Notifications
You must be signed in to change notification settings - Fork 190
Expand file tree
/
Copy pathCheck.cpp
More file actions
57 lines (48 loc) · 1.68 KB
/
Copy pathCheck.cpp
File metadata and controls
57 lines (48 loc) · 1.68 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
#include "rapidcheck/Check.h"
#include "detail/DefaultTestListener.h"
#include "detail/Testing.h"
namespace rc {
namespace detail {
TestResult
checkProperty(const Property &property,
const TestMetadata &metadata,
const TestParams ¶ms,
TestListener &listener,
const std::unordered_map<std::string, Reproduce> &reproduceMap) {
if (reproduceMap.empty()) {
return testProperty(property, metadata, params, listener);
}
const auto it = reproduceMap.find(metadata.id);
if (metadata.id.empty() || (it == end(reproduceMap))) {
SuccessResult success;
success.numSuccess = 0;
return success;
} else {
auto reproduce = it->second;
if (params.disableShrinking) {
reproduce.shrinkPath.clear();
}
return reproduceProperty(property, reproduce);
}
}
TestResult checkProperty(const Property &property,
const TestMetadata &metadata,
const TestParams ¶ms,
TestListener &listener) {
return checkProperty(
property, metadata, params, listener, configuration().reproduce);
}
TestResult checkProperty(const Property &property,
const TestMetadata &metadata,
const TestParams ¶ms) {
return checkProperty(property, metadata, params, globalTestListener());
}
TestResult checkProperty(const Property &property,
const TestMetadata &metadata) {
return checkProperty(property, metadata, configuration().testParams);
}
TestResult checkProperty(const Property &property) {
return checkProperty(property, TestMetadata());
}
} // namespace detail
} // namespace rc