kerneltest/e32test/system/t_debug.cpp
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1995-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\system\t_debug.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include <e32test.h>
       
    19 
       
    20 const TUint KDefaultHeapSize=1000;
       
    21 
       
    22 GLDEF_C TInt TestThread(TAny* anArg)
       
    23 //
       
    24 //
       
    25 //
       
    26 	{
       
    27 
       
    28 	((RSemaphore*)anArg)->Signal();
       
    29 	User::WaitForAnyRequest();
       
    30 	return 0;
       
    31 	}
       
    32 
       
    33 TInt E32Main()
       
    34 //
       
    35 //
       
    36 //
       
    37     {
       
    38 
       
    39 	__DEBUGGER();
       
    40 	RThread thread;
       
    41 	RSemaphore sem;
       
    42 	sem.CreateLocal(0);
       
    43 
       
    44 	thread.Create(_L("Test Thread"),TestThread,KDefaultStackSize,KDefaultHeapSize,KDefaultHeapSize,&sem);
       
    45 
       
    46 	TRequestStatus stat;
       
    47 	thread.Logon(stat);
       
    48    	thread.Resume();
       
    49     sem.Wait();
       
    50 
       
    51 //	thread.Kill(0);
       
    52  	thread.Panic(_L("Test Panic"),0);
       
    53 	User::WaitForRequest(stat);
       
    54 	thread.Close();
       
    55    	return 0;
       
    56     
       
    57     }