~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/stdlib/test/unicode_SUITE.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
 
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%
19
19
-module(unicode_SUITE).
20
20
 
21
 
-include("test_server.hrl").
 
21
-include_lib("test_server/include/test_server.hrl").
22
22
 
23
 
-export([all/1,  
 
23
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
24
         init_per_group/2,end_per_group/2,       
24
25
         init_per_testcase/2,
25
 
         fin_per_testcase/2,
 
26
         end_per_testcase/2,
26
27
         utf8_illegal_sequences_bif/1,
27
28
         utf16_illegal_sequences_bif/1,
28
29
         random_lists/1,
34
35
    Dog=?t:timetrap(?t:minutes(20)),
35
36
    [{watchdog, Dog}|Config].
36
37
 
37
 
fin_per_testcase(_Case, Config) ->
 
38
end_per_testcase(_Case, Config) ->
38
39
    Dog = ?config(watchdog, Config),
39
40
    ?t:timetrap_cancel(Dog).
40
41
 
41
 
all(suite) ->
42
 
    [utf8_illegal_sequences_bif,utf16_illegal_sequences_bif,random_lists,roundtrips,latin1,exceptions].
 
42
suite() -> [{ct_hooks,[ts_install_cth]}].
 
43
 
 
44
all() -> 
 
45
    [utf8_illegal_sequences_bif,
 
46
     utf16_illegal_sequences_bif, random_lists, roundtrips,
 
47
     latin1, exceptions].
 
48
 
 
49
groups() -> 
 
50
    [].
 
51
 
 
52
init_per_suite(Config) ->
 
53
    Config.
 
54
 
 
55
end_per_suite(_Config) ->
 
56
    ok.
 
57
 
 
58
init_per_group(_GroupName, Config) ->
 
59
    Config.
 
60
 
 
61
end_per_group(_GroupName, Config) ->
 
62
    Config.
 
63
 
43
64
 
44
65
 
45
66
exceptions(Config) when is_list(Config) ->
276
297
        unicode:characters_to_list(make_unaligned(MissingLastByte),unicode),
277
298
 
278
299
    ?line DoubleSize16 = byte_size(DoubleUtf16),
279
 
    ?line DoubleUtf16_2 = erlang:concat_binary([DoubleUtf16,<<16#FFFFF/utf16-big>>]),
 
300
    ?line DoubleUtf16_2 = list_to_binary([DoubleUtf16,<<16#FFFFF/utf16-big>>]),
280
301
    ?line DoubleSize16_2 = byte_size(DoubleUtf16_2),
281
302
    ?line AllBut1_16 = DoubleSize16 - 1,
282
303
    ?line AllBut2_16_2 = DoubleSize16_2 - 2,
884
905
 
885
906
list_to_utf8_bsyntax(List,unicode) ->
886
907
    FList = flatx(List),
887
 
    erlang:concat_binary([ if 
888
 
                               is_binary(E) ->
889
 
                                   E;
890
 
                               true -> 
891
 
                                   <<E/utf8>>
892
 
                           end || E <- FList ]);
 
908
    list_to_binary([ if
 
909
                         is_binary(E) ->
 
910
                             E;
 
911
                         true ->
 
912
                             <<E/utf8>>
 
913
                     end || E <- FList ]);
893
914
list_to_utf8_bsyntax(List,latin1) ->
894
915
    FList = flatb(List),
895
 
    erlang:concat_binary([ <<E/utf8>> || E <- FList ]).
 
916
    list_to_binary([ <<E/utf8>> || E <- FList ]).
896
917
 
897
918
    
898
919
    
954
975
 
955
976
list_to_utf16_big_bsyntax(List,{utf16,big}) ->
956
977
    FList = flatx(List),
957
 
    erlang:concat_binary([ if 
958
 
                               is_binary(E) ->
959
 
                                   E;
960
 
                               true -> 
961
 
                                   <<E/utf16-big>>
962
 
                           end || E <- FList ]);
 
978
    list_to_binary([ if
 
979
                         is_binary(E) ->
 
980
                             E;
 
981
                         true ->
 
982
                             <<E/utf16-big>>
 
983
                     end || E <- FList ]);
963
984
list_to_utf16_big_bsyntax(List,latin1) ->
964
985
    FList = flatb(List),
965
 
    erlang:concat_binary([ <<E/utf16-big>> || E <- FList ]).
 
986
    list_to_binary([ <<E/utf16-big>> || E <- FList ]).
966
987
 
967
988
 
968
989
utf16_little_to_list_bsyntax(<<>>) ->
972
993
 
973
994
list_to_utf16_little_bsyntax(List,{utf16,little}) ->
974
995
    FList = flatx(List),
975
 
    erlang:concat_binary([ if 
976
 
                               is_binary(E) ->
977
 
                                   E;
978
 
                               true -> 
979
 
                                   <<E/utf16-little>>
980
 
                           end || E <- FList ]);
 
996
    list_to_binary([ if
 
997
                         is_binary(E) ->
 
998
                             E;
 
999
                         true ->
 
1000
                             <<E/utf16-little>>
 
1001
                     end || E <- FList ]);
981
1002
list_to_utf16_little_bsyntax(List,latin1) ->
982
1003
    FList = flatb(List),
983
 
    erlang:concat_binary([ <<E/utf16-little>> || E <- FList ]).
 
1004
    list_to_binary([ <<E/utf16-little>> || E <- FList ]).
984
1005
 
985
1006
 
986
1007
    
991
1012
 
992
1013
list_to_utf32_big_bsyntax(List,{utf32,big}) ->
993
1014
    FList = flatx(List),
994
 
    erlang:concat_binary([ if 
995
 
                               is_binary(E) ->
996
 
                                   E;
997
 
                               true -> 
998
 
                                   <<E/utf32-big>>
999
 
                           end || E <- FList ]);
 
1015
    list_to_binary([ if
 
1016
                         is_binary(E) ->
 
1017
                             E;
 
1018
                         true ->
 
1019
                             <<E/utf32-big>>
 
1020
                     end || E <- FList ]);
1000
1021
list_to_utf32_big_bsyntax(List,latin1) ->
1001
1022
    FList = flatb(List),
1002
 
    erlang:concat_binary([ <<E/utf32-big>> || E <- FList ]).
 
1023
    list_to_binary([ <<E/utf32-big>> || E <- FList ]).
1003
1024
 
1004
1025
 
1005
1026
utf32_little_to_list_bsyntax(<<>>) ->
1009
1030
 
1010
1031
list_to_utf32_little_bsyntax(List,{utf32,little}) ->
1011
1032
    FList = flatx(List),
1012
 
    erlang:concat_binary([ if 
1013
 
                               is_binary(E) ->
1014
 
                                   E;
1015
 
                               true -> 
1016
 
                                   <<E/utf32-little>>
1017
 
                           end || E <- FList ]);
 
1033
    list_to_binary([ if
 
1034
                         is_binary(E) ->
 
1035
                             E;
 
1036
                         true ->
 
1037
                             <<E/utf32-little>>
 
1038
                      end || E <- FList ]);
1018
1039
list_to_utf32_little_bsyntax(List,latin1) ->
1019
1040
    FList = flatb(List),
1020
 
    erlang:concat_binary([ <<E/utf32-little>> || E <- FList ]).
 
1041
    list_to_binary([ <<E/utf32-little>> || E <- FList ]).
1021
1042
 
1022
1043
    
1023
1044