utilitylibraries/libutils/tsrc/src/integration_test_scenario22.cpp
changeset 0 e4d67989cc36
child 22 ddc455616bd6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/utilitylibraries/libutils/tsrc/src/integration_test_scenario22.cpp	Tue Feb 02 02:01:42 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <stdio.h>
+#include<e32std.h>
+#include "libutils.h"
+#include"std_log_result.h"
+#define LOG_FILENAME_LINE __FILE__, __LINE__
+void main()
+{
+    __UHEAP_MARK;
+    {
+    int retval[10];
+    TBufC<30> buf;
+    TPtrC16 myTptr=buf.Des();
+    wchar_t* myWchar =L"hellohello";
+    retval[0] = WcharpToTptrc16(myWchar,myTptr);
+
+    wstring myWstring(L"gfgfdfdafggffghghf");
+    retval[1] = Tptrc16ToWstring(myTptr,myWstring);
+
+    HBufC16 *hbufc = HBufC16::NewMaxL(20);
+    retval[2] = WstringToHbufc16(myWstring,hbufc);
+
+    wstring myFinWstring(L"aghfgafdsgfg");
+    retval[3] = Hbufc16ToWstring(hbufc,myFinWstring);
+
+    char* temp = new char[30];
+    TBufC8<30> buf8;
+    TPtrC8 myTptr8 = buf8.Des();
+    retval[4] = WstringToTptrc8(myFinWstring,temp,myTptr8);
+
+    wchar_t* myFinWchar = new wchar_t[21];
+    int size = 20;
+    retval[5] = Tptrc8ToWcharp(myTptr8,myFinWchar,size);
+
+    if(!wcscmp(myWchar,myFinWchar))
+    {
+    printf("\n\nintegration_test_scenario22 case passed");
+    }
+    else
+    {
+    printf("\n\nintegration_test_scenario22 case failed");
+    assert_failed = true;
+    }
+    delete[] temp;
+    delete hbufc;
+    delete[] myFinWchar;
+    }
+    __UHEAP_MARKEND;
+    testResultXml("integration_test_scenario22");
+}