dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
unittest.cpp
Go to the documentation of this file.
1 
11 /*
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  * for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, see <http://www.gnu.org/licenses/>
24  */
25 
26 /*
27  * NOTE: This program uses the Google Test infrastructure to drive the unit test
28  *
29  * Main site for Google Test: http://code.google.com/p/googletest/
30  * Documentation and examples: http://code.google.com/p/googletest/wiki/Documentation
31  */
32 
33 #include "gtest/gtest.h"
34 
35 #include <stdio.h> /* printf */
36 #include <stdlib.h> /* abort */
37 #include <string.h> /* memset */
38 #include <stdint.h> /* uint*_t */
39 
40 extern "C" {
41 
42 #include "pios_flash.h" /* PIOS_FLASH_* API */
43 
44 #include "pios_flash_priv.h" /* struct pios_flash_partition */
45 
47 extern uint32_t pios_flash_partition_table_size;
48 
49 #include "pios_flash_posix_priv.h"
50 
51 extern uintptr_t pios_posix_flash_id;
53 
55 
58 
59 #include "pios_flashfs.h" /* PIOS_FLASHFS_* */
60 
61 }
62 
63 #define OBJ0_ID 0xAA55AA55
64 
65 #define OBJ1_ID 0x12345678
66 #define OBJ1_SIZE 76
67 
68 #define OBJ2_ID 0xABCDEFAB
69 #define OBJ2_SIZE 123
70 
71 #define OBJ3_ID 0x99999999
72 #define OBJ3_SIZE (256 - 12) // leave room for the slot header
73 
74 #define OBJ4_ID 0x90901111
75 #define OBJ4_SIZE (768) // only fits in partition b slots
76 
77 // To use a test fixture, derive a class from testing::Test.
78 class LogfsTestRaw : public testing::Test {
79 protected:
80  virtual void SetUp() {
81  /* Set up obj1 */
82  for (uint32_t i = 0; i < sizeof(obj1); i++) {
83  obj1[i] = 0x10 + (i % 10);
84  }
85 
86  /* Set up a second version of obj1 with different data */
87  for (uint32_t i = 0; i < sizeof(obj1_alt); i++) {
88  obj1_alt[i] = 0xA0 + (i % 10);
89  }
90 
91  /* Set up obj2 */
92  for (uint32_t i = 0; i < sizeof(obj2); i++) {
93  obj2[i] = 0x20 + (i % 10);
94  }
95 
96  /* Set up obj3 */
97  for (uint32_t i = 0; i < sizeof(obj3); i++) {
98  obj3[i] = 0x30 + (i % 10);
99  }
100 
101  /* Set up obj4 */
102  for (uint32_t i = 0; i < sizeof(obj4); i++) {
103  obj4[i] = 0x40 + (i % 10);
104  }
105 
108  }
109 
110  virtual void TearDown() {
111  unlink("theflash.bin");
112  }
113 
114  unsigned char obj1[OBJ1_SIZE];
115  unsigned char obj1_alt[OBJ1_SIZE];
116  unsigned char obj2[OBJ2_SIZE];
117  unsigned char obj3[OBJ3_SIZE];
118  unsigned char obj4[OBJ4_SIZE];
119 };
120 
121 TEST_F(LogfsTestRaw, FlashInit) {
122  EXPECT_EQ(0, PIOS_Flash_Posix_Init(&pios_posix_flash_id, &flash_config, false));
123 
125 }
126 
127 TEST_F(LogfsTestRaw, LogfsInit) {
128  EXPECT_EQ(0, PIOS_Flash_Posix_Init(&pios_posix_flash_id, &flash_config, false));
129 
130  /* Register the partition table */
132 
133  uintptr_t fs_id;
135 
138 }
139 
141 protected:
142  virtual void SetUp() {
143  /* First, we need to set up the super fixture (LogfsTestRaw) */
145 
146  /* Init the flash and the flashfs so we don't need to repeat this in every test */
147  EXPECT_EQ(0, PIOS_Flash_Posix_Init(&pios_posix_flash_id, &flash_config, false));
149  }
150 
151  virtual void TearDown() {
154  }
155 
156  uintptr_t fs_id;
157 };
158 
159 TEST_F(LogfsTestCooked, BadIdLogfsFormat) {
160  EXPECT_EQ(-1, PIOS_FLASHFS_Format(fs_id + 1));
161 }
162 
163 TEST_F(LogfsTestCooked, BadIdSave) {
164  EXPECT_EQ(-1, PIOS_FLASHFS_ObjSave(fs_id + 1, OBJ1_ID, 0, obj1, sizeof(obj1)));
165 }
166 
167 TEST_F(LogfsTestCooked, BadIdLoad) {
168  unsigned char obj1_check[OBJ1_SIZE];
169  memset(obj1_check, 0, sizeof(obj1_check));
170  EXPECT_EQ(-1, PIOS_FLASHFS_ObjLoad(fs_id + 1, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
171 }
172 
173 TEST_F(LogfsTestCooked, LogfsFormat) {
174  EXPECT_EQ(0, PIOS_FLASHFS_Format(fs_id));
175 }
176 
178  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 0, obj1, sizeof(obj1)));
179 }
180 
181 TEST_F(LogfsTestCooked, WriteVerifyOne) {
182  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 0, obj1, sizeof(obj1)));
183 
184  unsigned char obj1_check[OBJ1_SIZE];
185  memset(obj1_check, 0, sizeof(obj1_check));
186  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
187  EXPECT_EQ(0, memcmp(obj1, obj1_check, sizeof(obj1)));
188 }
189 
190 TEST_F(LogfsTestCooked, WriteVerifyDeleteVerifyOne) {
191  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 0, obj1, sizeof(obj1)));
192 
193  unsigned char obj1_check[OBJ1_SIZE];
194  memset(obj1_check, 0, sizeof(obj1_check));
195  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
196  EXPECT_EQ(0, memcmp(obj1, obj1_check, sizeof(obj1)));
197 
198  EXPECT_EQ(0, PIOS_FLASHFS_ObjDelete(fs_id, OBJ1_ID, 0));
199 
200  EXPECT_EQ(-3, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
201 }
202 
203 TEST_F(LogfsTestCooked, WriteTwoVerifyOneA) {
204  /* Write obj1 then obj2 */
205  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 0, obj1, sizeof(obj1)));
206  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ2_ID, 0, obj2, sizeof(obj2)));
207 
208  /* Read back obj1 */
209  unsigned char obj1_check[OBJ1_SIZE];
210  memset(obj1_check, 0, sizeof(obj1_check));
211  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
212  EXPECT_EQ(0, memcmp(obj1, obj1_check, sizeof(obj1)));
213 }
214 
215 TEST_F(LogfsTestCooked, WriteTwoVerifyOneB) {
216  /* Write obj2 then obj1 */
217  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ2_ID, 0, obj2, sizeof(obj2)));
218  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 0, obj1, sizeof(obj1)));
219 
220  /* Read back obj1 */
221  unsigned char obj1_check[OBJ1_SIZE];
222  memset(obj1_check, 0, sizeof(obj1_check));
223  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
224  EXPECT_EQ(0, memcmp(obj1, obj1_check, sizeof(obj1)));
225 }
226 
227 TEST_F(LogfsTestCooked, WriteZeroSize) {
228  /* Write a zero length object */
229  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ0_ID, 0, NULL, 0));
230 }
231 
232 TEST_F(LogfsTestCooked, WriteVerifyZeroLength) {
233  /* Write a zero length object */
234  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ0_ID, 0, NULL, 0));
235 
236  /* Read back a zero length object -- effectively an existence check */
237  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ0_ID, 0, NULL, 0));
238 }
239 
240 TEST_F(LogfsTestCooked, WriteMaxSize) {
241  /* Write a max length object */
242  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ3_ID, 0, obj3, sizeof(obj3)));
243 }
244 
245 TEST_F(LogfsTestCooked, ReadNonexistent) {
246  /* Read back a zero length object -- basically an existence check */
247  unsigned char obj1_check[OBJ1_SIZE];
248  memset(obj1_check, 0, sizeof(obj1_check));
249  EXPECT_EQ(-3, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
250 }
251 
252 TEST_F(LogfsTestCooked, WriteVerifyMultiInstance) {
253  /* Write instance zero */
254  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 0, obj1, sizeof(obj1)));
255 
256  /* Write a non-zero instance ID */
257  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 123, obj1_alt, sizeof(obj1_alt)));
258 
259  unsigned char obj1_check[OBJ1_SIZE];
260 
261  /* Read back instance 123 */
262  memset(obj1_check, 0, sizeof(obj1_check));
263  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 123, obj1_check, sizeof(obj1_check)));
264  EXPECT_EQ(0, memcmp(obj1_alt, obj1_check, sizeof(obj1_alt)));
265 
266  /* Read back instance 0 */
267  memset(obj1_check, 0, sizeof(obj1_check));
268  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
269  EXPECT_EQ(0, memcmp(obj1, obj1_check, sizeof(obj1)));
270 }
271 
272 TEST_F(LogfsTestCooked, FillFilesystemAndGarbageCollect) {
273  /* Fill up the entire filesystem with multiple instances of obj1 */
274  for (uint32_t i = 0; i < (flashfs_config_settings.arena_size / flashfs_config_settings.slot_size) - 1; i++) {
275  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, i, obj1, sizeof(obj1)));
276  }
277 
278  /* Should fail to add a new object since the filesystem is full */
279  EXPECT_EQ(-4, PIOS_FLASHFS_ObjSave(fs_id, OBJ2_ID, 0, obj2, sizeof(obj2)));
280 
281  /* Now save a new version of an existing object which should trigger gc and succeed */
282  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 0, obj1_alt, sizeof(obj1_alt)));
283 
284  /* Read back one of the original obj1 instances */
285  unsigned char obj1_check[OBJ1_SIZE];
286  memset(obj1_check, 0, sizeof(obj1_check));
287  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 1, obj1_check, sizeof(obj1_check)));
288  EXPECT_EQ(0, memcmp(obj1, obj1_check, sizeof(obj1)));
289 
290  /* Read back the new version of obj1 written after gc */
291  memset(obj1_check, 0, sizeof(obj1_check));
292  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
293  EXPECT_EQ(0, memcmp(obj1_alt, obj1_check, sizeof(obj1_alt)));
294 }
295 
296 TEST_F(LogfsTestCooked, WriteManyVerify) {
297  for (uint32_t i = 0; i < 10000; i++) {
298  /* Write a collection of objects */
299  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ0_ID, 0, NULL, 0));
300  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 0, obj1, sizeof(obj1)));
301  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ1_ID, 123, obj1_alt, sizeof(obj1_alt)));
302  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ2_ID, 0, obj2, sizeof(obj2)));
303  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id, OBJ3_ID, 0, obj3, sizeof(obj3)));
304  }
305 
306  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ0_ID, 0, NULL, 0));
307 
308  unsigned char obj1_check[OBJ1_SIZE];
309  memset(obj1_check, 0, sizeof(obj1_check));
310  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
311  EXPECT_EQ(0, memcmp(obj1, obj1_check, sizeof(obj1)));
312 
313  unsigned char obj1_alt_check[OBJ1_SIZE];
314  memset(obj1_alt_check, 0, sizeof(obj1_alt_check));
315  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ1_ID, 123, obj1_alt_check, sizeof(obj1_alt_check)));
316  EXPECT_EQ(0, memcmp(obj1_alt, obj1_alt_check, sizeof(obj1_alt)));
317 
318  unsigned char obj2_check[OBJ2_SIZE];
319  memset(obj2_check, 0, sizeof(obj2_check));
320  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ2_ID, 0, obj2_check, sizeof(obj2_check)));
321  EXPECT_EQ(0, memcmp(obj2, obj2_check, sizeof(obj2)));
322 
323  unsigned char obj3_check[OBJ3_SIZE];
324  memset(obj3_check, 0, sizeof(obj3_check));
325  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id, OBJ3_ID, 0, obj3_check, sizeof(obj3_check)));
326  EXPECT_EQ(0, memcmp(obj3, obj3_check, sizeof(obj3)));
327 }
328 
330 protected:
331  virtual void SetUp() {
332  /* First, we need to set up the super fixture (LogfsTestRaw) */
334 
335  /* Init the flash and the flashfs so we don't need to repeat this in every test */
336  EXPECT_EQ(0, PIOS_Flash_Posix_Init(&pios_posix_flash_id, &flash_config, false));
339  }
340 
341  virtual void TearDown() {
345  }
346 
347  uintptr_t fs_id_a;
348  uintptr_t fs_id_b;
349 };
350 
351 TEST_F(LogfsTestCookedMultiPart, WriteOneWriteOneVerify) {
352  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_a, OBJ1_ID, 0, obj1, sizeof(obj1)));
353  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_b, OBJ2_ID, 0, obj2, sizeof(obj2)));
354 
355  /* OBJ1 found in A */
356  unsigned char obj1_check[OBJ1_SIZE];
357  memset(obj1_check, 0, sizeof(obj1_check));
358  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id_a, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
359  EXPECT_EQ(0, memcmp(obj1, obj1_check, sizeof(obj1)));
360 
361  /* OBJ2 found in B */
362  unsigned char obj2_check[OBJ2_SIZE];
363  memset(obj2_check, 0, sizeof(obj2_check));
364  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id_b, OBJ2_ID, 0, obj2_check, sizeof(obj2_check)));
365  EXPECT_EQ(0, memcmp(obj2, obj2_check, sizeof(obj2)));
366 }
367 
368 TEST_F(LogfsTestCookedMultiPart, WriteOneWriteOneFormatOneVerify) {
369  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_a, OBJ1_ID, 0, obj1, sizeof(obj1)));
370  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_b, OBJ2_ID, 0, obj2, sizeof(obj2)));
371 
372  EXPECT_EQ(0, PIOS_FLASHFS_Format(fs_id_a));
373 
374  /* OBJ2 still found in B */
375  unsigned char obj2_check[OBJ2_SIZE];
376  memset(obj2_check, 0, sizeof(obj2_check));
377  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id_b, OBJ2_ID, 0, obj2_check, sizeof(obj2_check)));
378  EXPECT_EQ(0, memcmp(obj2, obj2_check, sizeof(obj2)));
379 }
380 
381 TEST_F(LogfsTestCookedMultiPart, WriteOneWriteOneNoCross) {
382  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_a, OBJ1_ID, 0, obj1, sizeof(obj1)));
383  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_b, OBJ2_ID, 0, obj2, sizeof(obj2)));
384 
385  /* OBJ1 not found in B */
386  unsigned char obj1_check[OBJ1_SIZE];
387  memset(obj1_check, 0, sizeof(obj1_check));
388  EXPECT_EQ(-3, PIOS_FLASHFS_ObjLoad(fs_id_b, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
389 
390  /* OBJ2 not found in A */
391  unsigned char obj2_check[OBJ2_SIZE];
392  memset(obj2_check, 0, sizeof(obj2_check));
393  EXPECT_EQ(-3, PIOS_FLASHFS_ObjLoad(fs_id_a, OBJ2_ID, 0, obj2_check, sizeof(obj2_check)));
394 }
395 
396 TEST_F(LogfsTestCookedMultiPart, WriteOneWriteOneDeleteOne) {
397  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_a, OBJ1_ID, 0, obj1, sizeof(obj1)));
398  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_b, OBJ2_ID, 0, obj2, sizeof(obj2)));
399 
400  EXPECT_EQ(0, PIOS_FLASHFS_ObjDelete(fs_id_a, OBJ1_ID, 0));
401 
402  /* OBJ1 not found in A */
403  unsigned char obj1_check[OBJ1_SIZE];
404  memset(obj1_check, 0, sizeof(obj1_check));
405  EXPECT_EQ(-3, PIOS_FLASHFS_ObjLoad(fs_id_a, OBJ1_ID, 0, obj1_check, sizeof(obj1_check)));
406 
407  /* OBJ2 still found in B */
408  unsigned char obj2_check[OBJ2_SIZE];
409  memset(obj2_check, 0, sizeof(obj2_check));
410  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id_b, OBJ2_ID, 0, obj2_check, sizeof(obj2_check)));
411 }
412 
414  EXPECT_EQ(0, PIOS_FLASHFS_ObjSave(fs_id_b, OBJ4_ID, 0, obj4, sizeof(obj4)));
415 
416  /* OBJ4 found in B */
417  unsigned char obj4_check[OBJ4_SIZE];
418  memset(obj4_check, 0, sizeof(obj4_check));
419  EXPECT_EQ(0, PIOS_FLASHFS_ObjLoad(fs_id_b, OBJ4_ID, 0, obj4_check, sizeof(obj4_check)));
420 }
#define OBJ3_ID
Definition: unittest.cpp:71
virtual void TearDown()
Definition: unittest.cpp:341
TEST_F(RneFromLLATest, Equator)
Definition: unittest.cpp:68
void PIOS_Flash_Posix_Destroy(uintptr_t chip_id)
virtual void SetUp()
Definition: unittest.cpp:331
unsigned char obj4[OBJ4_SIZE]
Definition: unittest.cpp:118
unsigned char obj1_alt[OBJ1_SIZE]
Definition: unittest.cpp:115
unsigned char obj2[OBJ2_SIZE]
Definition: unittest.cpp:116
#define OBJ0_ID
Definition: unittest.cpp:63
virtual void SetUp()
Definition: unittest.cpp:142
int32_t PIOS_FLASHFS_Logfs_Init(uintptr_t *fs_id, const struct flashfs_logfs_cfg *cfg, enum pios_flash_partition_labels partition_label)
Initialize the flash object setting FS.
int32_t PIOS_FLASHFS_Logfs_Destroy(uintptr_t fs_id)
struct flashfs_logfs_cfg flashfs_config_waypoints
Definition: unittest_init.c:18
struct pios_flash_posix_cfg flash_config
Definition: unittest_init.c:28
#define OBJ4_SIZE
Definition: unittest.cpp:75
#define OBJ2_SIZE
Definition: unittest.cpp:69
virtual void TearDown()
Definition: unittest.cpp:151
virtual void TearDown()
Definition: unittest.cpp:110
int32_t PIOS_FLASHFS_ObjDelete(uintptr_t fs_id, uint32_t obj_id, uint16_t obj_inst_id)
Delete one instance of an object from the filesystem.
#define OBJ2_ID
Definition: unittest.cpp:68
uint8_t i
Definition: msp_messages.h:97
uintptr_t pios_posix_flash_id
Definition: unittest_init.c:41
struct flashfs_logfs_cfg flashfs_config_settings
Definition: unittest_init.c:12
unsigned char obj3[OBJ3_SIZE]
Definition: unittest.cpp:117
virtual void SetUp()
Definition: unittest.cpp:80
int32_t PIOS_FLASHFS_ObjSave(uintptr_t fs_id, uint32_t obj_id, uint16_t obj_inst_id, uint8_t *obj_data, uint16_t obj_size)
Saves one object instance to the filesystem.
int32_t PIOS_FLASHFS_ObjLoad(uintptr_t fs_id, uint32_t obj_id, uint16_t obj_inst_id, uint8_t *obj_data, uint16_t obj_size)
Load one object instance from the filesystem.
void PIOS_FLASH_register_partition_table(const struct pios_flash_partition partition_table[], uint8_t num_partitions)
uintptr_t fs_id
Definition: unittest.cpp:156
const struct pios_flash_partition pios_flash_partition_table[]
Definition: unittest_init.c:50
#define OBJ1_ID
Definition: unittest.cpp:65
unsigned char obj1[OBJ1_SIZE]
Definition: unittest.cpp:114
#define OBJ1_SIZE
Definition: unittest.cpp:66
int32_t PIOS_FLASHFS_Format(uintptr_t fs_id)
Erases all filesystem arenas and activate the first arena.
uint32_t pios_flash_partition_table_size
Definition: unittest_init.c:79
#define OBJ4_ID
Definition: unittest.cpp:74
#define OBJ3_SIZE
Definition: unittest.cpp:72
int32_t PIOS_Flash_Posix_Init(uintptr_t *chip_id, const struct pios_flash_posix_cfg *cfg, bool force_recreate)