// DoTest() // ----------------------------------------------------- // // static BAEResult DoTest(int subMenu) { BAEResult err; int i; err = BAE_NO_ERROR; switch (subMenu) { case TEST_MIXER_CONSTRUCTOR: { if (gMixer) { BAEMixer_Delete(gMixer); gMixer = NULL; } for (i=0; i<100; i++) { gMixer = BAEMixer_New(); if (!gMixer) { FailedTest("Couldn't allocate BAEMixer object. Exiting Test!"); return BAE_MEMORY_ERR; } BAEMixer_Delete(gMixer); gMixer = NULL; } gMixer = BAEMixer_New(); } break; case TEST_MIXER_OPEN_CLOSE: { err = TestOpenClose(); } break; case TEST_MIXER_GET_SET_MASTER_VOLUME: { err = TestGetSetMasterVolume(); } break; case TEST_MIXER_GET_SET_HARDWARE_VOLUME: { err = TestGetSetHardwareVolume(); } break; default: break; } return err; }
TInt E32Main() /** Entrypoint establishes a connection with the KMS and then calls individual tests. @return KErrNone. If an error occurs then the process is panicked with RTest. */ { TInt r; test.Title(); test.Start(_L(" @SYMTestCaseID:SEC-CRYPTOSPI-KMSTEST-0001 E32Main ")); RLoader l; test(l.Connect()==KErrNone); test(l.CancelLazyDllUnload()==KErrNone); l.Close(); __KHEAP_MARK; // also ensure no resources leaked by key store __UHEAP_MARK; TestOpenClose(); test.Next(_L("Connecting to server")); r = kms.Connect(); test(r == KErrNone); TestGenerateKey(); TestStoreKey(); TestDeleteKey(); TestAddUsage(); TestDeleteUsage(); TestInvalidFunction(); CleanUp(); kms.Close(); // pause to allow LDD to be unloaded. User::After(5 * 1000 * 1000); __UHEAP_MARKEND; __KHEAP_MARKEND; test.End(); return KErrNone; }