diff options
author | Lukas Larsson <[email protected]> | 2013-01-28 10:27:26 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2013-01-28 10:27:26 +0100 |
commit | b5c654bd8f072754a6b7823c53c3106c026871f7 (patch) | |
tree | 1f551c43cea902ab727a4bde001bf8b356d9a5ac /lib/erl_interface/test/ei_encode_SUITE.erl | |
parent | cab17a9f36d2343e01f6aef64416d2a42308c25b (diff) | |
parent | 6058758c7b81cf458b1498bef76d672a207df4e8 (diff) | |
download | otp-b5c654bd8f072754a6b7823c53c3106c026871f7.tar.gz otp-b5c654bd8f072754a6b7823c53c3106c026871f7.tar.bz2 otp-b5c654bd8f072754a6b7823c53c3106c026871f7.zip |
Merge branch 'lukas/erl_interface/test_atom_as_functions/OTP-10753'
* lukas/erl_interface/test_atom_as_functions/OTP-10753:
Return if size test fails
Add utf8 atom encode and decode testcases
Validate UTF8/ASCII when buf is NULL
Diffstat (limited to 'lib/erl_interface/test/ei_encode_SUITE.erl')
-rw-r--r-- | lib/erl_interface/test/ei_encode_SUITE.erl | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/lib/erl_interface/test/ei_encode_SUITE.erl b/lib/erl_interface/test/ei_encode_SUITE.erl index 537e9cb01c..e0ac4c0637 100644 --- a/lib/erl_interface/test/ei_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_encode_SUITE.erl @@ -34,7 +34,9 @@ test_ei_encode_ulonglong/1, test_ei_encode_char/1, test_ei_encode_misc/1, - test_ei_encode_fails/1 + test_ei_encode_fails/1, + test_ei_encode_utf8_atom/1, + test_ei_encode_utf8_atom_len/1 ]). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -43,7 +45,8 @@ all() -> [test_ei_encode_long, test_ei_encode_ulong, test_ei_encode_longlong, test_ei_encode_ulonglong, test_ei_encode_char, test_ei_encode_misc, - test_ei_encode_fails]. + test_ei_encode_fails, test_ei_encode_utf8_atom, + test_ei_encode_utf8_atom_len]. groups() -> []. @@ -257,6 +260,38 @@ test_ei_encode_fails(Config) when is_list(Config) -> %% ######################################################################## %% +test_ei_encode_utf8_atom(Config) -> + ?line P = runner:start(?test_ei_encode_utf8_atom), + + ?line {<<119,2,195,133>>,'Å'} = get_buf_and_term(P), + ?line {<<100,0,1,197>>,'Å'} = get_buf_and_term(P), + ?line {<<100,0,1,197>>,'Å'} = get_buf_and_term(P), + ?line {<<119,2,195,133>>,'Å'} = get_buf_and_term(P), + + ?line {<<119,1,$A>>,'A'} = get_buf_and_term(P), + ?line {<<100,0,1,$A>>,'A'} = get_buf_and_term(P), + + ?line runner:recv_eot(P), + ok. + +%% ######################################################################## %% +test_ei_encode_utf8_atom_len(Config) -> + ?line P = runner:start(?test_ei_encode_utf8_atom_len), + + ?line {<<119,2,195,133>>,'Å'} = get_buf_and_term(P), + ?line {<<100,0,2,197,196>>,'ÅÄ'} = get_buf_and_term(P), + ?line {<<100,0,1,197>>,'Å'} = get_buf_and_term(P), + ?line {<<119,4,195,133,195,132>>,'ÅÄ'} = get_buf_and_term(P), + + ?line {<<119,1,$A>>,'A'} = get_buf_and_term(P), + ?line {<<100,0,2,$A,$B>>,'AB'} = get_buf_and_term(P), + ?line {<<100,0,255,_:(255*8)>>,_} = get_buf_and_term(P), + + ?line runner:recv_eot(P), + ok. + +%% ######################################################################## %% + % We read two packets for each test, the ei_encode and ei_x_encode version.... get_buf_and_term(P) -> |