Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk.
1 comment:
File tests/chip_wp.c:
/* 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?
To view, visit change 59075. To unsubscribe, or for help writing mail filters, visit settings.