Skip to content

Commit 50183d2

Browse files
committed
SFDP: unit tests: Move unshared test data into case
Some test data in test_sfdp.cpp is used by one test case only, so we turn it into a local variable.
1 parent b5e7dd9 commit 50183d2

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

storage/blockdevice/tests/UNITTESTS/SFDP/test_sfdp.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,6 @@ static const uint8_t sector_map_single_descriptor[] {
3939
0xF4, 0xFF, 0xFB, 0x03 // region 2
4040
};
4141

42-
/**
43-
* Based on Cypress S25FS512S, modified to have one descriptor,
44-
* twelve regions for test purpose.
45-
*/
46-
static const uint8_t sector_map_single_descriptor_twelve_regions[] {
47-
0xFF, 0x01, 0x0B, 0xFF, // header, highest region = 0x0B
48-
0xF1, 0x7F, 0x00, 0x00, // region 0
49-
0xF4, 0x7F, 0x03, 0x00, // region 1
50-
0xF4, 0xFF, 0xFB, 0x03, // region 2
51-
0xF1, 0x7F, 0x00, 0x00, // region 3
52-
0xF4, 0x7F, 0x03, 0x00, // region 4
53-
0xF4, 0xFF, 0xFB, 0x03, // region 5
54-
0xF1, 0x7F, 0x00, 0x00, // region 6
55-
0xF4, 0x7F, 0x03, 0x00, // region 7
56-
0xF4, 0xFF, 0xFB, 0x03, // region 8
57-
0xF1, 0x7F, 0x00, 0x00, // region 9
58-
0xF4, 0x7F, 0x03, 0x00, // region 10
59-
0xF4, 0xFF, 0xFB, 0x03, // region 11
60-
};
61-
6242
class TestSFDP : public testing::Test {
6343

6444
public:
@@ -270,6 +250,26 @@ TEST_F(TestSFDP, TestSFDPReadFailure)
270250
*/
271251
TEST_F(TestSFDP, TestMoreRegionsThanSupported)
272252
{
253+
/**
254+
* Based on Cypress S25FS512S, modified to have one descriptor,
255+
* twelve regions for test purpose.
256+
*/
257+
const uint8_t sector_map_single_descriptor_twelve_regions[] {
258+
0xFF, 0x01, 0x0B, 0xFF, // header, highest region = 0x0B
259+
0xF1, 0x7F, 0x00, 0x00, // region 0
260+
0xF4, 0x7F, 0x03, 0x00, // region 1
261+
0xF4, 0xFF, 0xFB, 0x03, // region 2
262+
0xF1, 0x7F, 0x00, 0x00, // region 3
263+
0xF4, 0x7F, 0x03, 0x00, // region 4
264+
0xF4, 0xFF, 0xFB, 0x03, // region 5
265+
0xF1, 0x7F, 0x00, 0x00, // region 6
266+
0xF4, 0x7F, 0x03, 0x00, // region 7
267+
0xF4, 0xFF, 0xFB, 0x03, // region 8
268+
0xF1, 0x7F, 0x00, 0x00, // region 9
269+
0xF4, 0x7F, 0x03, 0x00, // region 10
270+
0xF4, 0xFF, 0xFB, 0x03, // region 11
271+
};
272+
273273
mbed::sfdp_hdr_info header_info;
274274
set_sector_map_param_table(
275275
header_info.smptbl,

0 commit comments

Comments
 (0)