VirtualBox

Changeset 94980 in vbox for trunk/src/VBox/Main/testcase


Ignore:
Timestamp:
May 10, 2022 10:31:25 AM (3 years ago)
Author:
vboxsync
Message:

Main/testcase: Skip the testcase if the crpytographic module is not available, bugref:9955

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstVBoxCrypto.cpp

    r94979 r94980  
    128128        /* Try find it in the extension pack. */
    129129        /** @todo */
     130        RTTestSkipped(g_hTest, "Getting the module from the extension pack is not implemented yet, skipping testcase");
    130131    }
    131132
    132     RTLDRMOD hLdrModCrypto = NIL_RTLDRMOD;
    133     int rc = RTLdrLoad(pszModCrypto, &hLdrModCrypto);
    134     if (RT_SUCCESS(rc))
     133    if (pszModCrypto)
    135134    {
    136         PFNVBOXCRYPTOENTRY pfnCryptoEntry = NULL;
    137         rc = RTLdrGetSymbol(hLdrModCrypto, VBOX_CRYPTO_MOD_ENTRY_POINT, (void **)&pfnCryptoEntry);
     135        RTLDRMOD hLdrModCrypto = NIL_RTLDRMOD;
     136        int rc = RTLdrLoad(pszModCrypto, &hLdrModCrypto);
    138137        if (RT_SUCCESS(rc))
    139138        {
    140             PCVBOXCRYPTOIF pCryptoIf = NULL;
    141             rc = pfnCryptoEntry(&pCryptoIf);
     139            PFNVBOXCRYPTOENTRY pfnCryptoEntry = NULL;
     140            rc = RTLdrGetSymbol(hLdrModCrypto, VBOX_CRYPTO_MOD_ENTRY_POINT, (void **)&pfnCryptoEntry);
    142141            if (RT_SUCCESS(rc))
    143142            {
    144                 /* Loading succeeded, now we can start real testing. */
    145                 tstCryptoKeyStoreBasics(pCryptoIf);
     143                PCVBOXCRYPTOIF pCryptoIf = NULL;
     144                rc = pfnCryptoEntry(&pCryptoIf);
     145                if (RT_SUCCESS(rc))
     146                {
     147                    /* Loading succeeded, now we can start real testing. */
     148                    tstCryptoKeyStoreBasics(pCryptoIf);
     149                }
     150                else
     151                    RTTestIFailed("Calling '%s' failed with %Rrc", VBOX_CRYPTO_MOD_ENTRY_POINT, rc);
    146152            }
    147153            else
    148                 RTTestIFailed("Calling '%s' failed with %Rrc", VBOX_CRYPTO_MOD_ENTRY_POINT, rc);
     154                RTTestIFailed("Failed to resolve entry point '%s' with %Rrc", VBOX_CRYPTO_MOD_ENTRY_POINT, rc);
    149155        }
    150156        else
    151             RTTestIFailed("Failed to resolve entry point '%s' with %Rrc", VBOX_CRYPTO_MOD_ENTRY_POINT, rc);
     157            RTTestIFailed("Failed to load the crypto module '%s' with %Rrc", pszModCrypto, rc);
    152158    }
    153     else
    154         RTTestIFailed("Failed to load the crypto module '%s' with %Rrc", pszModCrypto, rc);
     159
    155160    return RTTestSummaryAndDestroy(g_hTest);
    156161}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette