Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk. Sergii Dmytruk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59075 )
Change subject: [RFC][WPTST] tests: test write protection ......................................................................
Patch Set 7:
(1 comment)
File tests/chip_wp.c:
https://review.coreboot.org/c/flashrom/+/59075/comment/4068c5aa_1a942e8f PS7, Line 177: /* Check initial mode. */ : assert_int_equal(0, flashrom_wp_get_mode(&cfg, &mode)); : assert_int_equal(WP_MODE_DISABLED, mode); : : /* Switch modes in dummyflasher. */ : assert_int_equal(0, flashrom_wp_set_mode(&cfg, WP_MODE_PERMANENT)); : assert_int_equal(0, flashrom_wp_write_chip_config(&flash, &cfg)); : assert_int_equal(0, flashrom_wp_set_mode(&cfg, WP_MODE_POWER_CYCLE)); : assert_int_equal(0, flashrom_wp_write_chip_config(&flash, &cfg)); : : /* Final mode should be "permanent". */ : assert_int_equal(0, flashrom_wp_read_chip_config(&flash, &cfg)); : assert_int_equal(0, flashrom_wp_get_mode(&cfg, &mode)); : assert_int_equal(WP_MODE_PERMANENT, mode);
What I was trying to understand last time: […]
I think it's both:
1) You can't reorder the statements without changing some values.
2) It doesn't just test success of setting a mode, but also reaction of WP implementation to changing from a mode which prohibits mode changes (both "permanent" and "power cycle" are such regardless of the WP pin state).
I tend to view it as a single test because if you try to make two tests, the smaller one will be a subset of the larger one, so separation seems pointless.
I've added more comments in the new patchset, is this better?