Skip to content

Commit 2941b24

Browse files
committed
update partition table tests
1 parent 965df74 commit 2941b24

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

espflash/src/partition_table.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,23 @@ impl<W: Write> HashWriter<W> {
212212
#[test]
213213
fn test_basic() {
214214
use std::fs::read;
215+
const NVS_ADDR: u32 = 0x9000;
216+
const PHY_INIT_DATA_ADDR: u32 = 0xf000;
217+
const APP_ADDR: u32 = 0x10000;
218+
219+
const NVS_SIZE: u32 = 0x6000;
220+
const PHY_INIT_DATA_SIZE: u32 = 0x1000;
221+
const APP_SIZE: u32 = 0x3f0000;
215222

216223
let expected = read("./tests/data/partitions.bin").unwrap();
217-
let table = PartitionTable::basic(0x10000, 0x3f0000);
224+
let table = PartitionTable::basic(
225+
NVS_ADDR,
226+
NVS_SIZE,
227+
PHY_INIT_DATA_ADDR,
228+
PHY_INIT_DATA_SIZE,
229+
APP_ADDR,
230+
APP_SIZE,
231+
);
218232

219233
let result = table.to_bytes();
220234

espflash/tests/data/partitions.bin

0 Bytes
Binary file not shown.

espflash/tests/data/partitions.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
nvs, data, nvs, 0x9000, 0x6000,
4+
phy_init, data, phy, 0xf000, 0x1000,
5+
factory, app, factory, 0x10000, 0x3f0000,

0 commit comments

Comments
 (0)