Sen API
Sen Libraries
Loading...
Searching...
No Matches
runtime_1/src/runtime.h
Go to the documentation of this file.
1// === runtime.h =======================================================================================================
2// Sen Infrastructure
3// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4// See the LICENSE.txt file for more information.
5// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6// =====================================================================================================================
7
8#ifndef SEN_LIBS_KERNEL_TEST_INTEGRATION_RUNTIME_COMPATIBILITY_RUNTIME_1_SRC_RUNTIME_H
9#define SEN_LIBS_KERNEL_TEST_INTEGRATION_RUNTIME_COMPATIBILITY_RUNTIME_1_SRC_RUNTIME_H
10
12#include "stl/runtime/runtime.stl.h"
13#include "stl/sen/kernel/kernel_objects.stl.h"
14
15// test_helpers
16#include "test_helpers/tester.stl.h"
17
18// std
19#include <bitset>
20
22{
23
24class TestClassImpl final: public TestClassBase
25{
26public:
27 SEN_NOCOPY_NOMOVE(TestClassImpl)
28
29public:
30 using TestClassBase::TestClassBase;
31 ~TestClassImpl() override = default;
32
33protected: // TestClassBase
34 std::string testMethodImpl(i32 arg1, i32 arg2, const TestStruct& arg3) override;
35 void extraMethodImpl() override;
36 void emitEventsImpl() override;
37};
38
39class TesterImpl final: public TesterBase
40{
41public:
42 SEN_NOCOPY_NOMOVE(TesterImpl)
43
44public:
45 using TesterBase::TesterBase;
46 ~TesterImpl() override = default;
47
48public: // NativeObject
51
52protected: // TesterBase
53 void doTestsImpl(std::promise<TestResult>&& promise) override;
54 void checkLocalStateImpl(std::promise<TestResult>&& promise) override;
55 void shutdownKernelImpl() override;
56
57private:
58 void checkRemote(u32 flagToSet);
59
60private:
61 std::shared_ptr<TestClassImpl> localObj_;
62 std::shared_ptr<sen::Subscription<TestClassInterface>> remoteObjSub_;
63 TestClassInterface* remoteObj_ = nullptr;
64 std::promise<TestResult> promise_;
65 std::bitset<15> localFlags_;
66 std::bitset<17> remoteFlags_;
67 bool testMethodPassed_ = false;
68 bool extraMethodPassed_ = false;
69 bool testEventPassed_ = true;
70 std::shared_ptr<sen::Subscription<sen::kernel::KernelApiInterface>> kernelApiSub_;
71 sen::kernel::KernelApiInterface* kernelApiObj_ = nullptr;
72};
73
74} // namespace sen::test::runtime
75
76#endif // SEN_LIBS_KERNEL_TEST_INTEGRATION_RUNTIME_COMPATIBILITY_RUNTIME_1_SRC_RUNTIME_H
API for objects when registered.
Definition component_api.h:170
Definition runtime_1/src/runtime.h:25
~TestClassImpl() override=default
std::string testMethodImpl(i32 arg1, i32 arg2, const TestStruct &arg3) override
Definition runtime_1/src/runtime.h:40
void unregistered(sen::kernel::RegistrationApi &api) override
void shutdownKernelImpl() override
void doTestsImpl(std::promise< TestResult > &&promise) override
void checkLocalStateImpl(std::promise< TestResult > &&promise) override
void registered(sen::kernel::RegistrationApi &api) override
~TesterImpl() override=default
uint32_t u32
Definition numbers.h:25
int32_t i32
Definition numbers.h:24
Definition runtime_1/src/runtime.h:22