utilitylibraries/libutils/tsrc/src/test_charptotptrc16_boundary2.cpp
branchRCL_3
changeset 56 acd3cd4aaceb
parent 0 e4d67989cc36
child 57 2efc27d87e1c
equal deleted inserted replaced
54:4332f0f7be53 56:acd3cd4aaceb
    18 #include <stdio.h>
    18 #include <stdio.h>
    19 #include<e32std.h>
    19 #include<e32std.h>
    20 #include "libutils.h"
    20 #include "libutils.h"
    21 #include"std_log_result.h"
    21 #include"std_log_result.h"
    22 #define LOG_FILENAME_LINE __FILE__, __LINE__
    22 #define LOG_FILENAME_LINE __FILE__, __LINE__
    23 void main()
    23 int main()
    24 {
    24 {
    25     __UHEAP_MARK;
    25     __UHEAP_MARK;
    26     int retval =ESuccess;
    26     int retval =ESuccess;
    27     char* mycharstring = "Hello Char String";
    27     char* mycharstring = "Hello Char String";
    28     int char_length= strlen(mycharstring);
    28     int char_length= strlen(mycharstring);
    29     TPtrC myTptrc;
    29     TPtrC myTptrc;
    30     wchar_t* myptr= new wchar_t[strlen(mycharstring)+1];
    30     wchar_t* myptr= new wchar_t[strlen(mycharstring)+1];
    31     retval = CharpToTptrc16(mycharstring,myptr, myTptrc);
    31     retval = CharpToTptrc16(mycharstring, myptr , myTptrc);
    32 
    32 
    33     int buf_len = myTptrc.Length();
    33     int buf_len = myTptrc.Length();
    34     if (retval ==ESuccess &&\
    34     if (retval ==ESuccess &&\
    35     char_length == buf_len &&\
    35     char_length == buf_len &&\
    36     buf_len == 17 )
    36     buf_len == 17 )
    43     printf("charptotptrc16 boundar2 Failed\n");
    43     printf("charptotptrc16 boundar2 Failed\n");
    44     }      
    44     }      
    45     free(myptr);
    45     free(myptr);
    46     __UHEAP_MARKEND;
    46     __UHEAP_MARKEND;
    47     testResultXml("test_charptotptrc16_boundary2");
    47     testResultXml("test_charptotptrc16_boundary2");
       
    48 	return 0;
    48 }
    49 }