mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
bind/java: ensure there is enough capacity for writing seq
The new testLongString triggers the bug without this change. Fixes golang/go#9251. Change-Id: I463e2897b5b08f53801f151c7311d591546c0719 Reviewed-on: https://go-review.googlesource.com/1373 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
@@ -16,6 +16,28 @@ public class SeqTest extends TestCase {
|
||||
assertEquals("Unexpected arithmetic failure", 7, res);
|
||||
}
|
||||
|
||||
public void testShortString() {
|
||||
String want = "a short string";
|
||||
String got = Testpkg.StrDup(want);
|
||||
assertEquals("Strings should match", want, got);
|
||||
}
|
||||
|
||||
public void testLongString() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (int i = 0; i < 128*1024; i++) {
|
||||
b.append("0123456789");
|
||||
}
|
||||
String want = b.toString();
|
||||
String got = Testpkg.StrDup(want);
|
||||
assertEquals("Strings should match", want, got);
|
||||
}
|
||||
|
||||
public void testUnicode() {
|
||||
String want = "Hello, 世界";
|
||||
String got = Testpkg.StrDup(want);
|
||||
assertEquals("Strings should match", want, got);
|
||||
}
|
||||
|
||||
public void testGoRefGC() {
|
||||
Testpkg.S s = Testpkg.New();
|
||||
runGC();
|
||||
|
||||
Reference in New Issue
Block a user