1999-03-29 23:52:54 +04:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsXPIDLString.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
nsXPIDLStringTest_Value(PRUnichar** aResult)
|
|
|
|
{
|
2000-04-28 03:20:32 +04:00
|
|
|
nsAutoString s(NS_ConvertASCIItoUCS2("Hello, World"));
|
1999-03-29 23:52:54 +04:00
|
|
|
*aResult = nsXPIDLString::Copy(s.GetUnicode());
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
nsXPIDLStringTest_Reference(const PRUnichar** aResult)
|
|
|
|
{
|
|
|
|
static const PRUnichar s[] = { 'H', 'e', 'l', 'l', 'o', ',', ' ',
|
|
|
|
'w', 'o', 'r', 'l', 'd', '\0' };
|
|
|
|
|
|
|
|
*aResult = s;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
nsXPIDLString s1;
|
|
|
|
nsXPIDLStringTest_Value(getter_Copies(s1));
|
|
|
|
nsXPIDLStringTest_Reference(getter_Shares(s1));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|