@@ -236,33 +236,34 @@ static void test_i440fx_pam(gconstpointer opaque)
/* Switch to WE for the area */
pam_set(dev, i, PAM_RE | PAM_WE);
+ /* Verify the RAM is still all zeros */
+ g_assert(verify_area(pam_area[i].start, pam_area[i].end, 0));
/* Write out a non-zero mask to the full area */
write_area(pam_area[i].start, pam_area[i].end, 0x42);
-
-#ifndef BROKEN
- /* QEMU only supports a limited form of PAM */
+ /* Verify the area contains the new mask */
+ g_assert(verify_area(pam_area[i].start, pam_area[i].end, 0x42));
/* Switch to !RE for the area */
pam_set(dev, i, PAM_WE);
/* Verify the area is not our mask */
g_assert(!verify_area(pam_area[i].start, pam_area[i].end, 0x42));
-#endif
- /* Verify the area is our new mask */
+ /* Switch to !WE for the area */
+ pam_set(dev, i, PAM_RE);
+ /* Verify the area is once again our mask */
g_assert(verify_area(pam_area[i].start, pam_area[i].end, 0x42));
/* Write out a new mask */
write_area(pam_area[i].start, pam_area[i].end, 0x82);
-#ifndef BROKEN
- /* QEMU only supports a limited form of PAM */
-
- /* Verify the area is not our mask */
- g_assert(!verify_area(pam_area[i].start, pam_area[i].end, 0x82));
+ /* Verify the area is not the new mask */
+ g_assert(verify_area(pam_area[i].start, pam_area[i].end, 0x42));
/* Switch to RE for the area */
pam_set(dev, i, PAM_RE | PAM_WE);
-#endif
+ /* Write out a new mask again */
+ write_area(pam_area[i].start, pam_area[i].end, 0x82);
+
/* Verify the area is our new mask */
g_assert(verify_area(pam_area[i].start, pam_area[i].end, 0x82));
With the prior patch in this series adding support for RE^WE PAM semantics, the '#ifndef BROKEN' segments of test_i440fx_pam can now be enabled. Additionally: - Verify that changing attributes does not affect the initial contents of the PAM region; - Verify that that the first new mask is written before switching attributes; - Switch back to PAM_RE after PAM_WE to read original contents; - Tighten logic of the !WE write test because we know what the original contents were; and - Write the last mask before testing for it. Signed-off-by: Lev Kujawski <lkujaw@member.fsf.org> --- (v2) No change. tests/qtest/i440fx-test.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)