Add deterministic C++ reference adapter
This commit is contained in:
parent
f00aa65a73
commit
7bee0220c2
7 changed files with 1915 additions and 0 deletions
17
tests/fixtures/reference-cpp/src/main.cpp
vendored
Normal file
17
tests/fixtures/reference-cpp/src/main.cpp
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "../include/config.hpp"
|
||||
|
||||
namespace demo {
|
||||
|
||||
int execute(int value) {
|
||||
Config config{value};
|
||||
if (value == 0) {
|
||||
return effective_limit(config);
|
||||
}
|
||||
return normalize(value);
|
||||
}
|
||||
|
||||
} // namespace demo
|
||||
|
||||
int main() {
|
||||
return demo::execute(3);
|
||||
}
|
||||
17
tests/fixtures/reference-cpp/src/worker.cpp
vendored
Normal file
17
tests/fixtures/reference-cpp/src/worker.cpp
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "../include/config.hpp"
|
||||
|
||||
namespace demo {
|
||||
|
||||
class Worker {
|
||||
public:
|
||||
int run(int value) {
|
||||
for (int attempt = 0; attempt < 2; ++attempt) {
|
||||
if (value > attempt) {
|
||||
return effective_limit(Config{value});
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace demo
|
||||
Loading…
Add table
Add a link
Reference in a new issue