File tree 4 files changed +33
-8
lines changed
4 files changed +33
-8
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ set(TEST_SRCS
44
44
src/test_writeOnly.cpp
45
45
46
46
src/util/CBORTestUtil.cpp
47
- src/util/OTATestDataGenerator .cpp
47
+ src/util/OTATestUtil .cpp
48
48
49
49
../../src/utility/ota/crc.cpp
50
50
../../src/utility/ota/OTALogic.cpp
Original file line number Diff line number Diff line change 11
11
12
12
#include < stdint.h>
13
13
14
+ /* *************************************************************************************
15
+ NAMESPACE
16
+ **************************************************************************************/
17
+
18
+ namespace ota
19
+ {
20
+
14
21
/* *************************************************************************************
15
22
TYPEDEF
16
23
**************************************************************************************/
@@ -33,5 +40,10 @@ union OTAData
33
40
void generate_valid_ota_data (OTAData & ota_data);
34
41
void generate_invalid_ota_data_crc_wrong (OTAData & ota_data);
35
42
43
+ /* *************************************************************************************
44
+ NAMESPACE
45
+ **************************************************************************************/
46
+
47
+ } /* ota */
36
48
37
49
#endif /* OTA_TEST_DATA_GENERATOR_H_ */
Original file line number Diff line number Diff line change 12
12
#include < catch.hpp>
13
13
#include < fakeit.hpp>
14
14
15
- #include < util/OTATestDataGenerator .h>
15
+ #include < util/OTATestUtil .h>
16
16
17
17
#include < OTALogic.h>
18
18
#include < OTAStorage.h>
@@ -27,7 +27,7 @@ using namespace fakeit;
27
27
TEST HELPER
28
28
**************************************************************************************/
29
29
30
- void simulateOTABinaryReception (OTALogic & ota_logic, OTAData const & ota_test_data)
30
+ void simulateOTABinaryReception (OTALogic & ota_logic, ota:: OTAData const & ota_test_data)
31
31
{
32
32
uint32_t bytes_written = 0 ;
33
33
uint32_t const bytes_to_write = sizeof (uint32_t ) + sizeof (uint32_t ) + ota_test_data.data .len ;
@@ -212,8 +212,8 @@ TEST_CASE("Valid OTA data is received ", "[OTALogic]")
212
212
213
213
214
214
/* Generate test data */
215
- OTAData valid_ota_test_data;
216
- generate_valid_ota_data (valid_ota_test_data);
215
+ ota:: OTAData valid_ota_test_data;
216
+ ota:: generate_valid_ota_data (valid_ota_test_data);
217
217
218
218
219
219
/* Perform test */
@@ -259,8 +259,8 @@ TEST_CASE("Invalid OTA data is received ", "[OTALogic - CRC wrong]")
259
259
260
260
261
261
/* Generate test data */
262
- OTAData invalid_valid_ota_test_data_crc_wrong;
263
- generate_invalid_ota_data_crc_wrong (invalid_valid_ota_test_data_crc_wrong);
262
+ ota:: OTAData invalid_valid_ota_test_data_crc_wrong;
263
+ ota:: generate_invalid_ota_data_crc_wrong (invalid_valid_ota_test_data_crc_wrong);
264
264
265
265
266
266
/* Perform test */
Original file line number Diff line number Diff line change 6
6
INCLUDE
7
7
**************************************************************************************/
8
8
9
- #include < util/OTATestDataGenerator .h>
9
+ #include < util/OTATestUtil .h>
10
10
11
11
#include < algorithm>
12
12
13
13
#include < crc.h>
14
14
15
+ /* *************************************************************************************
16
+ NAMESPACE
17
+ **************************************************************************************/
18
+
19
+ namespace ota
20
+ {
21
+
15
22
/* *************************************************************************************
16
23
FUNCTION DEFINITION
17
24
**************************************************************************************/
@@ -58,3 +65,9 @@ void generate_invalid_ota_data_crc_wrong(OTAData & ota_data)
58
65
/* Generate CRC */
59
66
ota_data.data .crc32 = 0xDEADBEEF ;
60
67
}
68
+
69
+ /* *************************************************************************************
70
+ NAMESPACE
71
+ **************************************************************************************/
72
+
73
+ } /* ota */
You can’t perform that action at this time.
0 commit comments