tracefw/tracecompiler/test/FixedIdDefinitionsTestApp/src/FixedIdDefinitionsTestApp.cpp
branchRCL_3
changeset 21 52e343bb8f80
parent 20 ca8a1b6995f6
child 22 e26895079d7c
equal deleted inserted replaced
20:ca8a1b6995f6 21:52e343bb8f80
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 //  Include Files  
       
    19 #include "FixedIdDefinitionsTestApp.h"
       
    20 #include <e32base.h>
       
    21 #include <e32debug.h>
       
    22 #include <e32std.h>
       
    23 #include <e32cons.h>
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "FixedIdDefinitionsTestAppTraces.h"
       
    27 #endif
       
    28 // Console
       
    29 //  Constants
       
    30 _LIT(KTextConsoleTitle, "Console");
       
    31 _LIT(KTextFailed, " failed, leave code = %d");
       
    32 _LIT(KTextPressAnyKey, " [press any key]\n");
       
    33 
       
    34 //  Global Variables
       
    35 LOCAL_D CConsoleBase* console; // write all messages to this
       
    36 
       
    37 
       
    38 //  Local Functions
       
    39 
       
    40 LOCAL_C void MainL()
       
    41     {
       
    42 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_1
       
    43 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_1
       
    44  
       
    45 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_2
       
    46 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_2 
       
    47 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_2
       
    48 //     OstTrace0(GROUP2, TRACE3, "trace 3"); // TRACE_USED_IN_TEST_CASE_2 
       
    49     
       
    50 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_3 
       
    51 //     OstTrace0(GROUP2, TRACE3, "trace 3"); // TRACE_USED_IN_TEST_CASE_3
       
    52     
       
    53 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_4
       
    54 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_4 
       
    55 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_4
       
    56 //     OstTrace0(TRACE_FATAL, TRACE3, "trace 3"); // TRACE_USED_IN_TEST_CASE_4
       
    57 
       
    58 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_5
       
    59 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_5 
       
    60 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_5
       
    61 
       
    62 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_6_0
       
    63 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_6_0 
       
    64 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_6_1 
       
    65 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_6_1 
       
    66 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_6_1
       
    67 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_6_2
       
    68 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_6_2 
       
    69 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_6_3
       
    70 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_6_3 
       
    71 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_6_3
       
    72 
       
    73 //     OstTrace0(GROUP2, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_7_0
       
    74 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_7_0 
       
    75 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_7_0
       
    76 //     OstTrace0(TRACE_NORMAL, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_7_1
       
    77 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_7_1
       
    78 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_7_1
       
    79 //     OstTrace0(GROUP1, TRACE0, "trace 0"); // TRACE_USED_IN_TEST_CASE_7_2
       
    80 //     OstTrace0(GROUP2, TRACE2, "trace 2"); // TRACE_USED_IN_TEST_CASE_7_2 
       
    81 //     OstTrace0(GROUP2, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_7_2   
       
    82    
       
    83 //     OstTrace0(TRACE_FLOW, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_8      
       
    84 
       
    85 //     OstTrace0(MY_GROUP, TRACE1, "trace 1"); // TRACE_USED_IN_TEST_CASE_9                
       
    86     }
       
    87 
       
    88 LOCAL_C void DoStartL()
       
    89     {
       
    90     // Create active scheduler (to run active objects)
       
    91     CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
       
    92     CleanupStack::PushL(scheduler);
       
    93     CActiveScheduler::Install(scheduler);
       
    94 
       
    95     MainL();
       
    96 
       
    97     // Delete active scheduler
       
    98     CleanupStack::PopAndDestroy(scheduler);
       
    99 
       
   100     }
       
   101 
       
   102 //  Global Functions
       
   103 
       
   104 GLDEF_C TInt E32Main()
       
   105     {
       
   106     // Create cleanup stack
       
   107     __UHEAP_MARK;
       
   108     CTrapCleanup* cleanup = CTrapCleanup::New();
       
   109     // Create output console
       
   110     TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(
       
   111                             KConsFullScreen, KConsFullScreen)));
       
   112     if (createError)
       
   113         return createError;
       
   114     // Run application code inside TRAP harness, wait keypress when terminated
       
   115     TRAPD(mainError, DoStartL());
       
   116     if (mainError)
       
   117         console->Printf(KTextFailed, mainError);
       
   118     console->Printf(KTextPressAnyKey);
       
   119     console->Getch();
       
   120 
       
   121     delete console;
       
   122     delete cleanup;
       
   123     __UHEAP_MARKEND;
       
   124     return KErrNone;
       
   125     }
       
   126