Changeset 2872


Ignore:
Timestamp:
Nov 12, 2006, 7:23:24 AM (19 years ago)
Author:
bird
Message:

Unload the modules too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/testcase/tst-0-driver.c

    r2871 r2872  
    450450        if (!rc)
    451451        {
    452             rc = pfnFuncA() | pfnFuncB() | pfnFuncC();
    453             if (rc == 0x42424242)
    454                 printf("tst-0-driver: FuncA/B/C => %#x (correct)\n", rc);
    455             else
    456                 Failure("FuncA/B/C => %#x\n", rc);
    457         }
     452            int u = pfnFuncA() | pfnFuncB() | pfnFuncC();
     453            if (u == 0x42424242)
     454                printf("tst-0-driver: FuncA/B/C => %#x (correct)\n", u);
     455            else
     456                Failure("FuncA/B/C => %#x\n", u);
     457
     458            rc = kLdrDyldUnload(hModA);
     459            if (rc)
     460                Failure("Unload A failed, rc=%d (%#x)\n", rc, rc);
     461            u = pfnFuncB() | pfnFuncC();
     462            if (u != 0x42424200)
     463                Failure("FuncB/C returns %#x instead of 0x42424200 after unloading A\n", u);
     464
     465            rc = kLdrDyldUnload(hModB);
     466            if (rc)
     467                Failure("Unload B failed, rc=%d (%#x)\n", rc, rc);
     468            u = pfnFuncC();
     469            if (u != 0x42420000)
     470                Failure("FuncC returns %#x instead of 0x42420000 after unloading A\n", u);
     471
     472            rc = kLdrDyldUnload(hModC);
     473            if (rc)
     474                Failure("Unload C failed, rc=%d (%#x)\n", rc, rc);
     475
     476            rc = kLdrDyldFindByName("tst-0-d", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod);
     477            if (rc != KLDR_ERR_MODULE_NOT_FOUND)
     478                Failure("Query for \"tst-0-d\" after unloading A,B and C returns rc=%d (%#x) instead of KLDR_ERR_MODULE_NOT_FOUND\n",
     479                        rc, rc);
     480        }
     481    }
     482
     483    /*
     484     * Now invoke the executable stub which launches the tst-0 program.
     485     */
     486    if (!g_cErrors)
     487    {
     488        /// @todo
    458489    }
    459490
Note: See TracChangeset for help on using the changeset viewer.