utilitylibraries/libutils/tsrc/src/test_tlit8tostring_reliability.cpp
author William Roberts <williamr@symbian.org>
Thu, 22 Jul 2010 16:48:56 +0100
branchGCC_SURGE
changeset 45 4b03adbd26ca
parent 22 ddc455616bd6
parent 31 ce057bb09d0b
permissions -rw-r--r--
Catchup to latest Symbian^4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
#include <stdio.h>
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
#include<e32std.h>
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
#include "libutils.h"
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include"std_log_result.h"
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#define LOG_FILENAME_LINE __FILE__, __LINE__
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
int main()
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
{
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
	//int count = 2;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
	bool err = false;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
	__UHEAP_MARK;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
	__UHEAP_FAILNEXT(2);
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
	{
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
	string myString;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
	while(!err)
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
	{
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
	int retval =ESuccess;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
	_LIT8(Kname,"tlit8tochar");
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
	TBuf8 <20>src(Kname);
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
	retval = Tlit8ToString(src,myString);
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
  
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
  if (retval ==EInsufficientSystemMemory)
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
    {
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
    	printf("tlit8tostring_reliability Passed\n");
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
    	err = true;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
    	//Logging to some file can be done here
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
    }
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
  else
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
    {
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
			assert_failed = true;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
				err = true;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
    	printf("tlit8tostring_reliability Failed\n");
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
    	//Logging to some file can be done here
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
    }      
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
	}
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
}
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
	__UHEAP_MARKEND;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
	__UHEAP_RESET;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
    testResultXml("test_tlit8tostring_reliability");
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
	return 0;
ce057bb09d0b Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
}