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

« back to all changes in this revision

Viewing changes to lib/compiler/test/bs_bincomp_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
3
%% 
4
 
%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
 
4
%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
5
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
21
21
 
22
22
-module(bs_bincomp_SUITE).
23
23
 
24
 
-export([all/1,
 
24
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
25
         init_per_group/2,end_per_group/2,
25
26
         byte_aligned/1,bit_aligned/1,extended_byte_aligned/1,
26
27
         extended_bit_aligned/1,mixed/1,filters/1,trim_coverage/1,
27
 
         nomatch/1,sizes/1]).
28
 
 
29
 
-include("test_server.hrl").
30
 
 
31
 
all(suite) ->
32
 
    test_lib:recompile(?MODULE),
33
 
    [byte_aligned,bit_aligned,extended_byte_aligned,
34
 
     extended_bit_aligned,mixed,filters,trim_coverage,
35
 
     nomatch,sizes].
36
 
 
 
28
         nomatch/1,sizes/1,tail/1]).
 
29
 
 
30
-include_lib("test_server/include/test_server.hrl").
 
31
 
 
32
suite() -> [{ct_hooks,[ts_install_cth]}].
 
33
 
 
34
all() -> 
 
35
    test_lib:recompile(bs_bincomp_SUITE),
 
36
    [byte_aligned, bit_aligned, extended_byte_aligned,
 
37
     extended_bit_aligned, mixed, filters, trim_coverage,
 
38
     nomatch, sizes, tail].
 
39
 
 
40
groups() -> 
 
41
    [].
 
42
 
 
43
init_per_suite(Config) ->
 
44
    Config.
 
45
 
 
46
end_per_suite(_Config) ->
 
47
    ok.
 
48
 
 
49
init_per_group(_GroupName, Config) ->
 
50
        Config.
 
51
 
 
52
end_per_group(_GroupName, Config) ->
 
53
        Config.
37
54
 
38
55
byte_aligned(Config) when is_list(Config) ->
39
56
    cs_init(),
270
287
    ?line cs_end(),
271
288
    ok.
272
289
 
 
290
tail(Config) when is_list(Config) ->
 
291
    ?line [] = tail_1(<<0:7>>),
 
292
    ?line [0] = tail_1(<<0>>),
 
293
    ?line [0] = tail_1(<<0:12>>),
 
294
    ?line [0,0] = tail_1(<<0:20>>),
 
295
 
 
296
    ?line [] = tail_2(<<0:7>>),
 
297
    ?line [42] = tail_2(<<0>>),
 
298
    ?line [] = tail_2(<<0:12>>),
 
299
    ?line [42,42] = tail_2(<<0,1>>),
 
300
 
 
301
    ?line <<>> = tail_3(<<0:7>>),
 
302
    ?line <<42>> = tail_3(<<0>>),
 
303
    ?line <<42>> = tail_3(<<0:12>>),
 
304
    ?line <<42,42>> = tail_3(<<0:20>>),
 
305
 
 
306
    ?line [] = tail_4(<<0:15>>),
 
307
    ?line [7] = tail_4(<<7,8>>),
 
308
    ?line [9] = tail_4(<<9,17:12>>),
 
309
    ok.
 
310
 
 
311
tail_1(Bits) ->
 
312
    [X || <<X:8/integer, _/bits>> <= Bits].
 
313
 
 
314
tail_2(Bits) ->
 
315
    [42 || <<_:8/integer, _/bytes>> <= Bits].
 
316
 
 
317
tail_3(Bits) ->
 
318
    << <<42>> || <<_:8/integer, _/bits>> <= Bits >>.
 
319
 
 
320
tail_4(Bits) ->
 
321
    [X || <<X:8/integer, Tail/bits>> <= Bits, bit_size(Tail) >= 8].
273
322
 
274
323
 
275
324
cs_init() ->