MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
test_instance.cpp File Reference
#include <memory>
#include <stdexcept>
#include <catch2/catch_test_macros.hpp>
#include "mxl-internal/DomainWatcher.hpp"
#include "mxl-internal/Instance.hpp"
#include "mxl-internal/PosixFlowIoFactory.hpp"
#include "../../tests/Utils.hpp"
Include dependency graph for test_instance.cpp:

Go to the source code of this file.

Functions

 TEST_CASE_PERSISTENT_FIXTURE (mxl::tests::mxlDomainFixture, "Instance : getFlowReader rejects invalid flow ids", "[instance]")

Function Documentation

◆ TEST_CASE_PERSISTENT_FIXTURE()

TEST_CASE_PERSISTENT_FIXTURE ( mxl::tests::mxlDomainFixture ,
"Instance : getFlowReader rejects invalid flow ids" ,
"" [instance] )

Definition at line 14 of file test_instance.cpp.

14 : getFlowReader rejects invalid flow ids", "[instance]")
15{
16 auto domainWatcher = std::make_shared<DomainWatcher>(domain);
17 auto flowIoFactory = std::make_unique<PosixFlowIoFactory>(domainWatcher);
18 auto const instance = std::make_shared<Instance>(domain, "", std::move(flowIoFactory), domainWatcher);
19
20 // The C API checks flow ids before calling getFlowReader, but internal callers do not.
21 REQUIRE_THROWS_AS(instance->getFlowReader(""), std::invalid_argument);
22 REQUIRE_THROWS_AS(instance->getFlowReader("not-a-uuid"), std::invalid_argument);
23 REQUIRE_THROWS_AS(instance->getFlowReader("5fbec3b1-1b0f-417d-9059-8b94a47197e"), std::invalid_argument);
24}