symport/bldtest/testexe_main.cpp
changeset 1 0a7b44b10206
child 2 806186ab5e14
equal deleted inserted replaced
0:c55016431358 1:0a7b44b10206
       
     1 // Copyright (c) 1997-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 "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32debug.h>
       
    17 #include <e32base.h>
       
    18 #include <e32hashtab.h>
       
    19 #include <e32test.h>
       
    20 
       
    21 #include "teststatic.h"
       
    22 
       
    23 RTest test(_L("Simple tests"));
       
    24 
       
    25 EXPORT_C void HashL()
       
    26 	{
       
    27 	TInt in = 0x12345678;
       
    28 	TInt out = 0;
       
    29 	out = DefaultHash::Integer(in);
       
    30 	test(in != out);
       
    31 	}
       
    32 
       
    33 void doMainL()
       
    34 	{
       
    35 	test.Start(_L("Leaving"));
       
    36 	TRAPD(err, TestStatic::LeaveL());
       
    37 	RDebug::Print(_L("... Leave code: %d\n"), err);
       
    38 	test(err != KErrNone);
       
    39 
       
    40 	test.Next(_L("Arrays"));
       
    41 	test(TestStatic::ArrayL() == 3);
       
    42 
       
    43 	test.Next(_L("Descriptors"));
       
    44 	TestStatic::DescriptorL();
       
    45 
       
    46 	test.Next(_L("Hash"));
       
    47 	HashL();
       
    48 
       
    49 	test.End();
       
    50 	}
       
    51 
       
    52 // Note - no E32Main!
       
    53 int main(int argc, char *argv[])
       
    54 	{
       
    55 	RDebug::Print(_L("Called from main\n"));
       
    56 
       
    57 	__UHEAP_MARK;
       
    58 	CTrapCleanup* theCleanup = CTrapCleanup::New();
       
    59 	TRAPD(ret, doMainL());
       
    60 	test(ret == KErrNone);
       
    61 	test.Close();
       
    62 	delete theCleanup;
       
    63 	__UHEAP_MARKEND;
       
    64 	return ret;
       
    65 	}
       
    66