utilitylibraries/libutils/tsrc/src/test_tbuf8tostring_positive1.cpp
changeset 22 ddc455616bd6
parent 0 e4d67989cc36
child 45 4b03adbd26ca
child 57 2efc27d87e1c
equal deleted inserted replaced
18:47c74d1534e1 22:ddc455616bd6
    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     int retval =ESuccess;
    25     int retval =ESuccess;
    26     string s;
    26     string s;
    27     __UHEAP_MARK;
    27     __UHEAP_MARK;
    28     TBuf8 <12>  buf((const unsigned char *)"Hello");
    28     TBuf8 <12>  buf((const unsigned char *)"Hello");
    29     retval = Tbuf8ToString(buf, s);
    29     retval = Tbuf8ToString(buf, s);
    30 
    30     if (retval == ESuccess)
       
    31         {
       
    32         printf("TBuf8 to string conversion successful\n");
       
    33         }
    31     if (!strcmp(s.c_str(), "Hello"))
    34     if (!strcmp(s.c_str(), "Hello"))
    32     {
    35     {
    33     printf("tbuf8tostring Passed");
    36     printf("tbuf8tostring Passed");
    34     }
    37     }
    35     else
    38     else
    37     assert_failed = true;
    40     assert_failed = true;
    38     printf("Tbuf8ToString Failed");
    41     printf("Tbuf8ToString Failed");
    39     }  	
    42     }  	
    40     __UHEAP_MARKEND;
    43     __UHEAP_MARKEND;
    41     testResultXml("test_tbuf8tostring_positive1");
    44     testResultXml("test_tbuf8tostring_positive1");
       
    45 	return 0;
    42 }
    46 }