25 auto domainWatcher = std::make_shared<DomainWatcher>(domain);
26 auto flowIoFactory = std::make_unique<mxl::lib::PosixFlowIoFactory>(domainWatcher);
27 auto const instance = std::make_shared<Instance>(domain,
"", std::move(flowIoFactory), domainWatcher);
29 REQUIRE(instance->getHistoryDurationNs() == 200'000'000ULL);
36 std::ofstream ofs(domainOptionsFile);
41 auto domainWatcher = std::make_shared<DomainWatcher>(domain);
42 auto flowIoFactory = std::make_unique<mxl::lib::PosixFlowIoFactory>(domainWatcher);
43 auto const instance = std::make_shared<Instance>(domain,
"", std::move(flowIoFactory), domainWatcher);
45 REQUIRE(instance->getHistoryDurationNs() == 500'000'000ULL);
50 auto domainWatcher = std::make_shared<DomainWatcher>(domain);
51 auto flowIoFactory = std::make_unique<mxl::lib::PosixFlowIoFactory>(domainWatcher);
52 auto const instance = std::make_shared<Instance>(domain, options_250, std::move(flowIoFactory), domainWatcher);
56 REQUIRE(instance->getHistoryDurationNs() == 200'000'000ULL);
63 std::ofstream ofs(domainOptionsFile);
68 auto domainWatcher = std::make_shared<DomainWatcher>(domain);
69 auto flowIoFactory = std::make_unique<mxl::lib::PosixFlowIoFactory>(domainWatcher);
70 auto const instance = std::make_shared<Instance>(domain, options_250, std::move(flowIoFactory), domainWatcher);
73 REQUIRE(instance->getHistoryDurationNs() == 500'000'000ULL);
80 std::ofstream ofs(domainOptionsFile);
85 auto domainWatcher = std::make_shared<DomainWatcher>(domain);
86 auto flowIoFactory = std::make_unique<mxl::lib::PosixFlowIoFactory>(domainWatcher);
87 auto const instance = std::make_shared<Instance>(domain,
"def", std::move(flowIoFactory), domainWatcher);
89 REQUIRE(instance->getHistoryDurationNs() == 200'000'000ULL);
95 std::filesystem::remove(path);
96 SECTION(
"Missing options use the fallback")
98 SECTION(
"A dangling symlink uses the fallback")
100 std::filesystem::create_symlink(
"missing-options.json", path);
102 SECTION(
"An unresolvable symlink uses the fallback")
104 std::filesystem::create_symlink(path.filename(), path);
106 auto domainWatcher = std::make_shared<DomainWatcher>(domain);
107 auto flowIoFactory = std::make_unique<mxl::lib::PosixFlowIoFactory>(domainWatcher);
108 auto const instance = std::make_shared<Instance>(domain,
"", std::move(flowIoFactory), domainWatcher);
109 REQUIRE(instance->getHistoryDurationNs() == 200'000'000ULL);