1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
446 TEST(err == KErrNone); |
446 TEST(err == KErrNone); |
447 __UHEAP_MARKEND; |
447 __UHEAP_MARKEND; |
448 |
448 |
449 __UHEAP_MARK; |
449 __UHEAP_MARK; |
450 TRAP(err, TestGet4L()); |
450 TRAP(err, TestGet4L()); |
|
451 TEST(err == KErrNone); |
|
452 __UHEAP_MARKEND; |
|
453 |
|
454 __UHEAP_MARK; |
|
455 TRAP(err, TestGet5L()); |
451 TEST(err == KErrNone); |
456 TEST(err == KErrNone); |
452 __UHEAP_MARKEND; |
457 __UHEAP_MARKEND; |
453 |
458 |
454 __UHEAP_MARK; |
459 __UHEAP_MARK; |
455 TRAP(err, TestGeneral1L()); |
460 TRAP(err, TestGeneral1L()); |
2018 |
2023 |
2019 CSsmCommandBase* cmd = NULL; |
2024 CSsmCommandBase* cmd = NULL; |
2020 CleanupStack::PushL(cmd); |
2025 CleanupStack::PushL(cmd); |
2021 return NULL; |
2026 return NULL; |
2022 } |
2027 } |
|
2028 |
|
2029 /* |
|
2030 It tests for the scenario where first file have no commands(i.e. cmdlists7a) and second file cmdlists7b have two commands and |
|
2031 third file have no commands(i.e cmdlists7c) |
|
2032 |
|
2033 CommandList should be created and iCommandConstructCount should be two. |
|
2034 */ |
|
2035 void CResourceReaderTest::TestGet5L() |
|
2036 { |
|
2037 INFO_PRINTF1(_L("*** Starting TestGet5L")); |
|
2038 _LIT(KCommandListPath, "z:\\resource\\ssmatest\\cmdlists7\\"); |
|
2039 CSsmCommandListResourceReaderImpl* reader = CSsmCommandListResourceReaderImpl::NewL(iFs, KCommandListPath, *this); |
|
2040 |
|
2041 // init |
|
2042 TRequestStatus status; |
|
2043 reader->Initialise(status); |
|
2044 TEST(status == KRequestPending); |
|
2045 Run(); |
|
2046 User::WaitForRequest(status); // mop up the completed initialisation request |
|
2047 TEST(status == KErrNone); |
|
2048 |
|
2049 // prepare |
|
2050 TSsmState state(0,23); |
|
2051 reader->PrepareCommandList(*this, ETestCommandListId1, state, status); |
|
2052 iWhichPrepare = EConditional; |
|
2053 iCommandConstructCount = 0; |
|
2054 Run(); |
|
2055 User::WaitForRequest(status); |
|
2056 |
|
2057 TBool commandListReady = reader->IsCommandListReady(); |
|
2058 |
|
2059 TEST((status == KErrNone) && (commandListReady == TRUE) && (iCommandConstructCount == 2)); |
|
2060 |
|
2061 iWhichPrepare = EPrepareNoCheck; |
|
2062 delete reader; |
|
2063 } |