public void testLongStringGeneration() { StringBuilder buf = new StringBuilder(); final int MAX = Platform.isWindowsCE() ? 200000 : 2000000; for (int i = 0; i < MAX; i++) { buf.append('a'); } String s1 = buf.toString(); Memory m = new Memory((MAX + 1) * Native.WCHAR_SIZE); m.setWideString(0, s1); assertEquals("Missing terminator after write", 0, m.getChar(MAX * Native.WCHAR_SIZE)); String s2 = m.getWideString(0); assertEquals("Wrong string read length", s1.length(), s2.length()); assertEquals("Improper wide string read", s1, s2); }