[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/2] tests/qtest/i440fx-test.c: Enable full test of i440FX PAM
From: |
Lev Kujawski |
Subject: |
[PATCH v3 2/2] tests/qtest/i440fx-test.c: Enable full test of i440FX PAM operation |
Date: |
Fri, 24 Jun 2022 08:19:40 +0000 |
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>
---
(v3) No change.
(v2) No change.
tests/qtest/i440fx-test.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/tests/qtest/i440fx-test.c b/tests/qtest/i440fx-test.c
index 6d7d4d8d8f..073a16bbed 100644
--- a/tests/qtest/i440fx-test.c
+++ b/tests/qtest/i440fx-test.c
@@ -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));
--
2.34.1