aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/test/ei_decode_encode_SUITE_data
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-01-22 19:25:36 +0100
committerSverker Eriksson <[email protected]>2013-01-22 19:34:03 +0100
commit1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1 (patch)
treebf152c1b3dbf855dfc5a8724c3e043e161a971b6 /lib/erl_interface/test/ei_decode_encode_SUITE_data
parent8eb544073fe243a8935a54f83f9c9f1f7478e3c5 (diff)
downloadotp-1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1.tar.gz
otp-1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1.tar.bz2
otp-1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1.zip
erl_interface: even more utf8 atom stuff
Diffstat (limited to 'lib/erl_interface/test/ei_decode_encode_SUITE_data')
-rw-r--r--lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c b/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
index 194ce9057b..e57663f984 100644
--- a/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
+++ b/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
@@ -63,10 +63,12 @@ int ei_x_encode_my_atom(ei_x_buff* x, my_atom* a)
return ei_x_encode_atom_as(x, a->name, ERLANG_UTF8, a->enc);
}
+#define BUFSZ 2000
+
void decode_encode(struct Type* t, void* obj)
{
char *buf;
- char buf2[1024];
+ char buf2[BUFSZ];
int size1 = 0;
int size2 = 0;
int size3 = 0;
@@ -89,6 +91,11 @@ void decode_encode(struct Type* t, void* obj)
return;
}
+ if (size1 > BUFSZ) {
+ fail("size is > BUFSZ");
+ return;
+ }
+
MESSAGE("ei_encode_%s buf is NULL, arg is type %s", t->name, t->type);
err = t->ei_encode_fp(NULL, &size2, obj);
if (err != 0) {
@@ -277,8 +284,11 @@ TESTCASE(test_ei_decode_encode)
EI_DECODE_ENCODE(ref , erlang_ref);
/* Unicode atoms */
- for (i=0; i<2010; i++) {
- EI_DECODE_ENCODE(my_atom , my_atom);
+ for (i=0; i<24; i++) {
+ EI_DECODE_ENCODE(my_atom, my_atom);
+ EI_DECODE_ENCODE(pid, erlang_pid);
+ EI_DECODE_ENCODE(port, erlang_port);
+ EI_DECODE_ENCODE(ref, erlang_ref);
}
report(1);