diff options
author | Björn Gustavsson <[email protected]> | 2016-04-20 15:09:28 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-04-20 15:09:28 +0200 |
commit | aee7c8eec5219cd1b29db34748d2b2a60701a0c3 (patch) | |
tree | 5cea140a7fc5ed6b4ecfa5162e34224d4b7d0707 /lib/debugger/test/bs_utf_SUITE.erl | |
parent | 17f8a6871e3503a670bd2d8ee44ead839f914bd8 (diff) | |
parent | 5f91c7307220d629f76ef1a914a480ba2a3d018e (diff) | |
download | otp-aee7c8eec5219cd1b29db34748d2b2a60701a0c3.tar.gz otp-aee7c8eec5219cd1b29db34748d2b2a60701a0c3.tar.bz2 otp-aee7c8eec5219cd1b29db34748d2b2a60701a0c3.zip |
Merge branch 'bjorn/debugger/cuddle-with-tests'
* bjorn/debugger/cuddle-with-tests:
Remove ?line macros
Replace "%" with "%%" at the beginning of a line
Eliminate doc and suite clauses
Eliminate use of the ?t macro
Eliminate use of test_server:format()
Eliminate use of test_server:fail/{0,1}
Use proplists:get_value/2 instead of ?config()
Modernize use of timetraps
int_SUITE: Fix interpretable/1 in a non-installed system
int_SUITE: Fix interpretable/1 on cross-compiled platforms
Diffstat (limited to 'lib/debugger/test/bs_utf_SUITE.erl')
-rw-r--r-- | lib/debugger/test/bs_utf_SUITE.erl | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/lib/debugger/test/bs_utf_SUITE.erl b/lib/debugger/test/bs_utf_SUITE.erl index 12ab2c8ac6..ccedc42064 100644 --- a/lib/debugger/test/bs_utf_SUITE.erl +++ b/lib/debugger/test/bs_utf_SUITE.erl @@ -31,7 +31,9 @@ -include_lib("common_test/include/ct.hrl"). -compile([no_jopt,time]). -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{minutes,1}}]. all() -> cases(). @@ -52,31 +54,28 @@ cases() -> init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), - Dog = test_server:timetrap(?t:minutes(1)), - [{watchdog,Dog}|Config]. + Config. -end_per_testcase(_Case, Config) -> - Dog = ?config(watchdog, Config), - ?t:timetrap_cancel(Dog), +end_per_testcase(_Case, _Config) -> ok. init_per_suite(Config) when is_list(Config) -> - ?line test_lib:interpret(?MODULE), - ?line true = lists:member(?MODULE, int:interpreted()), + test_lib:interpret(?MODULE), + true = lists:member(?MODULE, int:interpreted()), Config. end_per_suite(Config) when is_list(Config) -> ok. utf8_roundtrip(Config) when is_list(Config) -> - ?line [utf8_roundtrip_1(P) || P <- utf_data()], + [utf8_roundtrip_1(P) || P <- utf_data()], ok. utf8_roundtrip_1({Str,Bin,Bin}) -> - ?line Str = utf8_to_list(Bin), - ?line Bin = list_to_utf8(Str), - ?line [ok = utf8_guard(C, <<42,C/utf8>>) || C <- Str], - ?line [error = utf8_guard(C, <<C/utf8>>) || C <- Str], + Str = utf8_to_list(Bin), + Bin = list_to_utf8(Str), + [ok = utf8_guard(C, <<42,C/utf8>>) || C <- Str], + [error = utf8_guard(C, <<C/utf8>>) || C <- Str], ok. utf8_guard(C, Bin) when <<42,C/utf8>> =:= Bin -> ok; @@ -106,14 +105,14 @@ utf8_len(<<_/utf8,T/binary>>, N) -> utf8_len(<<>>, N) -> N. utf16_roundtrip(Config) when is_list(Config) -> - ?line {Str,Big,Big,Little,Little} = utf16_data(), - ?line 4 = utf16_big_len(Big), - ?line 4 = utf16_little_len(Little), - ?line Str = big_utf16_to_list(Big), - ?line Str = little_utf16_to_list(Little), + {Str,Big,Big,Little,Little} = utf16_data(), + 4 = utf16_big_len(Big), + 4 = utf16_little_len(Little), + Str = big_utf16_to_list(Big), + Str = little_utf16_to_list(Little), - ?line Big = list_to_big_utf16(Str), - ?line Little = list_to_little_utf16(Str), + Big = list_to_big_utf16(Str), + Little = list_to_little_utf16(Str), ok. @@ -154,14 +153,14 @@ little_utf16_to_list(<<H/little-utf16,T/binary>>) -> little_utf16_to_list(<<>>) -> []. utf32_roundtrip(Config) when is_list(Config) -> - ?line {Str,Big,Big,Little,Little} = utf32_data(), - ?line 4 = utf32_big_len(Big), - ?line 4 = utf32_little_len(Little), - ?line Str = big_utf32_to_list(Big), - ?line Str = little_utf32_to_list(Little), + {Str,Big,Big,Little,Little} = utf32_data(), + 4 = utf32_big_len(Big), + 4 = utf32_little_len(Little), + Str = big_utf32_to_list(Big), + Str = little_utf32_to_list(Little), - ?line Big = list_to_big_utf32(Str), - ?line Little = list_to_little_utf32(Str), + Big = list_to_big_utf32(Str), + Little = list_to_little_utf32(Str), ok. @@ -203,7 +202,7 @@ little_utf32_to_list(<<>>) -> []. guard(Config) when is_list(Config) -> - ?line error = do_guard(16#D800), + error = do_guard(16#D800), ok. do_guard(C) when byte_size(<<C/utf8>>) =/= 42 -> ok; @@ -215,13 +214,13 @@ do_guard(_) -> error. %% the delayed creation of sub-binaries works. extreme_tripping(Config) when is_list(Config) -> - ?line Unicode = lists:seq(0, 1024), - ?line Utf8 = unicode_to_utf8(Unicode, <<>>), - ?line Utf16 = utf8_to_utf16(Utf8, <<>>), - ?line Utf32 = utf8_to_utf32(Utf8, <<>>), - ?line Utf32 = utf16_to_utf32(Utf16, <<>>), - ?line Utf8 = utf32_to_utf8(Utf32, <<>>), - ?line Unicode = utf32_to_unicode(Utf32), + Unicode = lists:seq(0, 1024), + Utf8 = unicode_to_utf8(Unicode, <<>>), + Utf16 = utf8_to_utf16(Utf8, <<>>), + Utf32 = utf8_to_utf32(Utf8, <<>>), + Utf32 = utf16_to_utf32(Utf16, <<>>), + Utf8 = utf32_to_utf8(Utf32, <<>>), + Unicode = utf32_to_unicode(Utf32), ok. unicode_to_utf8([C|T], Bin) -> @@ -249,7 +248,7 @@ utf32_to_unicode(<<C/utf32,T/binary>>) -> utf32_to_unicode(<<>>) -> []. utf_data() -> -%% From RFC-3629. + %% From RFC-3629. %% Give the compiler a change to do some constant propagation. NotIdentical = 16#2262, @@ -287,7 +286,7 @@ utf16_data() -> %% Little endian (the two binaries should be equal). <<RaHieroglyph/little-utf16,16#3D/little-utf16, - 16#52/little-utf16,16#61/little-utf16>>, + 16#52/little-utf16,16#61/little-utf16>>, <<16#08,16#D8,16#45,16#DF,16#3D,16#00,16#52,16#00,16#61,16#00>>}. utf32_data() -> @@ -301,6 +300,6 @@ utf32_data() -> %% Little endian. <<16#0041/little-utf32,NotIdentical/little-utf32, - 16#0391/little-utf32,16#002E/little-utf32>>, + 16#0391/little-utf32,16#002E/little-utf32>>, <<16#41:32/little,NotIdentical:32/little, - 16#0391:32/little,16#2E:32/little>>}. + 16#0391:32/little,16#2E:32/little>>}. |