API
 
Loading...
Searching...
No Matches
indidriver_start_generated_tests.cpp
Go to the documentation of this file.
1#include <assert.h>
2#include "../../../../tests/catch2/catch.hpp"
3#include "../generated/logCodes.hpp"
4#include "../types/indidriver_start.hpp"
5#include "../types/flatbuffer_log.hpp"
6
7/*
8 * GENERATED TEST FILE for types/indidriver_start.hpp
9 * generated by generateTemplateCatch2Tests.py
10 */
11
12
13
14/** Class to encapsulate indidriver_start flatbuffer data using
15 ** => types/indidriver_start.hpp
16 ** => types/generated/indidriver_start_generated.h
17 **/
19{
20public:
21 // Saved input parameter value; unused
22
23 // Parameters retrieved from flatbuffer
24
25 // Flatbuffers verifier success/failure
26 bool m_verify{false};
27
28 // flatbuffer data length; used in ::verify
29 int L;
30
31 // Constructor
33 // Save input parameters
34
35 // Create the flatbuffer messageT using the input parameters
37
38 // Retrieve flatbuffer pointer (if not an empty_log type) and length
40
41 // Retrieve the flatbuffer parameters for Catch2 comparison below
42
43 // Run the indidriver_start verifier
44 m_verify = verify(is);
45 }
46
47 // Run the flatbuffer Verifier for this log type
48 // - requires bufferPtrT (shared_ptr<char*>) to full log entry
49 // comprising log header plus flatbuffer log message
51
52 // Timestamp, prioriy (use nominal value here)
53 flatlogs::timespecX tsx{0,0};
55
56 // Create full log: log header(*); log message (+)
57 // * Log level (priority)
58 // * Event code (implicit in <MagAOX::logger::type>)
59 // * Timestamp
60 // * Message size (variable length; 1, 2, or 8 bytes)
61 // + Message (variable length)
62
63 // N.G. allocates space and writes pointer value to logBuffer
64 flatlogs::bufferPtrT logBuffer;
65 flatlogs::logHeader::createLog<MagAOX::logger::indidriver_start>(logBuffer
66 , tsx, msg
67 , prio);
68 // Run full log through flatbuffer Verifier
70 }
71};
72
73SCENARIO( "Create indidriver_start 0", "[a log item]")
74{
75 GIVEN("a indidriver_start log code")
76 {
77 WHEN("random values for fields")
78 {
79 // Create flatbuffer
81 // Compare flatbuffer parameters
82 REQUIRE(is.m_verify);
83 }
84 }
85}
86
87
bool verify(const typename MagAOX::logger::indidriver_start::messageT &msg)
int8_t logPrioT
The type of the log priority code.
Definition logDefs.hpp:21
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer.
Definition logHeader.hpp:58
Empty type for resolving logs with no message.
Definition empty_log.hpp:25
SCENARIO("Create indidriver_start 0", "[a log item]")
static constexpr logPrioT LOG_DEFAULT
Used to denote "use the default level for this log type".
emptyMessage messageT
The type of the message.
Definition empty_log.hpp:40
static flatlogs::msgLenT length(const messageT &msg)
Get the length of the message.
Definition empty_log.hpp:43
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
Definition empty_log.hpp:81
A fixed-width timespec structure.
Definition timespecX.hpp:35