os/kernelhwsrv/kerneltest/e32test/multimedia/t_sound_api_helper.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/multimedia/t_sound_api_helper.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,50 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\multimedia\t_sound2_helper.cpp
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include <e32std.h>
    1.22 +#include <e32std_private.h>
    1.23 +#include <e32test.h>
    1.24 +#include "t_soundutils.h"
    1.25 +
    1.26 +TInt E32Main()
    1.27 +	{
    1.28 +	RTest test(_L("t_sound_api_helper"));
    1.29 +#ifdef __WINS__
    1.30 +	// don't use JIT if running on emulator because don't want to halt
    1.31 +	// the test run
    1.32 +	User::SetJustInTime(EFalse);
    1.33 +#endif
    1.34 +	TInt unit;
    1.35 +	TInt r= User::GetTIntParameter(KSlot, unit);
    1.36 +	test(r==KErrNone);
    1.37 +
    1.38 +	test.Start(_L("t_sound_api_helper"));
    1.39 +	RSoundSc soundSc;
    1.40 +	r = soundSc.Open(unit);
    1.41 +	test.Printf(_L("RSoundSc::Open --> r=%d\n"), r);
    1.42 +	test(r==KErrNone || r==KErrPermissionDenied);
    1.43 +	if(r==KErrNone)
    1.44 +		soundSc.Close();
    1.45 +	test.End();
    1.46 +	test.Close();
    1.47 +	// Panic with the return code from Open so that t_sound_api
    1.48 +	// can check for the right error code.
    1.49 +	User::Panic(KSoundAPICaps, r);
    1.50 +
    1.51 +	// unused return value - present to prevent compiler warning
    1.52 +	return KErrNone;
    1.53 +	}