mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 13:54:34 -06:00
mstarch: merge latest v3.0.0
This commit is contained in:
commit
3b8769ab89
2
.clang-tidy
Normal file
2
.clang-tidy
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Checks: "-clang-analyzer-security.insecureAPI.rand"
|
||||||
|
WarningsAsErrors: '*'
|
||||||
1
.github/actions/spelling/expect.txt
vendored
1
.github/actions/spelling/expect.txt
vendored
@ -328,6 +328,7 @@ deserializing
|
|||||||
dest
|
dest
|
||||||
DEVNULL
|
DEVNULL
|
||||||
dfdc
|
dfdc
|
||||||
|
DFL
|
||||||
DFPRIME
|
DFPRIME
|
||||||
DGRAM
|
DGRAM
|
||||||
DHTML
|
DHTML
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -81,7 +81,5 @@ fprime-venv
|
|||||||
xml
|
xml
|
||||||
depend
|
depend
|
||||||
|
|
||||||
.*
|
|
||||||
|
|
||||||
/.idea/
|
/.idea/
|
||||||
/venv/
|
/venv/
|
||||||
|
|||||||
@ -171,7 +171,7 @@ namespace ${namespace} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const ${name}& ${name} ::
|
${name}& ${name} ::
|
||||||
operator=(const ${name}& other)
|
operator=(const ${name}& other)
|
||||||
{
|
{
|
||||||
for(U32 index = 0; index < SIZE; index++) {
|
for(U32 index = 0; index < SIZE; index++) {
|
||||||
@ -180,7 +180,7 @@ namespace ${namespace} {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ${name}& ${name} ::
|
${name}& ${name} ::
|
||||||
operator=(const ElementType (&a)[SIZE])
|
operator=(const ElementType (&a)[SIZE])
|
||||||
{
|
{
|
||||||
for(U32 index = 0; index < SIZE; index++) {
|
for(U32 index = 0; index < SIZE; index++) {
|
||||||
@ -189,7 +189,7 @@ namespace ${namespace} {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ${name}& ${name} ::
|
${name}& ${name} ::
|
||||||
operator=(const ElementType& e)
|
operator=(const ElementType& e)
|
||||||
{
|
{
|
||||||
for(U32 index = 0; index < SIZE; index++) {
|
for(U32 index = 0; index < SIZE; index++) {
|
||||||
|
|||||||
@ -155,17 +155,17 @@ namespace ${namespace} {
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//! Assignment operator
|
//! Assignment operator
|
||||||
const ${name}& operator=(
|
${name}& operator=(
|
||||||
const ${name}& other //!< The other object
|
const ${name}& other //!< The other object
|
||||||
);
|
);
|
||||||
|
|
||||||
//! Assignment operator from array
|
//! Assignment operator from array
|
||||||
const ${name}& operator=(
|
${name}& operator=(
|
||||||
const ElementType (&a)[SIZE] //!< The array
|
const ElementType (&a)[SIZE] //!< The array
|
||||||
);
|
);
|
||||||
|
|
||||||
//! Assignment operator from element
|
//! Assignment operator from element
|
||||||
const ${name}& operator=(
|
${name}& operator=(
|
||||||
const ElementType& e //!< The element
|
const ElementType& e //!< The element
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -56,13 +56,13 @@ namespace ${namespace} {
|
|||||||
// Instance methods
|
// Instance methods
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
const ${name}& ${name} :: operator=(const ${name}& other)
|
${name}& ${name} :: operator=(const ${name}& other)
|
||||||
{
|
{
|
||||||
this->e = other.e;
|
this->e = other.e;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ${name}& ${name} :: operator=(const NATIVE_INT_TYPE a)
|
${name}& ${name} :: operator=(const NATIVE_INT_TYPE a)
|
||||||
{
|
{
|
||||||
#for $item_name,$item_value,$item_comment in $items_list:
|
#for $item_name,$item_value,$item_comment in $items_list:
|
||||||
#if not $item_value == ""
|
#if not $item_value == ""
|
||||||
@ -90,7 +90,7 @@ a == $item_value#slurp
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ${name}& ${name} :: operator=(const NATIVE_UINT_TYPE a)
|
${name}& ${name} :: operator=(const NATIVE_UINT_TYPE a)
|
||||||
{
|
{
|
||||||
#for $item_name,$item_value,$item_comment in $items_list:
|
#for $item_name,$item_value,$item_comment in $items_list:
|
||||||
#if not $item_value == ""
|
#if not $item_value == ""
|
||||||
|
|||||||
@ -102,17 +102,17 @@ namespace ${namespace} {
|
|||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
//! Assignment operator
|
//! Assignment operator
|
||||||
const ${name}& operator=(
|
${name}& operator=(
|
||||||
const ${name}& other //!< The other object
|
const ${name}& other //!< The other object
|
||||||
);
|
);
|
||||||
|
|
||||||
//! Assignment operator
|
//! Assignment operator
|
||||||
const ${name}& operator=(
|
${name}& operator=(
|
||||||
const NATIVE_INT_TYPE a //!< The integer to copy
|
const NATIVE_INT_TYPE a //!< The integer to copy
|
||||||
);
|
);
|
||||||
|
|
||||||
//! Assignment operator
|
//! Assignment operator
|
||||||
const ${name}& operator=(
|
${name}& operator=(
|
||||||
const NATIVE_UINT_TYPE a //!< The integer to copy
|
const NATIVE_UINT_TYPE a //!< The integer to copy
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -40,9 +40,9 @@ ${name}::${name}(${args_scalar_array_string}) : Serializable() {
|
|||||||
|
|
||||||
#end if
|
#end if
|
||||||
|
|
||||||
const ${name}& ${name}::operator=(const ${name}& src) {
|
${name}& ${name}::operator=(const ${name}& src) {
|
||||||
this->set(${args_mstring});
|
this->set(${args_mstring});
|
||||||
return src;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ${name}::operator==(const ${name}& src) const {
|
bool ${name}::operator==(const ${name}& src) const {
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public:
|
|||||||
#if $args_proto_scalar_init:
|
#if $args_proto_scalar_init:
|
||||||
${name}($args_proto_scalar_init); //!< constructor with arguments with scalars for array arguments
|
${name}($args_proto_scalar_init); //!< constructor with arguments with scalars for array arguments
|
||||||
#end if
|
#end if
|
||||||
const ${name}& operator=(const ${name}& src); //!< equal operator
|
${name}& operator=(const ${name}& src); //!< equal operator
|
||||||
bool operator==(const ${name}& src) const; //!< equality operator
|
bool operator==(const ${name}& src) const; //!< equality operator
|
||||||
#ifdef BUILD_UT
|
#ifdef BUILD_UT
|
||||||
// to support GoogleTest framework in unit tests
|
// to support GoogleTest framework in unit tests
|
||||||
|
|||||||
@ -20,9 +20,9 @@ mytype::mytype(U32 val) : Serializable() {
|
|||||||
this->setVal(val);
|
this->setVal(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mytype& mytype::operator=(const mytype& src) {
|
mytype& mytype::operator=(const mytype& src) {
|
||||||
this->setVal(src.m_val);
|
this->setVal(src.m_val);
|
||||||
return src;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mytype::operator==(const mytype& src) const {
|
bool mytype::operator==(const mytype& src) const {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ namespace ANameSpace {
|
|||||||
mytype(const mytype* src); // copy constructor
|
mytype(const mytype* src); // copy constructor
|
||||||
mytype(const mytype& src); // copy constructor
|
mytype(const mytype& src); // copy constructor
|
||||||
mytype(U32 arg); // constructor with arguments
|
mytype(U32 arg); // constructor with arguments
|
||||||
const mytype& operator=(const mytype& src); // Equal operator
|
mytype& operator=(const mytype& src); // Equal operator
|
||||||
bool operator==(const mytype& src) const;
|
bool operator==(const mytype& src) const;
|
||||||
|
|
||||||
void setVal(U32 arg); // set values
|
void setVal(U32 arg); // set values
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#include <Autocoders/Python/test/array_xml/ExampleArrayImpl.hpp>
|
#include <Autocoders/Python/test/array_xml/ExampleArrayImpl.hpp>
|
||||||
#include <Fw/Types/BasicTypes.hpp>
|
#include <Fw/Types/BasicTypes.hpp>
|
||||||
|
#include <Fw/Types/String.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ namespace Example {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExampleArrayImpl::ExArrayIn_handler(NATIVE_INT_TYPE portNum, Example::ArrayType array1, Example::ArrSerial serial1) {
|
void ExampleArrayImpl::ExArrayIn_handler(NATIVE_INT_TYPE portNum, Example::ArrayType array1, Example::ArrSerial serial1) {
|
||||||
Fw::EightyCharString s;
|
Fw::String s;
|
||||||
array1.toString(s);
|
array1.toString(s);
|
||||||
|
|
||||||
printf("%s Invoked ExArrayIn_handler();\n%s", this->getObjName(), s.toChar());
|
printf("%s Invoked ExArrayIn_handler();\n%s", this->getObjName(), s.toChar());
|
||||||
@ -27,7 +28,7 @@ namespace Example {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExampleArrayImpl::ArrayIn_handler(NATIVE_INT_TYPE portNum, Example::ArrayType array1, Example::ArrSerial serial1) {
|
void ExampleArrayImpl::ArrayIn_handler(NATIVE_INT_TYPE portNum, Example::ArrayType array1, Example::ArrSerial serial1) {
|
||||||
Fw::EightyCharString s;
|
Fw::String s;
|
||||||
array1.toString(s);
|
array1.toString(s);
|
||||||
|
|
||||||
printf("%s Invoked ArrayIn_handler(%d);\n%s", this->getObjName(), portNum, s.toChar());
|
printf("%s Invoked ArrayIn_handler(%d);\n%s", this->getObjName(), portNum, s.toChar());
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#ifndef EXAMPLE_ARRAY_IMPL_HPP
|
#ifndef EXAMPLE_ARRAY_IMPL_HPP
|
||||||
#define EXAMPLE_ARRAY_IMPL_HPP
|
#define EXAMPLE_ARRAY_IMPL_HPP
|
||||||
|
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#include <Autocoders/Python/test/array_xml/Component1ComponentAc.hpp>
|
#include <Autocoders/Python/test/array_xml/Component1ComponentAc.hpp>
|
||||||
|
|
||||||
namespace Example {
|
namespace Example {
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
#include <Fw/Obj/SimpleObjRegistry.hpp>
|
#include <Fw/Obj/SimpleObjRegistry.hpp>
|
||||||
#include <Fw/Types/SerialBuffer.hpp>
|
#include <Fw/Types/SerialBuffer.hpp>
|
||||||
#include <Fw/Types/BasicTypes.hpp>
|
#include <Fw/Types/BasicTypes.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <Fw/Types/Assert.hpp>
|
#include <Fw/Types/Assert.hpp>
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
@ -45,18 +45,18 @@ int main(int argc, char* argv[]) {
|
|||||||
InternalType array1 = InternalType(6,7,120,444);
|
InternalType array1 = InternalType(6,7,120,444);
|
||||||
Example::ArrayType array2 = Example::ArrayType(array1);
|
Example::ArrayType array2 = Example::ArrayType(array1);
|
||||||
// Create string array for serializable
|
// Create string array for serializable
|
||||||
Fw::EightyCharString mem1 = "Member 1";
|
Fw::String mem1 = "Member 1";
|
||||||
Fw::EightyCharString mem2 = "Member 2";
|
Fw::String mem2 = "Member 2";
|
||||||
Fw::EightyCharString mem3 = "Member 3";
|
Fw::String mem3 = "Member 3";
|
||||||
StringArray array3 = StringArray(mem1, mem2, mem3);
|
StringArray array3 = StringArray(mem1, mem2, mem3);
|
||||||
Example::ArrSerial serial1;
|
Example::ArrSerial serial1;
|
||||||
|
|
||||||
// Print toString outputs for each array
|
// Print toString outputs for each array
|
||||||
cout << "Print toString for arrays" << endl;
|
cout << "Print toString for arrays" << endl;
|
||||||
|
|
||||||
Fw::EightyCharString tostring1;
|
Fw::String tostring1;
|
||||||
Fw::EightyCharString tostring2;
|
Fw::String tostring2;
|
||||||
Fw::EightyCharString tostring3;
|
Fw::String tostring3;
|
||||||
array1.toString(tostring1);
|
array1.toString(tostring1);
|
||||||
array2.toString(tostring2);
|
array2.toString(tostring2);
|
||||||
array3.toString(tostring3);
|
array3.toString(tostring3);
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#include <Autocoders/Python/test/ext_dict/ExampleType.hpp>
|
#include <Autocoders/Python/test/ext_dict/ExampleType.hpp>
|
||||||
#include <Fw/Types/Assert.hpp>
|
#include <Fw/Types/Assert.hpp>
|
||||||
#if FW_SERIALIZABLE_TO_STRING
|
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#endif
|
|
||||||
namespace ANameSpace {
|
namespace ANameSpace {
|
||||||
|
|
||||||
mytype::mytype(): Serializable() {
|
mytype::mytype(): Serializable() {
|
||||||
@ -22,9 +20,9 @@ mytype::mytype(U32 val) : Serializable() {
|
|||||||
this->setVal(val);
|
this->setVal(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mytype& mytype::operator=(const mytype& src) {
|
mytype& mytype::operator=(const mytype& src) {
|
||||||
this->setVal(src.m_val);
|
this->setVal(src.m_val);
|
||||||
return src;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mytype::operator==(const mytype& src) const {
|
bool mytype::operator==(const mytype& src) const {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ namespace ANameSpace {
|
|||||||
mytype(const mytype* src); // copy constructor
|
mytype(const mytype* src); // copy constructor
|
||||||
mytype(const mytype& src); // copy constructor
|
mytype(const mytype& src); // copy constructor
|
||||||
mytype(U32 arg); // constructor with arguments
|
mytype(U32 arg); // constructor with arguments
|
||||||
const mytype& operator=(const mytype& src); // Equal operator
|
mytype& operator=(const mytype& src); // Equal operator
|
||||||
bool operator==(const mytype& src) const; // equality operator
|
bool operator==(const mytype& src) const; // equality operator
|
||||||
|
|
||||||
void setVal(U32 arg); // set values
|
void setVal(U32 arg); // set values
|
||||||
|
|||||||
@ -2,10 +2,6 @@
|
|||||||
#include <Fw/Types/Assert.hpp>
|
#include <Fw/Types/Assert.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#if FW_SERIALIZABLE_TO_STRING
|
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace ANameSpace {
|
namespace ANameSpace {
|
||||||
|
|
||||||
UserSerializer::UserSerializer(): Serializable() {
|
UserSerializer::UserSerializer(): Serializable() {
|
||||||
@ -25,9 +21,9 @@ UserSerializer::UserSerializer(SomeUserStruct val) : Serializable() {
|
|||||||
this->setVal(val);
|
this->setVal(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SomeUserStruct& UserSerializer::operator=(const SomeUserStruct& src) {
|
SomeUserStruct& UserSerializer::operator=(const SomeUserStruct& src) {
|
||||||
this->setVal(src);
|
this->setVal(src);
|
||||||
return src;
|
return this->m_struct;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserSerializer::getVal(SomeUserStruct& arg) {
|
void UserSerializer::getVal(SomeUserStruct& arg) {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ namespace ANameSpace {
|
|||||||
UserSerializer(const SomeUserStruct* src); // copy constructor
|
UserSerializer(const SomeUserStruct* src); // copy constructor
|
||||||
UserSerializer(const SomeUserStruct& src); // copy constructor
|
UserSerializer(const SomeUserStruct& src); // copy constructor
|
||||||
UserSerializer(SomeUserStruct arg); // constructor with arguments
|
UserSerializer(SomeUserStruct arg); // constructor with arguments
|
||||||
const SomeUserStruct& operator=(const SomeUserStruct& src); // Equal operator
|
SomeUserStruct& operator=(const SomeUserStruct& src); // Equal operator
|
||||||
|
|
||||||
void setVal(const SomeUserStruct& arg); // set values
|
void setVal(const SomeUserStruct& arg); // set values
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ namespace Duck {
|
|||||||
|
|
||||||
// Internal call - implemented by hand.
|
// Internal call - implemented by hand.
|
||||||
// downcall for input port externInputPort1
|
// downcall for input port externInputPort1
|
||||||
I32 DuckImpl::externInputPort1_Msg1_handler(U32 cmd, Fw::EightyCharString str) {
|
I32 DuckImpl::externInputPort1_Msg1_handler(U32 cmd, Fw::String str) {
|
||||||
// User code is written here.
|
// User code is written here.
|
||||||
printf("\n\t*** %s: externInputPort1_Msg1_handler down-call\n", this->m_objName);
|
printf("\n\t*** %s: externInputPort1_Msg1_handler down-call\n", this->m_objName);
|
||||||
this->outputPort1_Msg1_out(cmd, str);
|
this->outputPort1_Msg1_out(cmd, str);
|
||||||
@ -33,13 +33,13 @@ namespace Duck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// downcall for input port inputPort1
|
// downcall for input port inputPort1
|
||||||
I32 DuckImpl::inputPort1_Msg1_handler(U32 cmd, Fw::EightyCharString str) {
|
I32 DuckImpl::inputPort1_Msg1_handler(U32 cmd, Fw::String str) {
|
||||||
// User code is written here.
|
// User code is written here.
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// downcall for input port inputPort2
|
// downcall for input port inputPort2
|
||||||
I32 DuckImpl::inputPort2_Msg1_handler(U32 cmd, Fw::EightyCharString str) {
|
I32 DuckImpl::inputPort2_Msg1_handler(U32 cmd, Fw::String str) {
|
||||||
// User code is written here.
|
// User code is written here.
|
||||||
printf("\n\t*** %s: inputPort2_Msg1_handler(%d, %s) down-call\n", this->m_objName, cmd, str.toChar());
|
printf("\n\t*** %s: inputPort2_Msg1_handler(%d, %s) down-call\n", this->m_objName, cmd, str.toChar());
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -14,10 +14,10 @@ namespace Duck {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// downcall for input ports
|
// downcall for input ports
|
||||||
I32 externInputPort1_Msg1_handler(U32 cmd, Fw::EightyCharString str);
|
I32 externInputPort1_Msg1_handler(U32 cmd, Fw::String str);
|
||||||
I32 externInputPort3_Msg3_handler(U32 cmd);
|
I32 externInputPort3_Msg3_handler(U32 cmd);
|
||||||
I32 inputPort1_Msg1_handler(U32 cmd, Fw::EightyCharString str);
|
I32 inputPort1_Msg1_handler(U32 cmd, Fw::String str);
|
||||||
I32 inputPort2_Msg1_handler(U32 cmd, Fw::EightyCharString str);
|
I32 inputPort2_Msg1_handler(U32 cmd, Fw::String str);
|
||||||
I32 inputPort3_Msg3_handler(U32 cmd);
|
I32 inputPort3_Msg3_handler(U32 cmd);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface name="Msg1" namespace="Ports">
|
<interface name="Msg1" namespace="Ports">
|
||||||
<include_header>Fw/Types/FwStringType</include_header>
|
<include_header>Fw/Types/String.hpp</include_header>
|
||||||
<include_header>Fw/Types/FwEightyCharString</include_header>
|
|
||||||
<comment>
|
<comment>
|
||||||
Msg 1 Interface to send cmd and stat arguments.
|
Msg 1 Interface to send cmd and stat arguments.
|
||||||
</comment>
|
</comment>
|
||||||
@ -9,9 +8,8 @@
|
|||||||
<arg name="cmd" type="U32">
|
<arg name="cmd" type="U32">
|
||||||
<comment>The U32 cmd argument</comment>
|
<comment>The U32 cmd argument</comment>
|
||||||
</arg>
|
</arg>
|
||||||
<arg name="str" type="Fw::EightyCharString">
|
<arg name="str" type="Fw::String">
|
||||||
<comment>The 80 character string str argument</comment>
|
<comment>The 80 character string str argument</comment>
|
||||||
</arg>
|
</arg>
|
||||||
</args>
|
</args>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ int main(int argc, char* argv[]) {
|
|||||||
// Ask for input to huey or duey here.
|
// Ask for input to huey or duey here.
|
||||||
char in[80];
|
char in[80];
|
||||||
U32 cmd;
|
U32 cmd;
|
||||||
Fw::EightyCharString *str;
|
Fw::String *str;
|
||||||
char str2[80];
|
char str2[80];
|
||||||
//
|
//
|
||||||
while ( strcmp(in,"quit") != 0) {
|
while ( strcmp(in,"quit") != 0) {
|
||||||
@ -101,7 +101,7 @@ int main(int argc, char* argv[]) {
|
|||||||
cout << "Enter short string: ";
|
cout << "Enter short string: ";
|
||||||
cin >> str2;
|
cin >> str2;
|
||||||
cout << "The string 2 is: " << str2 << endl;
|
cout << "The string 2 is: " << str2 << endl;
|
||||||
str = new Fw::EightyCharString(str2);
|
str = new Fw::String(str2);
|
||||||
cout << "hueyComp_ptr->getexternInputPort1InputPort()->msg_in(" << cmd << "," << str2 << ")" << endl;
|
cout << "hueyComp_ptr->getexternInputPort1InputPort()->msg_in(" << cmd << "," << str2 << ")" << endl;
|
||||||
hueyComp_ptr->getexternInputPort1Msg1InputPort()->msg_in(cmd,*str);
|
hueyComp_ptr->getexternInputPort1Msg1InputPort()->msg_in(cmd,*str);
|
||||||
} else if (in[0] == '3') {
|
} else if (in[0] == '3') {
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#include <Autocoders/Python/templates/ExampleType.hpp>
|
#include <Autocoders/Python/templates/ExampleType.hpp>
|
||||||
#include <Fw/Types/Assert.hpp>
|
#include <Fw/Types/Assert.hpp>
|
||||||
#if FW_SERIALIZABLE_TO_STRING
|
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#endif
|
|
||||||
namespace ANameSpace {
|
namespace ANameSpace {
|
||||||
|
|
||||||
mytype::mytype(): Serializable() {
|
mytype::mytype(): Serializable() {
|
||||||
@ -22,9 +20,9 @@ mytype::mytype(U32 val) : Serializable() {
|
|||||||
this->setVal(val);
|
this->setVal(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mytype& mytype::operator=(const mytype& src) {
|
mytype& mytype::operator=(const mytype& src) {
|
||||||
this->setVal(src.m_val);
|
this->setVal(src.m_val);
|
||||||
return src;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mytype::operator==(const mytype& src) const {
|
bool mytype::operator==(const mytype& src) const {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ namespace ANameSpace {
|
|||||||
mytype(const mytype* src); // copy constructor
|
mytype(const mytype* src); // copy constructor
|
||||||
mytype(const mytype& src); // copy constructor
|
mytype(const mytype& src); // copy constructor
|
||||||
mytype(U32 arg); // constructor with arguments
|
mytype(U32 arg); // constructor with arguments
|
||||||
const mytype& operator=(const mytype& src); // Equal operator
|
mytype& operator=(const mytype& src); // Equal operator
|
||||||
bool operator==(const mytype& src) const;
|
bool operator==(const mytype& src) const;
|
||||||
|
|
||||||
void setVal(U32 arg); // set values
|
void setVal(U32 arg); // set values
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#include <Autocoders/Python/test/port_nogen/ExampleType.hpp>
|
#include <Autocoders/Python/test/port_nogen/ExampleType.hpp>
|
||||||
#include <Fw/Types/Assert.hpp>
|
#include <Fw/Types/Assert.hpp>
|
||||||
#if FW_SERIALIZABLE_TO_STRING
|
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#endif
|
|
||||||
namespace ANameSpace {
|
namespace ANameSpace {
|
||||||
|
|
||||||
mytype::mytype(): Serializable() {
|
mytype::mytype(): Serializable() {
|
||||||
@ -22,9 +20,9 @@ mytype::mytype(U32 val) : Serializable() {
|
|||||||
this->setVal(val);
|
this->setVal(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mytype& mytype::operator=(const mytype& src) {
|
mytype& mytype::operator=(const mytype& src) {
|
||||||
this->setVal(src.m_val);
|
this->setVal(src.m_val);
|
||||||
return src;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mytype::operator==(const mytype& src) const {
|
bool mytype::operator==(const mytype& src) const {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ namespace ANameSpace {
|
|||||||
mytype(const mytype* src); // copy constructor
|
mytype(const mytype* src); // copy constructor
|
||||||
mytype(const mytype& src); // copy constructor
|
mytype(const mytype& src); // copy constructor
|
||||||
mytype(U32 arg); // constructor with arguments
|
mytype(U32 arg); // constructor with arguments
|
||||||
const mytype& operator=(const mytype& src); // Equal operator
|
mytype& operator=(const mytype& src); // Equal operator
|
||||||
bool operator==(const mytype& src) const; // equality operator
|
bool operator==(const mytype& src) const; // equality operator
|
||||||
void setVal(U32 arg); // set values
|
void setVal(U32 arg); // set values
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Autocoders/Python/test/serialize_user/ExampleComponentImpl.hpp>
|
#include <Autocoders/Python/test/serialize_user/ExampleComponentImpl.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#if FW_OBJECT_NAMES == 1
|
#if FW_OBJECT_NAMES == 1
|
||||||
@ -26,7 +26,7 @@ ExampleComponentImpl::~ExampleComponentImpl() {
|
|||||||
|
|
||||||
void ExampleComponentImpl::exampleInput_handler(NATIVE_INT_TYPE portNum, I32 arg1, ANameSpace::UserSerializer arg2) {
|
void ExampleComponentImpl::exampleInput_handler(NATIVE_INT_TYPE portNum, I32 arg1, ANameSpace::UserSerializer arg2) {
|
||||||
|
|
||||||
Fw::EightyCharString str;
|
Fw::String str;
|
||||||
arg2.toString(str);
|
arg2.toString(str);
|
||||||
printf("ARG: %s\n",str.toChar());
|
printf("ARG: %s\n",str.toChar());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,10 +2,6 @@
|
|||||||
#include <Fw/Types/Assert.hpp>
|
#include <Fw/Types/Assert.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#if FW_SERIALIZABLE_TO_STRING
|
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace ANameSpace {
|
namespace ANameSpace {
|
||||||
|
|
||||||
UserSerializer::UserSerializer(): Serializable() {
|
UserSerializer::UserSerializer(): Serializable() {
|
||||||
@ -25,9 +21,9 @@ UserSerializer::UserSerializer(SomeUserStruct val) : Serializable() {
|
|||||||
this->setVal(val);
|
this->setVal(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SomeUserStruct& UserSerializer::operator=(const SomeUserStruct& src) {
|
SomeUserStruct& UserSerializer::operator=(const SomeUserStruct& src) {
|
||||||
this->setVal(src);
|
this->setVal(src);
|
||||||
return src;
|
return this->m_struct;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserSerializer::getVal(SomeUserStruct& arg) {
|
void UserSerializer::getVal(SomeUserStruct& arg) {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ namespace ANameSpace {
|
|||||||
UserSerializer(const SomeUserStruct* src); // copy constructor
|
UserSerializer(const SomeUserStruct* src); // copy constructor
|
||||||
UserSerializer(const SomeUserStruct& src); // copy constructor
|
UserSerializer(const SomeUserStruct& src); // copy constructor
|
||||||
UserSerializer(SomeUserStruct arg); // constructor with arguments
|
UserSerializer(SomeUserStruct arg); // constructor with arguments
|
||||||
const SomeUserStruct& operator=(const SomeUserStruct& src); // Equal operator
|
SomeUserStruct& operator=(const SomeUserStruct& src); // Equal operator
|
||||||
|
|
||||||
void setVal(const SomeUserStruct& arg); // set values
|
void setVal(const SomeUserStruct& arg); // set values
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Autocoders/Python/test/stress/TestCommandImpl.hpp>
|
#include <Autocoders/Python/test/stress/TestCommandImpl.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#if FW_OBJECT_NAMES == 1
|
#if FW_OBJECT_NAMES == 1
|
||||||
@ -29,7 +29,7 @@ void TestCommand1Impl::aport_handler(NATIVE_INT_TYPE portNum, I32 arg4, F32 arg5
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TestCommand1Impl::aport2_handler(NATIVE_INT_TYPE portNum, I32 arg4, F32 arg5, Ref::Gnc::Quaternion arg6) {
|
void TestCommand1Impl::aport2_handler(NATIVE_INT_TYPE portNum, I32 arg4, F32 arg5, Ref::Gnc::Quaternion arg6) {
|
||||||
Fw::EightyCharString str;
|
Fw::String str;
|
||||||
arg6.toString(str);
|
arg6.toString(str);
|
||||||
printf("Received aport2_Test2_handler call with %i %f %s\n",arg4,arg5,str.toChar());
|
printf("Received aport2_Test2_handler call with %i %f %s\n",arg4,arg5,str.toChar());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Autocoders/Python/test/stress/TestTelemRecvImpl.hpp>
|
#include <Autocoders/Python/test/stress/TestTelemRecvImpl.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <Autocoders/Python/test/stress/QuaternionSerializableAc.hpp>
|
#include <Autocoders/Python/test/stress/QuaternionSerializableAc.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ TestTelemRecvImpl::~TestTelemRecvImpl() {
|
|||||||
void TestTelemRecvImpl::tlmRecvPort_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) {
|
void TestTelemRecvImpl::tlmRecvPort_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) {
|
||||||
Ref::Gnc::Quaternion tlmVal;
|
Ref::Gnc::Quaternion tlmVal;
|
||||||
val.deserialize(tlmVal);
|
val.deserialize(tlmVal);
|
||||||
Fw::EightyCharString str;
|
Fw::String str;
|
||||||
#if FW_SERIALIZABLE_TO_STRING
|
#if FW_SERIALIZABLE_TO_STRING
|
||||||
tlmVal.toString(str);
|
tlmVal.toString(str);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Autocoders/Python/test/tlm2/TestTelemRecvImpl.hpp>
|
#include <Autocoders/Python/test/tlm2/TestTelemRecvImpl.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <Autocoders/Python/test/tlm2/QuaternionSerializableAc.hpp>
|
#include <Autocoders/Python/test/tlm2/QuaternionSerializableAc.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ TestTelemRecvImpl::~TestTelemRecvImpl() {
|
|||||||
void TestTelemRecvImpl::tlmRecvPort_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) {
|
void TestTelemRecvImpl::tlmRecvPort_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) {
|
||||||
Ref::Gnc::Quaternion tlmVal;
|
Ref::Gnc::Quaternion tlmVal;
|
||||||
val.deserialize(tlmVal);
|
val.deserialize(tlmVal);
|
||||||
Fw::EightyCharString str;
|
Fw::String str;
|
||||||
tlmVal.toString(str);
|
tlmVal.toString(str);
|
||||||
printf("ID: %d TLM value is %s. Time is %d:%d base: %d\n",id,str.toChar(),timeTag.getSeconds(),timeTag.getUSeconds(),timeTag.getTimeBase());
|
printf("ID: %d TLM value is %s. Time is %d:%d base: %d\n",id,str.toChar(),timeTag.getSeconds(),timeTag.getUSeconds(),timeTag.getTimeBase());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace CFDP {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Checksum& Checksum ::
|
Checksum& Checksum ::
|
||||||
operator=(const Checksum& checksum)
|
operator=(const Checksum& checksum)
|
||||||
{
|
{
|
||||||
this->value = checksum.value;
|
this->value = checksum.value;
|
||||||
|
|||||||
@ -53,7 +53,7 @@ namespace CFDP {
|
|||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
//! Assign checksum to this
|
//! Assign checksum to this
|
||||||
const Checksum& operator=(const Checksum& checksum);
|
Checksum& operator=(const Checksum& checksum);
|
||||||
|
|
||||||
//! Compare checksum and this for equality
|
//! Compare checksum and this for equality
|
||||||
bool operator==(const Checksum& checksum) const;
|
bool operator==(const Checksum& checksum) const;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Drv {
|
|||||||
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
}
|
}
|
||||||
|
|
||||||
const DataBuffer& DataBuffer::operator=(const DataBuffer& other) {
|
DataBuffer& DataBuffer::operator=(const DataBuffer& other) {
|
||||||
Fw::SerializeStatus stat = Fw::SerializeBufferBase::setBuff(other.m_data,other.getBuffLength());
|
Fw::SerializeStatus stat = Fw::SerializeBufferBase::setBuff(other.m_data,other.getBuffLength());
|
||||||
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Drv {
|
|||||||
DataBuffer();
|
DataBuffer();
|
||||||
DataBuffer(const DataBuffer& other);
|
DataBuffer(const DataBuffer& other);
|
||||||
virtual ~DataBuffer();
|
virtual ~DataBuffer();
|
||||||
const DataBuffer& operator=(const DataBuffer& other);
|
DataBuffer& operator=(const DataBuffer& other);
|
||||||
|
|
||||||
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
||||||
U8* getBuffAddr();
|
U8* getBuffAddr();
|
||||||
|
|||||||
@ -49,8 +49,8 @@ void fill_random_buffer(Fw::Buffer &buffer) {
|
|||||||
|
|
||||||
void send_recv(Drv::IpSocket& sender, Drv::IpSocket& receiver) {
|
void send_recv(Drv::IpSocket& sender, Drv::IpSocket& receiver) {
|
||||||
I32 size = MAX_DRV_TEST_MESSAGE_SIZE;
|
I32 size = MAX_DRV_TEST_MESSAGE_SIZE;
|
||||||
U8 buffer_out[MAX_DRV_TEST_MESSAGE_SIZE];
|
U8 buffer_out[MAX_DRV_TEST_MESSAGE_SIZE] = {0};
|
||||||
U8 buffer_in[MAX_DRV_TEST_MESSAGE_SIZE];
|
U8 buffer_in[MAX_DRV_TEST_MESSAGE_SIZE] = {0};
|
||||||
|
|
||||||
// Send receive validate block
|
// Send receive validate block
|
||||||
Drv::Test::fill_random_data(buffer_out, MAX_DRV_TEST_MESSAGE_SIZE);
|
Drv::Test::fill_random_data(buffer_out, MAX_DRV_TEST_MESSAGE_SIZE);
|
||||||
@ -71,4 +71,4 @@ bool wait_on_change(Drv::IpSocket &socket, bool open, U32 iterations) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
#include <Drv/Ip/TcpClientSocket.hpp>
|
#include <Drv/Ip/TcpClientSocket.hpp>
|
||||||
#include <Drv/Ip/TcpServerSocket.hpp>
|
#include <Drv/Ip/TcpServerSocket.hpp>
|
||||||
#include <Drv/Ip/IpSocket.hpp>
|
#include <Drv/Ip/IpSocket.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#include <Os/Log.hpp>
|
#include <Os/Log.hpp>
|
||||||
#include <Fw/Logger/Logger.hpp>
|
#include <Fw/Logger/Logger.hpp>
|
||||||
#include <Drv/Ip/test/ut/PortSelector.hpp>
|
#include <Drv/Ip/test/ut/PortSelector.hpp>
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <Drv/Ip/UdpSocket.hpp>
|
#include <Drv/Ip/UdpSocket.hpp>
|
||||||
#include <Drv/Ip/IpSocket.hpp>
|
#include <Drv/Ip/IpSocket.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#include <Os/Log.hpp>
|
#include <Os/Log.hpp>
|
||||||
#include <Fw/Logger/Logger.hpp>
|
#include <Fw/Logger/Logger.hpp>
|
||||||
#include <Drv/Ip/test/ut/PortSelector.hpp>
|
#include <Drv/Ip/test/ut/PortSelector.hpp>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include <Tester.hpp>
|
#include <Tester.hpp>
|
||||||
|
#include <Fw/Types/StringUtils.hpp>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -29,7 +30,7 @@ int main(int argc, char* argv[]) {
|
|||||||
addr = strtoul(optarg,0,0);
|
addr = strtoul(optarg,0,0);
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
strcpy(device,optarg);
|
Fw::StringUtils::string_copy(device, optarg, sizeof(device));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("test_ut %s\n",argv[0],help);
|
printf("test_ut %s\n",argv[0],help);
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Fw {
|
|||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
}
|
}
|
||||||
|
|
||||||
const CmdArgBuffer& CmdArgBuffer::operator=(const CmdArgBuffer& other) {
|
CmdArgBuffer& CmdArgBuffer::operator=(const CmdArgBuffer& other) {
|
||||||
SerializeStatus stat = this->setBuff(other.m_bufferData,other.getBuffLength());
|
SerializeStatus stat = this->setBuff(other.m_bufferData,other.getBuffLength());
|
||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace Fw {
|
|||||||
CmdArgBuffer(); //!< default constructor
|
CmdArgBuffer(); //!< default constructor
|
||||||
CmdArgBuffer(const CmdArgBuffer& other); //!< other arg buffer constructor
|
CmdArgBuffer(const CmdArgBuffer& other); //!< other arg buffer constructor
|
||||||
virtual ~CmdArgBuffer(); //!< destructor
|
virtual ~CmdArgBuffer(); //!< destructor
|
||||||
const CmdArgBuffer& operator=(const CmdArgBuffer& other); //!< Equal operator
|
CmdArgBuffer& operator=(const CmdArgBuffer& other); //!< Equal operator
|
||||||
|
|
||||||
NATIVE_UINT_TYPE getBuffCapacity() const; //!< return capacity of buffer (how much it can hold)
|
NATIVE_UINT_TYPE getBuffCapacity() const; //!< return capacity of buffer (how much it can hold)
|
||||||
U8* getBuffAddr(); //!< return address of buffer (non const version)
|
U8* getBuffAddr(); //!< return address of buffer (non const version)
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Fw {
|
|||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
}
|
}
|
||||||
|
|
||||||
const ComBuffer& ComBuffer::operator=(const ComBuffer& other) {
|
ComBuffer& ComBuffer::operator=(const ComBuffer& other) {
|
||||||
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@ -30,7 +30,7 @@ namespace Fw {
|
|||||||
ComBuffer();
|
ComBuffer();
|
||||||
ComBuffer(const ComBuffer& other);
|
ComBuffer(const ComBuffer& other);
|
||||||
virtual ~ComBuffer();
|
virtual ~ComBuffer();
|
||||||
const ComBuffer& operator=(const ComBuffer& other);
|
ComBuffer& operator=(const ComBuffer& other);
|
||||||
|
|
||||||
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
||||||
U8* getBuffAddr();
|
U8* getBuffAddr();
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Fw {
|
|||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
}
|
}
|
||||||
|
|
||||||
const LogBuffer& LogBuffer::operator=(const LogBuffer& other) {
|
LogBuffer& LogBuffer::operator=(const LogBuffer& other) {
|
||||||
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace Fw {
|
|||||||
LogBuffer();
|
LogBuffer();
|
||||||
LogBuffer(const LogBuffer& other);
|
LogBuffer(const LogBuffer& other);
|
||||||
virtual ~LogBuffer();
|
virtual ~LogBuffer();
|
||||||
const LogBuffer& operator=(const LogBuffer& other);
|
LogBuffer& operator=(const LogBuffer& other);
|
||||||
|
|
||||||
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
||||||
U8* getBuffAddr();
|
U8* getBuffAddr();
|
||||||
|
|||||||
@ -102,7 +102,7 @@ namespace Fw {
|
|||||||
this->m_buf[size < sizeof(this->m_buf)?size:sizeof(this->m_buf)-1] = 0;
|
this->m_buf[size < sizeof(this->m_buf)?size:sizeof(this->m_buf)-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LogStringArg& LogStringArg::operator=(const LogStringArg& other) {
|
LogStringArg& LogStringArg::operator=(const LogStringArg& other) {
|
||||||
Fw::StringUtils::string_copy(this->m_buf, other.toChar(), sizeof(this->m_buf));
|
Fw::StringUtils::string_copy(this->m_buf, other.toChar(), sizeof(this->m_buf));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ namespace Fw {
|
|||||||
// This method is set by the autocode to the max length specified in the XML declaration for a particular event.
|
// This method is set by the autocode to the max length specified in the XML declaration for a particular event.
|
||||||
void setMaxSerialize(NATIVE_UINT_TYPE size); // limit amount serialized
|
void setMaxSerialize(NATIVE_UINT_TYPE size); // limit amount serialized
|
||||||
|
|
||||||
const LogStringArg& operator=(const LogStringArg& other); //!< equal operator for other strings
|
LogStringArg& operator=(const LogStringArg& other); //!< equal operator for other strings
|
||||||
|
|
||||||
SerializeStatus serialize(SerializeBufferBase& buffer) const;
|
SerializeStatus serialize(SerializeBufferBase& buffer) const;
|
||||||
SerializeStatus deserialize(SerializeBufferBase& buffer);
|
SerializeStatus deserialize(SerializeBufferBase& buffer);
|
||||||
|
|||||||
@ -67,7 +67,7 @@ namespace Fw {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogAssertHook::printAssert(const I8* msg) {
|
void LogAssertHook::printAssert(const CHAR* msg) {
|
||||||
// do nothing since reportAssert() sends message
|
// do nothing since reportAssert() sends message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ namespace Fw {
|
|||||||
AssertArg arg5,
|
AssertArg arg5,
|
||||||
AssertArg arg6
|
AssertArg arg6
|
||||||
);
|
);
|
||||||
void printAssert(const I8* msg);
|
void printAssert(const CHAR* msg);
|
||||||
void doAssert();
|
void doAssert();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
namespace LoggerRules {
|
namespace LoggerRules {
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Register::Register(const Fw::EightyCharString& name) : STest::Rule<MockLogging::FakeLogger>(name.toChar()) {}
|
Register::Register(const Fw::String& name) : STest::Rule<MockLogging::FakeLogger>(name.toChar()) {}
|
||||||
|
|
||||||
// Check for registration, always allowed
|
// Check for registration, always allowed
|
||||||
bool Register::precondition(const MockLogging::FakeLogger& truth) {
|
bool Register::precondition(const MockLogging::FakeLogger& truth) {
|
||||||
@ -40,7 +40,7 @@ namespace LoggerRules {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
LogGood::LogGood(const Fw::EightyCharString& name) : STest::Rule<MockLogging::FakeLogger>(name.toChar()) {}
|
LogGood::LogGood(const Fw::String& name) : STest::Rule<MockLogging::FakeLogger>(name.toChar()) {}
|
||||||
|
|
||||||
// Check for logging, only when not NULL
|
// Check for logging, only when not NULL
|
||||||
bool LogGood::precondition(const MockLogging::FakeLogger& truth) {
|
bool LogGood::precondition(const MockLogging::FakeLogger& truth) {
|
||||||
@ -113,7 +113,7 @@ namespace LoggerRules {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
LogBad::LogBad(const Fw::EightyCharString& name) : STest::Rule<MockLogging::FakeLogger>(name.toChar()) {}
|
LogBad::LogBad(const Fw::String& name) : STest::Rule<MockLogging::FakeLogger>(name.toChar()) {}
|
||||||
|
|
||||||
// Check for logging, only when not NULL
|
// Check for logging, only when not NULL
|
||||||
bool LogBad::precondition(const MockLogging::FakeLogger& truth) {
|
bool LogBad::precondition(const MockLogging::FakeLogger& truth) {
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#define FPRIME_LOGGERRULES_HPP
|
#define FPRIME_LOGGERRULES_HPP
|
||||||
|
|
||||||
#include <Fw/Types/BasicTypes.hpp>
|
#include <Fw/Types/BasicTypes.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <Fw/Logger/test/ut/FakeLogger.hpp>
|
#include <Fw/Logger/test/ut/FakeLogger.hpp>
|
||||||
#include <STest/STest/Rule/Rule.hpp>
|
#include <STest/STest/Rule/Rule.hpp>
|
||||||
#include <STest/STest/Pick/Pick.hpp>
|
#include <STest/STest/Pick/Pick.hpp>
|
||||||
@ -32,7 +32,7 @@ namespace LoggerRules {
|
|||||||
*/
|
*/
|
||||||
struct Register : public STest::Rule<MockLogging::FakeLogger> {
|
struct Register : public STest::Rule<MockLogging::FakeLogger> {
|
||||||
// Constructor
|
// Constructor
|
||||||
Register(const Fw::EightyCharString& name);
|
Register(const Fw::String& name);
|
||||||
|
|
||||||
// Check for registration, always allowed
|
// Check for registration, always allowed
|
||||||
bool precondition(const MockLogging::FakeLogger& truth);
|
bool precondition(const MockLogging::FakeLogger& truth);
|
||||||
@ -47,7 +47,7 @@ namespace LoggerRules {
|
|||||||
*/
|
*/
|
||||||
struct LogGood : public STest::Rule<MockLogging::FakeLogger> {
|
struct LogGood : public STest::Rule<MockLogging::FakeLogger> {
|
||||||
// Constructor
|
// Constructor
|
||||||
LogGood(const Fw::EightyCharString& name);
|
LogGood(const Fw::String& name);
|
||||||
|
|
||||||
// Check for logging, only when not NULL
|
// Check for logging, only when not NULL
|
||||||
bool precondition(const MockLogging::FakeLogger& truth);
|
bool precondition(const MockLogging::FakeLogger& truth);
|
||||||
@ -63,7 +63,7 @@ namespace LoggerRules {
|
|||||||
*/
|
*/
|
||||||
struct LogBad : public STest::Rule<MockLogging::FakeLogger> {
|
struct LogBad : public STest::Rule<MockLogging::FakeLogger> {
|
||||||
// Constructor
|
// Constructor
|
||||||
LogBad(const Fw::EightyCharString& name);
|
LogBad(const Fw::String& name);
|
||||||
|
|
||||||
// Check for logging, only when not NULL
|
// Check for logging, only when not NULL
|
||||||
bool precondition(const MockLogging::FakeLogger& truth);
|
bool precondition(const MockLogging::FakeLogger& truth);
|
||||||
|
|||||||
@ -19,11 +19,11 @@ namespace Fw {
|
|||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
}
|
}
|
||||||
|
|
||||||
const ParamBuffer& ParamBuffer::operator=(const ParamBuffer& other) {
|
ParamBuffer& ParamBuffer::operator=(const ParamBuffer& other) {
|
||||||
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
NATIVE_UINT_TYPE ParamBuffer::getBuffCapacity() const {
|
NATIVE_UINT_TYPE ParamBuffer::getBuffCapacity() const {
|
||||||
return sizeof(this->m_bufferData);
|
return sizeof(this->m_bufferData);
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace Fw {
|
|||||||
ParamBuffer();
|
ParamBuffer();
|
||||||
ParamBuffer(const ParamBuffer& other);
|
ParamBuffer(const ParamBuffer& other);
|
||||||
virtual ~ParamBuffer();
|
virtual ~ParamBuffer();
|
||||||
const ParamBuffer& operator=(const ParamBuffer& other);
|
ParamBuffer& operator=(const ParamBuffer& other);
|
||||||
|
|
||||||
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
||||||
U8* getBuffAddr();
|
U8* getBuffAddr();
|
||||||
|
|||||||
@ -40,7 +40,7 @@ namespace Fw {
|
|||||||
this->m_seconds = seconds;
|
this->m_seconds = seconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Time& Time::operator=(const Time& other) {
|
Time& Time::operator=(const Time& other) {
|
||||||
this->m_timeBase = other.m_timeBase;
|
this->m_timeBase = other.m_timeBase;
|
||||||
this->m_timeContext = other.m_timeContext;
|
this->m_timeContext = other.m_timeContext;
|
||||||
this->m_useconds = other.m_useconds;
|
this->m_useconds = other.m_useconds;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ namespace Fw {
|
|||||||
bool operator<(const Time& other) const;
|
bool operator<(const Time& other) const;
|
||||||
bool operator>=(const Time& other) const;
|
bool operator>=(const Time& other) const;
|
||||||
bool operator<=(const Time& other) const;
|
bool operator<=(const Time& other) const;
|
||||||
const Time& operator=(const Time& other);
|
Time& operator=(const Time& other);
|
||||||
|
|
||||||
// Static methods:
|
// Static methods:
|
||||||
//! The type of a comparison result
|
//! The type of a comparison result
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Fw {
|
|||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
}
|
}
|
||||||
|
|
||||||
const TlmBuffer& TlmBuffer::operator=(const TlmBuffer& other) {
|
TlmBuffer& TlmBuffer::operator=(const TlmBuffer& other) {
|
||||||
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
||||||
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@ -30,7 +30,7 @@ namespace Fw {
|
|||||||
TlmBuffer();
|
TlmBuffer();
|
||||||
TlmBuffer(const TlmBuffer& other);
|
TlmBuffer(const TlmBuffer& other);
|
||||||
virtual ~TlmBuffer();
|
virtual ~TlmBuffer();
|
||||||
const TlmBuffer& operator=(const TlmBuffer& other);
|
TlmBuffer& operator=(const TlmBuffer& other);
|
||||||
|
|
||||||
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
|
||||||
U8* getBuffAddr();
|
U8* getBuffAddr();
|
||||||
|
|||||||
@ -91,7 +91,7 @@ namespace Fw {
|
|||||||
this->m_buf[size < sizeof(this->m_buf)?size:sizeof(this->m_buf)-1] = 0;
|
this->m_buf[size < sizeof(this->m_buf)?size:sizeof(this->m_buf)-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TlmString& TlmString::operator=(const TlmString& other) {
|
TlmString& TlmString::operator=(const TlmString& other) {
|
||||||
Fw::StringUtils::string_copy(this->m_buf, other.toChar(), sizeof(this->m_buf));
|
Fw::StringUtils::string_copy(this->m_buf, other.toChar(), sizeof(this->m_buf));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ namespace Fw {
|
|||||||
NATIVE_UINT_TYPE length() const;
|
NATIVE_UINT_TYPE length() const;
|
||||||
void setMaxSerialize(NATIVE_UINT_TYPE size); // limit amount serialized
|
void setMaxSerialize(NATIVE_UINT_TYPE size); // limit amount serialized
|
||||||
|
|
||||||
const TlmString& operator=(const TlmString& other); //!< equal operator for other strings
|
TlmString& operator=(const TlmString& other); //!< equal operator for other strings
|
||||||
|
|
||||||
SerializeStatus serialize(SerializeBufferBase& buffer) const;
|
SerializeStatus serialize(SerializeBufferBase& buffer) const;
|
||||||
SerializeStatus deserialize(SerializeBufferBase& buffer);
|
SerializeStatus deserialize(SerializeBufferBase& buffer);
|
||||||
|
|||||||
@ -7,6 +7,8 @@
|
|||||||
#include <taskLib.h>
|
#include <taskLib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define FW_ASSERT_DFL_MSG_LEN 256
|
||||||
|
|
||||||
#if FW_ASSERT_LEVEL == FW_NO_ASSERT
|
#if FW_ASSERT_LEVEL == FW_NO_ASSERT
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -19,8 +21,8 @@
|
|||||||
|
|
||||||
namespace Fw {
|
namespace Fw {
|
||||||
|
|
||||||
void defaultPrintAssert(const I8* msg) {
|
void defaultPrintAssert(const CHAR* msg) {
|
||||||
(void)fprintf(stderr,"%s\n",reinterpret_cast<const char*>(msg));
|
(void)fprintf(stderr,"%s\n", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void defaultReportAssert
|
void defaultReportAssert
|
||||||
@ -34,36 +36,36 @@ namespace Fw {
|
|||||||
AssertArg arg4,
|
AssertArg arg4,
|
||||||
AssertArg arg5,
|
AssertArg arg5,
|
||||||
AssertArg arg6,
|
AssertArg arg6,
|
||||||
I8* destBuffer,
|
CHAR* destBuffer,
|
||||||
NATIVE_INT_TYPE buffSize
|
NATIVE_INT_TYPE buffSize
|
||||||
) {
|
) {
|
||||||
|
|
||||||
switch (numArgs) {
|
switch (numArgs) {
|
||||||
case 0:
|
case 0:
|
||||||
(void)snprintf((char*)destBuffer,buffSize,fileIdFs,file,lineNo);
|
(void)snprintf(destBuffer,buffSize,fileIdFs,file,lineNo);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
(void)snprintf((char*)destBuffer,buffSize,fileIdFs "%d",file,lineNo,
|
(void)snprintf(destBuffer,buffSize,fileIdFs "%d",file,lineNo,
|
||||||
arg1);
|
arg1);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
(void)snprintf((char*)destBuffer,buffSize,fileIdFs "%d %d",file,lineNo,
|
(void)snprintf(destBuffer,buffSize,fileIdFs "%d %d",file,lineNo,
|
||||||
arg1,arg2);
|
arg1,arg2);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
(void)snprintf((char*)destBuffer,buffSize,fileIdFs "%d %d %d",file,lineNo,
|
(void)snprintf(destBuffer,buffSize,fileIdFs "%d %d %d",file,lineNo,
|
||||||
arg1,arg2,arg3);
|
arg1,arg2,arg3);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
(void)snprintf((char*)destBuffer,buffSize,fileIdFs "%d %d %d %d",file,lineNo,
|
(void)snprintf(destBuffer,buffSize,fileIdFs "%d %d %d %d",file,lineNo,
|
||||||
arg1,arg2,arg3,arg4);
|
arg1,arg2,arg3,arg4);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
(void)snprintf((char*)destBuffer,buffSize,fileIdFs "%d %d %d %d %d",file,lineNo,
|
(void)snprintf(destBuffer,buffSize,fileIdFs "%d %d %d %d %d",file,lineNo,
|
||||||
arg1,arg2,arg3,arg4,arg5);
|
arg1,arg2,arg3,arg4,arg5);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
(void)snprintf((char*)destBuffer,buffSize,fileIdFs "%d %d %d %d %d %d",file,lineNo,
|
(void)snprintf(destBuffer,buffSize,fileIdFs "%d %d %d %d %d %d",file,lineNo,
|
||||||
arg1,arg2,arg3,arg4,arg5,arg6);
|
arg1,arg2,arg3,arg4,arg5,arg6);
|
||||||
break;
|
break;
|
||||||
default: // in an assert already, what can we do?
|
default: // in an assert already, what can we do?
|
||||||
@ -75,7 +77,7 @@ namespace Fw {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssertHook::printAssert(const I8* msg) {
|
void AssertHook::printAssert(const CHAR* msg) {
|
||||||
defaultPrintAssert(msg);
|
defaultPrintAssert(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +94,7 @@ namespace Fw {
|
|||||||
AssertArg arg6
|
AssertArg arg6
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
I8 destBuffer[256];
|
CHAR destBuffer[FW_ASSERT_DFL_MSG_LEN];
|
||||||
defaultReportAssert
|
defaultReportAssert
|
||||||
(
|
(
|
||||||
file,
|
file,
|
||||||
@ -128,7 +130,7 @@ namespace Fw {
|
|||||||
|
|
||||||
NATIVE_INT_TYPE SwAssert(FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo) {
|
NATIVE_INT_TYPE SwAssert(FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo) {
|
||||||
if (NULL == s_assertHook) {
|
if (NULL == s_assertHook) {
|
||||||
I8 assertMsg[256];
|
CHAR assertMsg[FW_ASSERT_DFL_MSG_LEN];
|
||||||
defaultReportAssert(
|
defaultReportAssert(
|
||||||
file,
|
file,
|
||||||
lineNo,
|
lineNo,
|
||||||
@ -153,7 +155,7 @@ namespace Fw {
|
|||||||
NATIVE_INT_TYPE SwAssert(FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo,
|
NATIVE_INT_TYPE SwAssert(FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo,
|
||||||
AssertArg arg1) {
|
AssertArg arg1) {
|
||||||
if (NULL == s_assertHook) {
|
if (NULL == s_assertHook) {
|
||||||
I8 assertMsg[256];
|
CHAR assertMsg[FW_ASSERT_DFL_MSG_LEN];
|
||||||
defaultReportAssert(
|
defaultReportAssert(
|
||||||
file,
|
file,
|
||||||
lineNo,
|
lineNo,
|
||||||
@ -179,7 +181,7 @@ namespace Fw {
|
|||||||
AssertArg arg1,
|
AssertArg arg1,
|
||||||
AssertArg arg2) {
|
AssertArg arg2) {
|
||||||
if (NULL == s_assertHook) {
|
if (NULL == s_assertHook) {
|
||||||
I8 assertMsg[256];
|
CHAR assertMsg[FW_ASSERT_DFL_MSG_LEN];
|
||||||
defaultReportAssert(
|
defaultReportAssert(
|
||||||
file,
|
file,
|
||||||
lineNo,
|
lineNo,
|
||||||
@ -205,7 +207,7 @@ namespace Fw {
|
|||||||
AssertArg arg2,
|
AssertArg arg2,
|
||||||
AssertArg arg3) {
|
AssertArg arg3) {
|
||||||
if (NULL == s_assertHook) {
|
if (NULL == s_assertHook) {
|
||||||
I8 assertMsg[256];
|
CHAR assertMsg[FW_ASSERT_DFL_MSG_LEN];
|
||||||
defaultReportAssert(
|
defaultReportAssert(
|
||||||
file,
|
file,
|
||||||
lineNo,
|
lineNo,
|
||||||
@ -232,7 +234,7 @@ namespace Fw {
|
|||||||
AssertArg arg3,
|
AssertArg arg3,
|
||||||
AssertArg arg4) {
|
AssertArg arg4) {
|
||||||
if (NULL == s_assertHook) {
|
if (NULL == s_assertHook) {
|
||||||
I8 assertMsg[256];
|
CHAR assertMsg[FW_ASSERT_DFL_MSG_LEN];
|
||||||
defaultReportAssert(
|
defaultReportAssert(
|
||||||
file,
|
file,
|
||||||
lineNo,
|
lineNo,
|
||||||
@ -260,7 +262,7 @@ namespace Fw {
|
|||||||
AssertArg arg4,
|
AssertArg arg4,
|
||||||
AssertArg arg5) {
|
AssertArg arg5) {
|
||||||
if (NULL == s_assertHook) {
|
if (NULL == s_assertHook) {
|
||||||
I8 assertMsg[256];
|
CHAR assertMsg[FW_ASSERT_DFL_MSG_LEN];
|
||||||
defaultReportAssert(
|
defaultReportAssert(
|
||||||
file,
|
file,
|
||||||
lineNo,
|
lineNo,
|
||||||
@ -289,7 +291,7 @@ namespace Fw {
|
|||||||
AssertArg arg5,
|
AssertArg arg5,
|
||||||
AssertArg arg6) {
|
AssertArg arg6) {
|
||||||
if (NULL == s_assertHook) {
|
if (NULL == s_assertHook) {
|
||||||
I8 assertMsg[256];
|
CHAR assertMsg[FW_ASSERT_DFL_MSG_LEN];
|
||||||
defaultReportAssert(
|
defaultReportAssert(
|
||||||
file,
|
file,
|
||||||
lineNo,
|
lineNo,
|
||||||
@ -318,7 +320,7 @@ extern "C" {
|
|||||||
|
|
||||||
NATIVE_INT_TYPE CAssert0(FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo) {
|
NATIVE_INT_TYPE CAssert0(FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo) {
|
||||||
if (NULL == Fw::s_assertHook) {
|
if (NULL == Fw::s_assertHook) {
|
||||||
I8 assertMsg[256];
|
CHAR assertMsg[FW_ASSERT_DFL_MSG_LEN];
|
||||||
Fw::defaultReportAssert(
|
Fw::defaultReportAssert(
|
||||||
file,
|
file,
|
||||||
lineNo,
|
lineNo,
|
||||||
|
|||||||
@ -21,10 +21,10 @@
|
|||||||
((void) ((cond) ? (0) : \
|
((void) ((cond) ? (0) : \
|
||||||
(Fw::SwAssert(ASSERT_FILE_ID, __LINE__, ##__VA_ARGS__))))
|
(Fw::SwAssert(ASSERT_FILE_ID, __LINE__, ##__VA_ARGS__))))
|
||||||
#else
|
#else
|
||||||
#define FILE_NAME_ARG const U8*
|
#define FILE_NAME_ARG const CHAR*
|
||||||
#define FW_ASSERT(cond, ...) \
|
#define FW_ASSERT(cond, ...) \
|
||||||
((void) ((cond) ? (0) : \
|
((void) ((cond) ? (0) : \
|
||||||
(Fw::SwAssert((U8*)__FILE__, __LINE__, ##__VA_ARGS__))))
|
(Fw::SwAssert(__FILE__, __LINE__, ##__VA_ARGS__))))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// F' Assertion functions can technically return even though the intention is for the assertion to terminate the program.
|
// F' Assertion functions can technically return even though the intention is for the assertion to terminate the program.
|
||||||
@ -75,7 +75,7 @@ namespace Fw {
|
|||||||
);
|
);
|
||||||
// default reportAssert() will call this when the message is built
|
// default reportAssert() will call this when the message is built
|
||||||
// override it to do another kind of print. printf by default
|
// override it to do another kind of print. printf by default
|
||||||
virtual void printAssert(const I8* msg);
|
virtual void printAssert(const CHAR* msg);
|
||||||
// do assert action. By default, calls assert.
|
// do assert action. By default, calls assert.
|
||||||
// Called after reportAssert()
|
// Called after reportAssert()
|
||||||
virtual void doAssert();
|
virtual void doAssert();
|
||||||
|
|||||||
@ -90,12 +90,14 @@ typedef U8 BYTE; //!< byte type
|
|||||||
typedef int64_t I64; //!< 64-bit signed integer
|
typedef int64_t I64; //!< 64-bit signed integer
|
||||||
typedef uint64_t U64; //!< 64-bit unsigned integer
|
typedef uint64_t U64; //!< 64-bit unsigned integer
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef float F32; //!< 32-bit floating point
|
typedef float F32; //!< 32-bit floating point
|
||||||
#if FW_HAS_F64
|
#if FW_HAS_F64
|
||||||
typedef double F64; //!< 64-bit floating point
|
typedef double F64; //!< 64-bit floating point
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef char CHAR;
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL (0) //!< NULL
|
#define NULL (0) //!< NULL
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -348,7 +348,7 @@ namespace Fw {
|
|||||||
PolyType::~PolyType() {
|
PolyType::~PolyType() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const PolyType& PolyType::operator=(const PolyType &src) {
|
PolyType& PolyType::operator=(const PolyType &src) {
|
||||||
this->m_dataType = src.m_dataType;
|
this->m_dataType = src.m_dataType;
|
||||||
this->m_val = src.m_val;
|
this->m_val = src.m_val;
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@ -98,7 +98,7 @@ namespace Fw {
|
|||||||
void toString(StringBase& dest) const; //!< get string representation
|
void toString(StringBase& dest) const; //!< get string representation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const PolyType& operator=(const PolyType &src); //!< PolyType operator=
|
PolyType& operator=(const PolyType &src); //!< PolyType operator=
|
||||||
bool operator<(const PolyType &other) const; //!< PolyType operator<
|
bool operator<(const PolyType &other) const; //!< PolyType operator<
|
||||||
bool operator>(const PolyType &other) const; //!< PolyType operator>
|
bool operator>(const PolyType &other) const; //!< PolyType operator>
|
||||||
bool operator>=(const PolyType &other) const; //!< PolyType operator>=
|
bool operator>=(const PolyType &other) const; //!< PolyType operator>=
|
||||||
|
|||||||
@ -57,7 +57,7 @@ namespace Fw {
|
|||||||
|
|
||||||
// Copy constructor doesn't make sense in this virtual class as there is nothing to copy. Derived classes should
|
// Copy constructor doesn't make sense in this virtual class as there is nothing to copy. Derived classes should
|
||||||
// call the empty constructor and then call their own copy function
|
// call the empty constructor and then call their own copy function
|
||||||
const SerializeBufferBase& SerializeBufferBase::operator=(const SerializeBufferBase &src) { // lgtm[cpp/rule-of-two]
|
SerializeBufferBase& SerializeBufferBase::operator=(const SerializeBufferBase &src) { // lgtm[cpp/rule-of-two]
|
||||||
this->copyFrom(src);
|
this->copyFrom(src);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace Fw {
|
|||||||
class SerializeBufferBase {
|
class SerializeBufferBase {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
const SerializeBufferBase& operator=(const SerializeBufferBase &src); //!< equal operator
|
SerializeBufferBase& operator=(const SerializeBufferBase &src); //!< equal operator
|
||||||
|
|
||||||
virtual ~SerializeBufferBase(); //!< destructor
|
virtual ~SerializeBufferBase(); //!< destructor
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
#include <Os/IntervalTimer.hpp>
|
#include <Os/IntervalTimer.hpp>
|
||||||
#include <Os/InterruptLock.hpp>
|
#include <Os/InterruptLock.hpp>
|
||||||
#include <Fw/Types/Assert.hpp>
|
#include <Fw/Types/Assert.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <Fw/Types/InternalInterfaceString.hpp>
|
#include <Fw/Types/InternalInterfaceString.hpp>
|
||||||
#include <Fw/Types/PolyType.hpp>
|
#include <Fw/Types/PolyType.hpp>
|
||||||
#include <Fw/Types/MallocAllocator.hpp>
|
#include <Fw/Types/MallocAllocator.hpp>
|
||||||
@ -559,8 +559,8 @@ TEST(SerializationTest,Serialization1) {
|
|||||||
ASSERT_EQ(boolt1,boolt2);
|
ASSERT_EQ(boolt1,boolt2);
|
||||||
|
|
||||||
// serialize string
|
// serialize string
|
||||||
Fw::EightyCharString str1;
|
Fw::String str1;
|
||||||
Fw::EightyCharString str2;
|
Fw::String str2;
|
||||||
|
|
||||||
str1 = "Foo";
|
str1 = "Foo";
|
||||||
str2 = "BarBlat";
|
str2 = "BarBlat";
|
||||||
@ -787,16 +787,16 @@ void AssertTest() {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
FILE_NAME_ARG m_file;
|
FILE_NAME_ARG m_file = nullptr;
|
||||||
NATIVE_UINT_TYPE m_lineNo;
|
NATIVE_UINT_TYPE m_lineNo = 0;
|
||||||
NATIVE_UINT_TYPE m_numArgs;
|
NATIVE_UINT_TYPE m_numArgs = 0;
|
||||||
AssertArg m_arg1;
|
AssertArg m_arg1 = 0;
|
||||||
AssertArg m_arg2;
|
AssertArg m_arg2 = 0;
|
||||||
AssertArg m_arg3;
|
AssertArg m_arg3 = 0;
|
||||||
AssertArg m_arg4;
|
AssertArg m_arg4 = 0;
|
||||||
AssertArg m_arg5;
|
AssertArg m_arg5 = 0;
|
||||||
AssertArg m_arg6;
|
AssertArg m_arg6 = 0;
|
||||||
bool m_asserted;
|
bool m_asserted = false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -874,7 +874,7 @@ TEST(TypesTest, CheckAssertTest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(TypesTest,PolyTest) {
|
TEST(TypesTest,PolyTest) {
|
||||||
Fw::EightyCharString str;
|
Fw::String str;
|
||||||
|
|
||||||
// U8 Type ===============================================================
|
// U8 Type ===============================================================
|
||||||
U8 in8 = 13;
|
U8 in8 = 13;
|
||||||
@ -1064,16 +1064,16 @@ TEST(TypesTest,PolyTest) {
|
|||||||
|
|
||||||
TEST(TypesTest,EightyCharTest) {
|
TEST(TypesTest,EightyCharTest) {
|
||||||
|
|
||||||
Fw::EightyCharString str;
|
Fw::String str;
|
||||||
str = "foo";
|
str = "foo";
|
||||||
Fw::EightyCharString str2;
|
Fw::String str2;
|
||||||
str2 = "foo";
|
str2 = "foo";
|
||||||
ASSERT_EQ(str,str2);
|
ASSERT_EQ(str,str2);
|
||||||
ASSERT_EQ(str,"foo");
|
ASSERT_EQ(str,"foo");
|
||||||
str2 = "doodie";
|
str2 = "doodie";
|
||||||
ASSERT_NE(str,str2);
|
ASSERT_NE(str,str2);
|
||||||
|
|
||||||
Fw::EightyCharString str3 = str;
|
Fw::String str3 = str;
|
||||||
str3 += str2;
|
str3 += str2;
|
||||||
ASSERT_EQ(str3,"foodoodie");
|
ASSERT_EQ(str3,"foodoodie");
|
||||||
|
|
||||||
@ -1081,15 +1081,15 @@ TEST(TypesTest,EightyCharTest) {
|
|||||||
ASSERT_EQ(str3,"foodoodiehoo");
|
ASSERT_EQ(str3,"foodoodiehoo");
|
||||||
|
|
||||||
|
|
||||||
Fw::EightyCharString copyStr("ASTRING");
|
Fw::String copyStr("ASTRING");
|
||||||
ASSERT_EQ(copyStr,"ASTRING");
|
ASSERT_EQ(copyStr,"ASTRING");
|
||||||
Fw::EightyCharString copyStr2 = "ASTRING";
|
Fw::String copyStr2 = "ASTRING";
|
||||||
ASSERT_EQ(copyStr2,"ASTRING");
|
ASSERT_EQ(copyStr2,"ASTRING");
|
||||||
Fw::EightyCharString copyStr3(copyStr2);
|
Fw::String copyStr3(copyStr2);
|
||||||
ASSERT_EQ(copyStr3,"ASTRING");
|
ASSERT_EQ(copyStr3,"ASTRING");
|
||||||
|
|
||||||
Fw::InternalInterfaceString ifstr("IfString");
|
Fw::InternalInterfaceString ifstr("IfString");
|
||||||
Fw::EightyCharString if2(ifstr);
|
Fw::String if2(ifstr);
|
||||||
|
|
||||||
ASSERT_EQ(ifstr,if2);
|
ASSERT_EQ(ifstr,if2);
|
||||||
ASSERT_EQ(if2,"IfString");
|
ASSERT_EQ(if2,"IfString");
|
||||||
@ -1103,7 +1103,7 @@ TEST(TypesTest,EightyCharTest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(TypesTest,StringFormatTest) {
|
TEST(TypesTest,StringFormatTest) {
|
||||||
Fw::EightyCharString str;
|
Fw::String str;
|
||||||
str.format("Int %d String %s",10,"foo");
|
str.format("Int %d String %s",10,"foo");
|
||||||
ASSERT_STREQ(str.toChar(), "Int 10 String foo");
|
ASSERT_STREQ(str.toChar(), "Int 10 String foo");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,14 +73,18 @@ namespace Os {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if( !heap->create(depth) ) {
|
if( !heap->create(depth) ) {
|
||||||
|
delete heap;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
U8* data = new(std::nothrow) U8[depth*(sizeof(msgSize) + msgSize)];
|
U8* data = new(std::nothrow) U8[depth*(sizeof(msgSize) + msgSize)];
|
||||||
if (NULL == data) {
|
if (NULL == data) {
|
||||||
|
delete heap;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
NATIVE_UINT_TYPE* indexes = new(std::nothrow) NATIVE_UINT_TYPE[depth];
|
NATIVE_UINT_TYPE* indexes = new(std::nothrow) NATIVE_UINT_TYPE[depth];
|
||||||
if (NULL == indexes) {
|
if (NULL == indexes) {
|
||||||
|
delete heap;
|
||||||
|
delete[] data;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for(NATIVE_UINT_TYPE ii = 0; ii < depth; ++ii) {
|
for(NATIVE_UINT_TYPE ii = 0; ii < depth; ++ii) {
|
||||||
@ -88,6 +92,9 @@ namespace Os {
|
|||||||
}
|
}
|
||||||
PriorityQueue* priorityQueue = new(std::nothrow) PriorityQueue;
|
PriorityQueue* priorityQueue = new(std::nothrow) PriorityQueue;
|
||||||
if (NULL == priorityQueue) {
|
if (NULL == priorityQueue) {
|
||||||
|
delete heap;
|
||||||
|
delete[] data;
|
||||||
|
delete[] indexes;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
priorityQueue->heap = heap;
|
priorityQueue->heap = heap;
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
#include <Os/Queue.hpp>
|
#include <Os/Queue.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
#include <Fw/Types/Assert.hpp>
|
#include <Fw/Types/Assert.hpp>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -37,7 +36,7 @@ class MyTestSerializedBuffer : public Fw::SerializeBufferBase {
|
|||||||
|
|
||||||
Os::Queue* createTestQueue(char *name, U32 size, I32 depth) {
|
Os::Queue* createTestQueue(char *name, U32 size, I32 depth) {
|
||||||
Os::Queue* testQueue = new Os::Queue();
|
Os::Queue* testQueue = new Os::Queue();
|
||||||
Os::Queue::QueueStatus stat = testQueue->create(Fw::EightyCharString(name), depth, size);
|
Os::Queue::QueueStatus stat = testQueue->create(Os::QueueString(name), depth, size);
|
||||||
EXPECT_EQ(stat,Os::Queue::QUEUE_OK);
|
EXPECT_EQ(stat,Os::Queue::QUEUE_OK);
|
||||||
|
|
||||||
// Make sure the queue is of the correct size:
|
// Make sure the queue is of the correct size:
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include <Os/Task.hpp>
|
#include <Os/Task.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void startTestTask();
|
void startTestTask();
|
||||||
@ -15,7 +14,7 @@ void someTask(void* ptr) {
|
|||||||
void startTestTask() {
|
void startTestTask() {
|
||||||
volatile bool taskRan = false;
|
volatile bool taskRan = false;
|
||||||
Os::Task testTask;
|
Os::Task testTask;
|
||||||
Fw::EightyCharString name("ATestTask");
|
Os::TaskString name("ATestTask");
|
||||||
Os::Task::TaskStatus stat = testTask.start(name,12,100,10*1024,someTask,(void*) &taskRan);
|
Os::Task::TaskStatus stat = testTask.start(name,12,100,10*1024,someTask,(void*) &taskRan);
|
||||||
ASSERT_EQ(stat, Os::Task::TASK_OK);
|
ASSERT_EQ(stat, Os::Task::TASK_OK);
|
||||||
testTask.join(NULL);
|
testTask.join(NULL);
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
// acknowledged.
|
// acknowledged.
|
||||||
|
|
||||||
#include "Tester.hpp"
|
#include "Tester.hpp"
|
||||||
|
#include "Fw/Types/StringUtils.hpp"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ namespace Svc {
|
|||||||
"EVENT: (%d) (%d:%d,%d) %s: %s",
|
"EVENT: (%d) (%d:%d,%d) %s: %s",
|
||||||
id,timeTag.getTimeBase(),timeTag.getSeconds(),timeTag.getUSeconds(),severityString,text.toChar());
|
id,timeTag.getTimeBase(),timeTag.getSeconds(),timeTag.getUSeconds(),severityString,text.toChar());
|
||||||
ASSERT_EQ(0,strcmp(textStr,buf));
|
ASSERT_EQ(0,strcmp(textStr,buf));
|
||||||
strcpy(oldLine,buf);
|
Fw::StringUtils::string_copy(oldLine, buf, sizeof(oldLine));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stream1.close();
|
stream1.close();
|
||||||
@ -214,7 +215,7 @@ namespace Svc {
|
|||||||
"EVENT: (%d) (%d:%d,%d) %s: %s",
|
"EVENT: (%d) (%d:%d,%d) %s: %s",
|
||||||
id,timeTag.getTimeBase(),timeTag.getSeconds(),timeTag.getUSeconds(),severityString,text.toChar());
|
id,timeTag.getTimeBase(),timeTag.getSeconds(),timeTag.getUSeconds(),severityString,text.toChar());
|
||||||
ASSERT_EQ(0,strcmp(textStr,buf));
|
ASSERT_EQ(0,strcmp(textStr,buf));
|
||||||
strcpy(oldLine,buf);
|
Fw::StringUtils::string_copy(oldLine, buf, sizeof(oldLine));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stream1.close();
|
stream1.close();
|
||||||
@ -293,8 +294,7 @@ namespace Svc {
|
|||||||
// Verify file not made:
|
// Verify file not made:
|
||||||
ASSERT_FALSE(stat);
|
ASSERT_FALSE(stat);
|
||||||
ASSERT_FALSE(this->component.m_log_file.m_openFile);
|
ASSERT_FALSE(this->component.m_log_file.m_openFile);
|
||||||
char longFileNameDupS[81];
|
char longFileNameDupS[81] = "0";
|
||||||
strcat(longFileNameDupS,"0");
|
|
||||||
ASSERT_NE(Os::FileSystem::OP_OK,
|
ASSERT_NE(Os::FileSystem::OP_OK,
|
||||||
Os::FileSystem::getFileSize(longFileNameDupS,tmp));
|
Os::FileSystem::getFileSize(longFileNameDupS,tmp));
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ namespace Fw {
|
|||||||
AssertArg arg4,
|
AssertArg arg4,
|
||||||
AssertArg arg5,
|
AssertArg arg5,
|
||||||
AssertArg arg6,
|
AssertArg arg6,
|
||||||
I8* destBuffer,
|
CHAR* destBuffer,
|
||||||
NATIVE_INT_TYPE buffSize
|
NATIVE_INT_TYPE buffSize
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -121,12 +121,12 @@ namespace Svc {
|
|||||||
Fw::LogStringArg fileArg;
|
Fw::LogStringArg fileArg;
|
||||||
fileArg.format("0x%08X",file);
|
fileArg.format("0x%08X",file);
|
||||||
#else
|
#else
|
||||||
Fw::LogStringArg fileArg((const char*)file);
|
Fw::LogStringArg fileArg(file);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
I8 msg[FW_ASSERT_TEXT_SIZE] = {0};
|
CHAR msg[FW_ASSERT_TEXT_SIZE] = {0};
|
||||||
Fw::defaultReportAssert(file,lineNo,numArgs,arg1,arg2,arg3,arg4,arg5,arg6,msg,sizeof(msg));
|
Fw::defaultReportAssert(file,lineNo,numArgs,arg1,arg2,arg3,arg4,arg5,arg6,msg,sizeof(msg));
|
||||||
fprintf(stderr, "%s\n",(const char*)msg);
|
fprintf(stderr, "%s\n", msg);
|
||||||
|
|
||||||
switch (numArgs) {
|
switch (numArgs) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|||||||
@ -92,7 +92,7 @@ namespace Svc {
|
|||||||
ASSERT_EVENTS_AF_ASSERT_6(0,file,lineNo,1,2,3,4,5,6);
|
ASSERT_EVENTS_AF_ASSERT_6(0,file,lineNo,1,2,3,4,5,6);
|
||||||
|
|
||||||
// Test unexpected assert
|
// Test unexpected assert
|
||||||
this->component.reportAssert((U8*)"foo",1000,10,1,2,3,4,5,6);
|
this->component.reportAssert("foo",1000,10,1,2,3,4,5,6);
|
||||||
ASSERT_EVENTS_AF_UNEXPECTED_ASSERT_SIZE(1);
|
ASSERT_EVENTS_AF_UNEXPECTED_ASSERT_SIZE(1);
|
||||||
ASSERT_EVENTS_AF_UNEXPECTED_ASSERT(0,"foo",1000,10);
|
ASSERT_EVENTS_AF_UNEXPECTED_ASSERT(0,"foo",1000,10);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// ======================================================================
|
// ======================================================================
|
||||||
// \title CRCs.hpp
|
// \title CRCs.hpp
|
||||||
// \author Rob Bocchino
|
// \author Rob Bocchino
|
||||||
// \brief AMPCS CRC files
|
// \brief AMPCS CRC files
|
||||||
@ -7,10 +7,10 @@
|
|||||||
// Copyright (C) 2018 California Institute of Technology.
|
// Copyright (C) 2018 California Institute of Technology.
|
||||||
// ALL RIGHTS RESERVED. United States Government Sponsorship
|
// ALL RIGHTS RESERVED. United States Government Sponsorship
|
||||||
// acknowledged.
|
// acknowledged.
|
||||||
//
|
//
|
||||||
// ======================================================================
|
// ======================================================================
|
||||||
|
|
||||||
#include "Fw/Types/EightyCharString.hpp"
|
#include "Fw/Types/String.hpp"
|
||||||
#include "Fw/Types/SerialBuffer.hpp"
|
#include "Fw/Types/SerialBuffer.hpp"
|
||||||
#include "Os/File.hpp"
|
#include "Os/File.hpp"
|
||||||
#include "Os/FileSystem.hpp"
|
#include "Os/FileSystem.hpp"
|
||||||
@ -35,7 +35,7 @@ namespace Svc {
|
|||||||
const char *const fileName, //!< The file name
|
const char *const fileName, //!< The file name
|
||||||
const Os::File::Mode mode //!< The mode
|
const Os::File::Mode mode //!< The mode
|
||||||
) {
|
) {
|
||||||
const Os::File::Status fileStatus =
|
const Os::File::Status fileStatus =
|
||||||
file.open(fileName, mode);
|
file.open(fileName, mode);
|
||||||
ASSERT_EQ(Os::File::OP_OK, fileStatus);
|
ASSERT_EQ(Os::File::OP_OK, fileStatus);
|
||||||
}
|
}
|
||||||
@ -48,8 +48,8 @@ namespace Svc {
|
|||||||
) {
|
) {
|
||||||
NATIVE_INT_TYPE sizeThenActualSize = size;
|
NATIVE_INT_TYPE sizeThenActualSize = size;
|
||||||
const Os::File::Status status = file.write(
|
const Os::File::Status status = file.write(
|
||||||
buffer,
|
buffer,
|
||||||
sizeThenActualSize,
|
sizeThenActualSize,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
ASSERT_EQ(Os::File::OP_OK, status);
|
ASSERT_EQ(Os::File::OP_OK, status);
|
||||||
@ -82,7 +82,7 @@ namespace Svc {
|
|||||||
void removeFile(
|
void removeFile(
|
||||||
const char *const fileName
|
const char *const fileName
|
||||||
) {
|
) {
|
||||||
Fw::EightyCharString s("rm -f ");
|
Fw::String s("rm -f ");
|
||||||
s += fileName;
|
s += fileName;
|
||||||
s += ".CRC32";
|
s += ".CRC32";
|
||||||
int status = system(s.toChar());
|
int status = system(s.toChar());
|
||||||
@ -98,7 +98,7 @@ namespace Svc {
|
|||||||
Fw::SerialBuffer serialBuffer(buffer, sizeof(buffer));
|
Fw::SerialBuffer serialBuffer(buffer, sizeof(buffer));
|
||||||
serialBuffer.serialize(crc);
|
serialBuffer.serialize(crc);
|
||||||
const U8 *const addr = serialBuffer.getBuffAddr();
|
const U8 *const addr = serialBuffer.getBuffAddr();
|
||||||
Fw::EightyCharString hashFileName(fileName);
|
Fw::String hashFileName(fileName);
|
||||||
hashFileName += ".CRC32";
|
hashFileName += ".CRC32";
|
||||||
openFile(file, hashFileName.toChar(), Os::File::OPEN_WRITE);
|
openFile(file, hashFileName.toChar(), Os::File::OPEN_WRITE);
|
||||||
writeFile(file, addr, sizeof(crc));
|
writeFile(file, addr, sizeof(crc));
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
//
|
//
|
||||||
// ======================================================================
|
// ======================================================================
|
||||||
|
|
||||||
#include "Fw/Types/EightyCharString.hpp"
|
#include "Fw/Types/String.hpp"
|
||||||
#include "Svc/CmdSequencer/test/ut/SequenceFiles/AMPCS/AMPCS.hpp"
|
#include "Svc/CmdSequencer/test/ut/SequenceFiles/AMPCS/AMPCS.hpp"
|
||||||
#include "Svc/CmdSequencer/test/ut/SequenceFiles/Buffers.hpp"
|
#include "Svc/CmdSequencer/test/ut/SequenceFiles/Buffers.hpp"
|
||||||
#include "Svc/CmdSequencer/test/ut/SequenceFiles/File.hpp"
|
#include "Svc/CmdSequencer/test/ut/SequenceFiles/File.hpp"
|
||||||
@ -112,7 +112,7 @@ namespace Svc {
|
|||||||
void File ::
|
void File ::
|
||||||
remove()
|
remove()
|
||||||
{
|
{
|
||||||
Fw::EightyCharString s("rm -f ");
|
Fw::String s("rm -f ");
|
||||||
s += this->getName();
|
s += this->getName();
|
||||||
int status = system(s.toChar());
|
int status = system(s.toChar());
|
||||||
ASSERT_EQ(0, status);
|
ASSERT_EQ(0, status);
|
||||||
|
|||||||
@ -25,9 +25,10 @@ namespace Svc {
|
|||||||
this->m_timerVal.lower = other.m_timerVal.lower;
|
this->m_timerVal.lower = other.m_timerVal.lower;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimerVal::operator=(const TimerVal& other) {
|
TimerVal& TimerVal::operator=(const TimerVal& other) {
|
||||||
this->m_timerVal.upper = other.m_timerVal.upper;
|
this->m_timerVal.upper = other.m_timerVal.upper;
|
||||||
this->m_timerVal.lower = other.m_timerVal.lower;
|
this->m_timerVal.lower = other.m_timerVal.lower;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Os::IntervalTimer::RawTime TimerVal::getTimerVal() const {
|
Os::IntervalTimer::RawTime TimerVal::getTimerVal() const {
|
||||||
|
|||||||
@ -42,7 +42,7 @@ namespace Svc {
|
|||||||
//!
|
//!
|
||||||
//! \param other source timer value
|
//! \param other source timer value
|
||||||
|
|
||||||
void operator=(const TimerVal& other); //!< equal operator
|
TimerVal& operator=(const TimerVal& other); //!< equal operator
|
||||||
|
|
||||||
//! \brief Destructor
|
//! \brief Destructor
|
||||||
//!
|
//!
|
||||||
|
|||||||
@ -399,9 +399,9 @@ namespace Svc {
|
|||||||
Fw::Buffer& buffer
|
Fw::Buffer& buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
ASSERT_LT(buffers_index, FW_NUM_ARRAY_ELEMENTS(this->buffers));
|
||||||
// Copy buffer before recycling
|
// Copy buffer before recycling
|
||||||
U8* data = new U8[buffer.getSize()];
|
U8* data = new U8[buffer.getSize()];
|
||||||
ASSERT_LT(buffers_index, FW_NUM_ARRAY_ELEMENTS(this->buffers));
|
|
||||||
this->buffers[buffers_index] = data;
|
this->buffers[buffers_index] = data;
|
||||||
buffers_index++;
|
buffers_index++;
|
||||||
::memcpy(data, buffer.getData(), buffer.getSize());
|
::memcpy(data, buffer.getData(), buffer.getSize());
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
namespace Svc {
|
namespace Svc {
|
||||||
// Constructor
|
// Constructor
|
||||||
RandomizeRule :: RandomizeRule(const Fw::EightyCharString& name) : STest::Rule<Tester>(name.toChar()) {}
|
RandomizeRule :: RandomizeRule(const Fw::String& name) : STest::Rule<Tester>(name.toChar()) {}
|
||||||
|
|
||||||
// Can always randomize
|
// Can always randomize
|
||||||
bool RandomizeRule :: precondition(const Svc::Tester &state) {
|
bool RandomizeRule :: precondition(const Svc::Tester &state) {
|
||||||
@ -39,7 +39,7 @@ namespace Svc {
|
|||||||
|
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
DownlinkRule :: DownlinkRule(const Fw::EightyCharString& name) : STest::Rule<Tester>(name.toChar()) {}
|
DownlinkRule :: DownlinkRule(const Fw::String& name) : STest::Rule<Tester>(name.toChar()) {}
|
||||||
|
|
||||||
// Can always downlink
|
// Can always downlink
|
||||||
bool DownlinkRule :: precondition(const Svc::Tester &state) {
|
bool DownlinkRule :: precondition(const Svc::Tester &state) {
|
||||||
@ -57,7 +57,7 @@ namespace Svc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
FileDownlinkRule :: FileDownlinkRule(const Fw::EightyCharString& name) : STest::Rule<Tester>(name.toChar()) {}
|
FileDownlinkRule :: FileDownlinkRule(const Fw::String& name) : STest::Rule<Tester>(name.toChar()) {}
|
||||||
|
|
||||||
// Can always downlink
|
// Can always downlink
|
||||||
bool FileDownlinkRule :: precondition(const Svc::Tester &state) {
|
bool FileDownlinkRule :: precondition(const Svc::Tester &state) {
|
||||||
@ -80,7 +80,7 @@ namespace Svc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
SendAvailableRule :: SendAvailableRule(const Fw::EightyCharString& name) : STest::Rule<Tester>(name.toChar()) {}
|
SendAvailableRule :: SendAvailableRule(const Fw::String& name) : STest::Rule<Tester>(name.toChar()) {}
|
||||||
|
|
||||||
// Can always downlink
|
// Can always downlink
|
||||||
bool SendAvailableRule :: precondition(const Svc::Tester &state) {
|
bool SendAvailableRule :: precondition(const Svc::Tester &state) {
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#define FPRIME_SVC_GROUND_INTERFACE_HPP
|
#define FPRIME_SVC_GROUND_INTERFACE_HPP
|
||||||
|
|
||||||
#include <Fw/Types/BasicTypes.hpp>
|
#include <Fw/Types/BasicTypes.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <Svc/GroundInterface/test/ut/Tester.hpp>
|
#include <Svc/GroundInterface/test/ut/Tester.hpp>
|
||||||
#include <STest/STest/Rule/Rule.hpp>
|
#include <STest/STest/Rule/Rule.hpp>
|
||||||
#include <STest/STest/Pick/Pick.hpp>
|
#include <STest/STest/Pick/Pick.hpp>
|
||||||
@ -31,7 +31,7 @@ namespace Svc {
|
|||||||
*/
|
*/
|
||||||
struct RandomizeRule : public STest::Rule<Tester> {
|
struct RandomizeRule : public STest::Rule<Tester> {
|
||||||
// Constructor
|
// Constructor
|
||||||
RandomizeRule(const Fw::EightyCharString& name);
|
RandomizeRule(const Fw::String& name);
|
||||||
|
|
||||||
// Always valid
|
// Always valid
|
||||||
bool precondition(const Tester& state);
|
bool precondition(const Tester& state);
|
||||||
@ -42,7 +42,7 @@ namespace Svc {
|
|||||||
|
|
||||||
struct DownlinkRule : public STest::Rule<Tester> {
|
struct DownlinkRule : public STest::Rule<Tester> {
|
||||||
// Constructor
|
// Constructor
|
||||||
DownlinkRule(const Fw::EightyCharString& name);
|
DownlinkRule(const Fw::String& name);
|
||||||
|
|
||||||
// Always valid
|
// Always valid
|
||||||
bool precondition(const Tester& state);
|
bool precondition(const Tester& state);
|
||||||
@ -53,7 +53,7 @@ namespace Svc {
|
|||||||
|
|
||||||
struct FileDownlinkRule : public STest::Rule<Tester> {
|
struct FileDownlinkRule : public STest::Rule<Tester> {
|
||||||
// Constructor
|
// Constructor
|
||||||
FileDownlinkRule(const Fw::EightyCharString& name);
|
FileDownlinkRule(const Fw::String& name);
|
||||||
|
|
||||||
// Always valid
|
// Always valid
|
||||||
bool precondition(const Tester& state);
|
bool precondition(const Tester& state);
|
||||||
@ -64,7 +64,7 @@ namespace Svc {
|
|||||||
|
|
||||||
struct SendAvailableRule : public STest::Rule<Tester> {
|
struct SendAvailableRule : public STest::Rule<Tester> {
|
||||||
// Constructor
|
// Constructor
|
||||||
SendAvailableRule(const Fw::EightyCharString& name);
|
SendAvailableRule(const Fw::String& name);
|
||||||
|
|
||||||
// Always valid
|
// Always valid
|
||||||
bool precondition(const Tester& state);
|
bool precondition(const Tester& state);
|
||||||
|
|||||||
@ -244,7 +244,7 @@ namespace Svc {
|
|||||||
" id: 0x%08X"
|
" id: 0x%08X"
|
||||||
" bucket: %d"
|
" bucket: %d"
|
||||||
" next: %p\n",
|
" next: %p\n",
|
||||||
entry,entry->id,entry->bucketNo,entry->next
|
static_cast<void *>(entry),entry->id,entry->bucketNo,static_cast<void *>(entry->next)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -220,9 +220,10 @@ namespace Svc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BUILD_UT
|
#ifdef BUILD_UT
|
||||||
void UdpReceiverComponentImpl::UdpSerialBuffer::operator=(const UdpReceiverComponentImpl::UdpSerialBuffer& other) {
|
UdpReceiverComponentImpl::UdpSerialBuffer& UdpReceiverComponentImpl::UdpSerialBuffer::operator=(const UdpReceiverComponentImpl::UdpSerialBuffer& other) {
|
||||||
this->resetSer();
|
this->resetSer();
|
||||||
this->serialize(other.getBuffAddr(),other.getBuffLength(),true);
|
this->serialize(other.getBuffAddr(),other.getBuffLength(),true);
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
UdpReceiverComponentImpl::UdpSerialBuffer::UdpSerialBuffer(
|
UdpReceiverComponentImpl::UdpSerialBuffer::UdpSerialBuffer(
|
||||||
|
|||||||
@ -83,7 +83,7 @@ namespace Svc {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef BUILD_UT
|
#ifdef BUILD_UT
|
||||||
void operator=(const UdpSerialBuffer& other);
|
UdpSerialBuffer& operator=(const UdpSerialBuffer& other);
|
||||||
UdpSerialBuffer(const Fw::SerializeBufferBase& other);
|
UdpSerialBuffer(const Fw::SerializeBufferBase& other);
|
||||||
UdpSerialBuffer(const UdpSerialBuffer& other);
|
UdpSerialBuffer(const UdpSerialBuffer& other);
|
||||||
UdpSerialBuffer();
|
UdpSerialBuffer();
|
||||||
|
|||||||
@ -147,9 +147,10 @@ namespace Svc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BUILD_UT
|
#ifdef BUILD_UT
|
||||||
void UdpSenderComponentImpl::UdpSerialBuffer::operator=(const Svc::UdpSenderComponentImpl::UdpSerialBuffer& other) {
|
UdpSerialBuffer& UdpSenderComponentImpl::UdpSerialBuffer::operator=(const Svc::UdpSenderComponentImpl::UdpSerialBuffer& other) {
|
||||||
this->resetSer();
|
this->resetSer();
|
||||||
this->serialize(other.getBuffAddr(),other.getBuffLength(),true);
|
this->serialize(other.getBuffAddr(),other.getBuffLength(),true);
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
UdpSenderComponentImpl::UdpSerialBuffer::UdpSerialBuffer(
|
UdpSenderComponentImpl::UdpSerialBuffer::UdpSerialBuffer(
|
||||||
|
|||||||
@ -97,7 +97,7 @@ namespace Svc {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef BUILD_UT
|
#ifdef BUILD_UT
|
||||||
void operator=(const UdpSerialBuffer& other);
|
UdpSerialBuffer& operator=(const UdpSerialBuffer& other);
|
||||||
UdpSerialBuffer(const Fw::SerializeBufferBase& other);
|
UdpSerialBuffer(const Fw::SerializeBufferBase& other);
|
||||||
UdpSerialBuffer(const UdpSerialBuffer& other);
|
UdpSerialBuffer(const UdpSerialBuffer& other);
|
||||||
UdpSerialBuffer();
|
UdpSerialBuffer();
|
||||||
|
|||||||
@ -45,7 +45,7 @@ namespace Utils {
|
|||||||
|
|
||||||
//! Assign a hash buffer from another hash buffer
|
//! Assign a hash buffer from another hash buffer
|
||||||
//!
|
//!
|
||||||
const HashBuffer& operator=(const HashBuffer& other);
|
HashBuffer& operator=(const HashBuffer& other);
|
||||||
|
|
||||||
//! Compare two hash buffers for equality
|
//! Compare two hash buffers for equality
|
||||||
//!
|
//!
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Utils {
|
|||||||
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
}
|
}
|
||||||
|
|
||||||
const HashBuffer& HashBuffer::operator=(const HashBuffer& other) {
|
HashBuffer& HashBuffer::operator=(const HashBuffer& other) {
|
||||||
Fw::SerializeStatus stat = Fw::SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
Fw::SerializeStatus stat = Fw::SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
|
||||||
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
namespace Types {
|
namespace Types {
|
||||||
|
|
||||||
|
|
||||||
RandomizeRule::RandomizeRule(const Fw::EightyCharString& name)
|
RandomizeRule::RandomizeRule(const Fw::String& name)
|
||||||
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ namespace Types {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
SerializeOkRule::SerializeOkRule(const Fw::EightyCharString& name)
|
SerializeOkRule::SerializeOkRule(const Fw::String& name)
|
||||||
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
||||||
|
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ namespace Types {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
SerializeOverflowRule::SerializeOverflowRule(const Fw::EightyCharString& name)
|
SerializeOverflowRule::SerializeOverflowRule(const Fw::String& name)
|
||||||
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ namespace Types {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PeekOkRule::PeekOkRule(const Fw::EightyCharString& name)
|
PeekOkRule::PeekOkRule(const Fw::String& name)
|
||||||
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
||||||
|
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ namespace Types {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PeekBadRule::PeekBadRule(const Fw::EightyCharString& name)
|
PeekBadRule::PeekBadRule(const Fw::String& name)
|
||||||
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
||||||
|
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ namespace Types {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RotateOkRule::RotateOkRule(const Fw::EightyCharString& name)
|
RotateOkRule::RotateOkRule(const Fw::String& name)
|
||||||
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
||||||
|
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ namespace Types {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RotateBadRule::RotateBadRule(const Fw::EightyCharString& name)
|
RotateBadRule::RotateBadRule(const Fw::String& name)
|
||||||
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
: STest::Rule<MockTypes::CircularState>(name.toChar()) {}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
#define FPRIME_GROUNDINTERFACERULES_HPP
|
#define FPRIME_GROUNDINTERFACERULES_HPP
|
||||||
|
|
||||||
#include <Fw/Types/BasicTypes.hpp>
|
#include <Fw/Types/BasicTypes.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
#include <Fw/Types/String.hpp>
|
||||||
#include <Utils/Types/test/ut/CircularBuffer/CircularState.hpp>
|
#include <Utils/Types/test/ut/CircularBuffer/CircularState.hpp>
|
||||||
#include <STest/STest/Rule/Rule.hpp>
|
#include <STest/STest/Rule/Rule.hpp>
|
||||||
#include <STest/STest/Pick/Pick.hpp>
|
#include <STest/STest/Pick/Pick.hpp>
|
||||||
@ -35,7 +35,7 @@ namespace Types {
|
|||||||
*/
|
*/
|
||||||
struct RandomizeRule : public STest::Rule<MockTypes::CircularState> {
|
struct RandomizeRule : public STest::Rule<MockTypes::CircularState> {
|
||||||
// Constructor
|
// Constructor
|
||||||
RandomizeRule(const Fw::EightyCharString& name);
|
RandomizeRule(const Fw::String& name);
|
||||||
|
|
||||||
// Always valid
|
// Always valid
|
||||||
bool precondition(const MockTypes::CircularState& state);
|
bool precondition(const MockTypes::CircularState& state);
|
||||||
@ -51,7 +51,7 @@ namespace Types {
|
|||||||
*/
|
*/
|
||||||
struct SerializeOkRule : public STest::Rule<MockTypes::CircularState> {
|
struct SerializeOkRule : public STest::Rule<MockTypes::CircularState> {
|
||||||
// Constructor
|
// Constructor
|
||||||
SerializeOkRule(const Fw::EightyCharString& name);
|
SerializeOkRule(const Fw::String& name);
|
||||||
|
|
||||||
// Valid precondition for when the buffer should accept data
|
// Valid precondition for when the buffer should accept data
|
||||||
bool precondition(const MockTypes::CircularState& state);
|
bool precondition(const MockTypes::CircularState& state);
|
||||||
@ -67,7 +67,7 @@ namespace Types {
|
|||||||
*/
|
*/
|
||||||
struct SerializeOverflowRule : public STest::Rule<MockTypes::CircularState> {
|
struct SerializeOverflowRule : public STest::Rule<MockTypes::CircularState> {
|
||||||
// Constructor
|
// Constructor
|
||||||
SerializeOverflowRule(const Fw::EightyCharString& name);
|
SerializeOverflowRule(const Fw::String& name);
|
||||||
|
|
||||||
// Valid precondition for when the buffer should reject data
|
// Valid precondition for when the buffer should reject data
|
||||||
bool precondition(const MockTypes::CircularState& state);
|
bool precondition(const MockTypes::CircularState& state);
|
||||||
@ -83,7 +83,7 @@ namespace Types {
|
|||||||
*/
|
*/
|
||||||
struct PeekOkRule : public STest::Rule<MockTypes::CircularState> {
|
struct PeekOkRule : public STest::Rule<MockTypes::CircularState> {
|
||||||
// Constructor
|
// Constructor
|
||||||
PeekOkRule(const Fw::EightyCharString& name);
|
PeekOkRule(const Fw::String& name);
|
||||||
|
|
||||||
// Peek ok available for when buffer size - remaining size - 1 <= peek size
|
// Peek ok available for when buffer size - remaining size - 1 <= peek size
|
||||||
bool precondition(const MockTypes::CircularState& state);
|
bool precondition(const MockTypes::CircularState& state);
|
||||||
@ -99,7 +99,7 @@ namespace Types {
|
|||||||
*/
|
*/
|
||||||
struct PeekBadRule : public STest::Rule<MockTypes::CircularState> {
|
struct PeekBadRule : public STest::Rule<MockTypes::CircularState> {
|
||||||
// Constructor
|
// Constructor
|
||||||
PeekBadRule(const Fw::EightyCharString& name);
|
PeekBadRule(const Fw::String& name);
|
||||||
|
|
||||||
// Peek bad available for when buffer size - remaining size - 1 > peek size
|
// Peek bad available for when buffer size - remaining size - 1 > peek size
|
||||||
bool precondition(const MockTypes::CircularState& state);
|
bool precondition(const MockTypes::CircularState& state);
|
||||||
@ -115,7 +115,7 @@ namespace Types {
|
|||||||
*/
|
*/
|
||||||
struct RotateOkRule : public STest::Rule<MockTypes::CircularState> {
|
struct RotateOkRule : public STest::Rule<MockTypes::CircularState> {
|
||||||
// Constructor
|
// Constructor
|
||||||
RotateOkRule(const Fw::EightyCharString& name);
|
RotateOkRule(const Fw::String& name);
|
||||||
|
|
||||||
// Rotate is ok when there is more data then rotational size
|
// Rotate is ok when there is more data then rotational size
|
||||||
bool precondition(const MockTypes::CircularState& state);
|
bool precondition(const MockTypes::CircularState& state);
|
||||||
@ -131,7 +131,7 @@ namespace Types {
|
|||||||
*/
|
*/
|
||||||
struct RotateBadRule : public STest::Rule<MockTypes::CircularState> {
|
struct RotateBadRule : public STest::Rule<MockTypes::CircularState> {
|
||||||
// Constructor
|
// Constructor
|
||||||
RotateBadRule(const Fw::EightyCharString& name);
|
RotateBadRule(const Fw::String& name);
|
||||||
|
|
||||||
// Rotate is bad when there is less data then rotational size
|
// Rotate is bad when there is less data then rotational size
|
||||||
bool precondition(const MockTypes::CircularState& state);
|
bool precondition(const MockTypes::CircularState& state);
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#include "LockGuardTester.hpp"
|
#include "LockGuardTester.hpp"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <Os/Task.hpp>
|
#include <Os/Task.hpp>
|
||||||
#include <Fw/Types/EightyCharString.hpp>
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
@ -55,7 +54,7 @@ namespace Utils {
|
|||||||
data.i = 0;
|
data.i = 0;
|
||||||
Os::Task testTask;
|
Os::Task testTask;
|
||||||
Os::Task::TaskStatus stat;
|
Os::Task::TaskStatus stat;
|
||||||
Fw::EightyCharString name("TestTask");
|
Os::TaskString name("TestTask");
|
||||||
|
|
||||||
{
|
{
|
||||||
LockGuard guard(data.mutex);
|
LockGuard guard(data.mutex);
|
||||||
|
|||||||
@ -160,6 +160,7 @@
|
|||||||
#define FW_NO_ASSERT 1 //!< Asserts turned off
|
#define FW_NO_ASSERT 1 //!< Asserts turned off
|
||||||
#define FW_FILEID_ASSERT 2 //!< File ID used - requires -DASSERT_FILE_ID=somevalue to be set on the compile command line
|
#define FW_FILEID_ASSERT 2 //!< File ID used - requires -DASSERT_FILE_ID=somevalue to be set on the compile command line
|
||||||
#define FW_FILENAME_ASSERT 3 //!< Uses the file name in the assert - image stores filenames
|
#define FW_FILENAME_ASSERT 3 //!< Uses the file name in the assert - image stores filenames
|
||||||
|
#define FW_ASSERT_DFL_MSG_LEN 256 //!< Maximum assert message length when using the default assert handler
|
||||||
|
|
||||||
#ifndef FW_ASSERT_LEVEL
|
#ifndef FW_ASSERT_LEVEL
|
||||||
#define FW_ASSERT_LEVEL FW_FILENAME_ASSERT //!< Defines the type of assert used
|
#define FW_ASSERT_LEVEL FW_FILENAME_ASSERT //!< Defines the type of assert used
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user