F´ Flight Software - C/C++ Documentation
NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
o
p
r
s
t
u
v
w
Variables
b
c
f
g
k
l
m
o
p
r
s
t
u
w
z
Typedefs
a
b
c
d
e
f
g
h
i
l
n
o
p
r
s
t
u
v
w
Enumerations
Enumerator
a
b
f
h
i
k
n
o
p
s
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
a
b
c
e
f
i
m
r
s
t
w
Enumerations
b
c
d
f
g
h
m
o
q
r
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Related Symbols
:
a
b
c
d
f
g
h
l
p
q
r
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Functions
f
g
i
m
p
r
s
t
u
Variables
_
b
c
f
g
i
l
p
r
s
w
Typedefs
a
b
c
e
f
i
n
p
s
t
u
Enumerations
Enumerator
a
b
c
f
g
h
p
r
s
t
Macros
_
a
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
ArrayToStringTest.cpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title ArrayToStringTest.cpp
3
// \author T. Chieu
4
// \brief cpp file for ArrayToStringTest class
5
//
6
// \copyright
7
// Copyright (C) 2009-2022 California Institute of Technology.
8
// ALL RIGHTS RESERVED. United States Government Sponsorship
9
// acknowledged.
10
//
11
// ======================================================================
12
13
#include "FppTest/array/EnumArrayAc.hpp"
14
#include "FppTest/array/StringArrayAc.hpp"
15
#include "FppTest/array/StructArrayAc.hpp"
16
#include "FppTest/array/Uint32ArrayArrayAc.hpp"
17
18
#include "
FppTest/typed_tests/ArrayTest.hpp
"
19
20
#include "gtest/gtest.h"
21
22
#include <sstream>
23
24
// Test array string functions
25
template
<
typename
ArrayType>
26
class
ArrayToStringTest
:
public
::testing::Test {
27
protected
:
28
void
SetUp
()
override
{
29
FppTest::Array::setTestVals<ArrayType>(
testVals
);
30
}
28
void
SetUp
()
override
{
…
}
31
32
typename
ArrayType::ElementType
testVals
[ArrayType::SIZE];
33
};
26
class
ArrayToStringTest
:
public
::testing::Test {
…
};
34
35
using
ArrayTypes
= ::testing::Types<
36
Enum,
37
String,
38
Struct,
39
Uint32Array
40
>;
41
TYPED_TEST_SUITE
(
ArrayToStringTest
,
ArrayTypes
);
42
43
// Test array toString() and ostream operator functions
44
TYPED_TEST
(
ArrayToStringTest
, ToString) {
45
TypeParam a(this->testVals);
46
std::stringstream buf1, buf2;
47
48
buf1 << a;
49
50
buf2 <<
"[ "
;
51
for
(U32 i = 0; i < TypeParam::SIZE; i++) {
52
buf2 << this->testVals[i] <<
" "
;
53
}
54
buf2 <<
"]"
;
55
56
ASSERT_STREQ(
57
buf1.str().c_str(),
58
buf2.str().c_str()
59
);
60
}
44
TYPED_TEST
(
ArrayToStringTest
, ToString) {
…
}
ArrayTest.hpp
ArrayTypes
::testing::Types< Enum, String, Struct, Uint32Array > ArrayTypes
Definition
ArrayToStringTest.cpp:35
TYPED_TEST_SUITE
TYPED_TEST_SUITE(ArrayToStringTest, ArrayTypes)
TYPED_TEST
TYPED_TEST(ArrayToStringTest, ToString)
Definition
ArrayToStringTest.cpp:44
ArrayToStringTest
Definition
ArrayToStringTest.cpp:26
ArrayToStringTest::SetUp
void SetUp() override
Definition
ArrayToStringTest.cpp:28
ArrayToStringTest::testVals
ArrayType::ElementType testVals[ArrayType::SIZE]
Definition
ArrayToStringTest.cpp:32
FppTest
array
ArrayToStringTest.cpp
Generated by
1.10.0