23
23
#include " mbed_error.h"
24
24
#include " Timer.h"
25
25
#include " HeapBlockDevice.h"
26
- #include " FlashSimBlockDevice.h"
27
26
#include " SlicingBlockDevice.h"
28
27
#include " greentea-client/test_env.h"
29
28
#include " unity/unity.h"
@@ -50,17 +49,15 @@ SlicingBlockDevice flash_bd(&bd, 0, 16 * 4096);
50
49
#include " SDBlockDevice.h"
51
50
SDBlockDevice bd (MBED_CONF_SD_SPI_MOSI, MBED_CONF_SD_SPI_MISO,
52
51
MBED_CONF_SD_SPI_CLK, MBED_CONF_SD_SPI_CS);
53
- SlicingBlockDevice slice_bd (&bd, 0 , 512 * 512 );
54
- FlashSimBlockDevice flash_bd (&slice_bd);
52
+ SlicingBlockDevice flash_bd (&bd, 0 , 512 * 512 );
55
53
56
54
#elif defined(TEST_FLASHIAP)
57
55
#include " FlashIAPBlockDevice.h"
58
56
FlashIAPBlockDevice flash_bd (0xF0000 , 0x10000 );
59
57
60
58
#else
61
59
#define USE_HEAP_BD 1
62
- HeapBlockDevice bd (8 * 4096 , 1 , 1 , 4096 );
63
- FlashSimBlockDevice flash_bd (&bd);
60
+ HeapBlockDevice flash_bd (8 * 4096 , 1 , 1 , 4096 );
64
61
#endif
65
62
66
63
static const int heap_alloc_threshold_size = 4096 ;
@@ -129,19 +126,18 @@ static void white_box_test()
129
126
printf (" \n\n BD #%d: size %d, read %d, prog %d, erase %d\n " ,
130
127
bd_num, bdp->size , bdp->read_size , bdp->prog_size , bdp->erase_size );
131
128
HeapBlockDevice heap_bd (bdp->size , bdp->read_size , bdp->prog_size , bdp->erase_size );
132
- FlashSimBlockDevice flash_sim_bd (&heap_bd);
133
129
BlockDevice *test_bd;
134
130
if (bd_num == num_bds - 1 ) {
135
131
test_bd = &flash_bd;
136
132
} else {
137
- test_bd = &flash_sim_bd ;
133
+ test_bd = &heap_bd ;
138
134
// We need to skip the test if we don't have enough memory for the heap block device.
139
135
// However, this device allocates the erase units on the fly, so "erase" it via the flash
140
136
// simulator. A failure here means we haven't got enough memory.
141
- flash_sim_bd .init ();
142
- result = flash_sim_bd .erase (0 , flash_sim_bd .size ());
137
+ heap_bd .init ();
138
+ result = heap_bd .erase (0 , heap_bd .size ());
143
139
TEST_SKIP_UNLESS_MESSAGE (!result, " Not enough heap to run test" );
144
- flash_sim_bd .deinit ();
140
+ heap_bd .deinit ();
145
141
}
146
142
147
143
delete[] dummy;
0 commit comments