jeanthom commented on PR #3110: URL: https://github.com/apache/nuttx-apps/pull/3110#issuecomment-3005222288
Hi @cederom and thanks for your review. I applied the required suggestions to the code. Regarding the behavioral change, I think it is sensible: I was always told asserts should be used to verify internal state of a program whereas error code should be preferred to notify an issue with user input. Regarding tests: ran the example "settings" app using sim:nsh NuttX configuration. Before: ``` NuttShell (NSH) NuttX-12.9.0 nsh> settings Example of settings usage to file: /tmp/settings.bin and /tmp/settings.txt:-------------------------------------------------------------- No existing binary storage file found. Creating it. No existing text storage file found. Creating it. Retrieved settings value (v1) with value:default value Trying to (re)create a setting that already exists (v1) Retrieved setting type is: 4 Trying to change setting (v1) to integer type Deliberate fail: settings change invalid: -13 Deliberate fail: non-existent setting requested. Error:-2 Trying to change setting (v1) from int to string: I'm a string Creating a string settings value (s1):I'm a string Retrieved string settings value (s1) with value:I'm a string Changing setting to an IP value (s1) with value:192.168.100.1 Retrieved IP address settings value (s1) with value:0xc0a86401 syncing storages exiting settings example app ``` After: ``` NuttShell (NSH) NuttX-12.9.0 nsh> settings Example of settings usage to file: /tmp/settings.bin and /tmp/settings.txt:-------------------------------------------------------------- No existing binary storage file found. Creating it. No existing text storage file found. Creating it. Retrieved settings value (v1) with value:default value Trying to (re)create a setting that already exists (v1) Retrieved setting type is: 4 Trying to change setting (v1) to integer type Deliberate fail: settings change invalid: -13 Deliberate fail: non-existent setting requested. Error:-2 Trying to change setting (v1) from int to string: I'm a string Creating a string settings value (s1):I'm a string Retrieved string settings value (s1) with value:I'm a string Changing setting to an IP value (s1) with value:192.168.100.1 Retrieved IP address settings value (s1) with value:0xc0a86401 syncing storages exiting settings example app ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
