Skip to content

Commit b2c79f3

Browse files
committed
[SD] Add test for parsing invalid json edge case
1 parent 7eab682 commit b2c79f3

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Offline Mode - DS18b20
2+
version: 1
3+
author: Brent Rubell for Adafruit Industries
4+
5+
steps:
6+
- wait-serial: '[SD] Waiting for incoming JSON string...'
7+
- write-serial: '{"exportVersion":"1.0.0","exportedBy":"wokwi","exportedAt":"2024-10-28T18:58:23.976Z","exportedFromDevice":{"board":"metroesp32s3","firmwareVersion":"1.0.0-beta.93","referenceVoltage":2.6,"totalGPIOPins":11,"totalAnalogPins":6},"components":[{"componentAPI":"ds18x20","name":"DS18B20: Temperature Sensor (°F)","sensorTypeCount":2,"sensorType1":"ambient-temp-fahrenheit","sensorType2":"ambient-temp","pinName":"D6","sensorResolution":12,"period":5}]}'
8+
- write-serial: '\n'
9+
- wait-serial: '[SD] Valid JSON string received!'
10+
- wait-serial: '{"timestamp":0,"pin":"D6","value":0,"si_unit":"OBJECT_TEMPERATURE"}'
11+
- wait-serial: '{"timestamp":0,"pin":"D6","value":32,"si_unit":"OBJECT_TEMPERATURE_FAHRENHEIT"}'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Offline Mode - Invalid JSON
2+
version: 1
3+
author: Brent Rubell for Adafruit Industries
4+
5+
steps:
6+
- wait-serial: '[SD] Waiting for incoming JSON string...'
7+
- write-serial: '{"exportVersion":"1.0.0",'
8+
- write-serial: '\n'
9+
- wait-serial: 'ERROR [WDT RESET]: Unable to validate incoming JSON file'

0 commit comments

Comments
 (0)