os/kernelhwsrv/kerneltest/e32test/multimedia/t_sound_api_helper.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32test\multimedia\t_sound2_helper.cpp
    15 // 
    16 //
    17 
    18 #include <e32std.h>
    19 #include <e32std_private.h>
    20 #include <e32test.h>
    21 #include "t_soundutils.h"
    22 
    23 TInt E32Main()
    24 	{
    25 	RTest test(_L("t_sound_api_helper"));
    26 #ifdef __WINS__
    27 	// don't use JIT if running on emulator because don't want to halt
    28 	// the test run
    29 	User::SetJustInTime(EFalse);
    30 #endif
    31 	TInt unit;
    32 	TInt r= User::GetTIntParameter(KSlot, unit);
    33 	test(r==KErrNone);
    34 
    35 	test.Start(_L("t_sound_api_helper"));
    36 	RSoundSc soundSc;
    37 	r = soundSc.Open(unit);
    38 	test.Printf(_L("RSoundSc::Open --> r=%d\n"), r);
    39 	test(r==KErrNone || r==KErrPermissionDenied);
    40 	if(r==KErrNone)
    41 		soundSc.Close();
    42 	test.End();
    43 	test.Close();
    44 	// Panic with the return code from Open so that t_sound_api
    45 	// can check for the right error code.
    46 	User::Panic(KSoundAPICaps, r);
    47 
    48 	// unused return value - present to prevent compiler warning
    49 	return KErrNone;
    50 	}