Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/pidl/tests
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/pidl/tests/Util.pm

    r414 r740  
    7777
    7878        my $main = "
    79 #define uint_t unsigned int
    8079#include <stdint.h>
    8180#include <stdlib.h>
  • vendor/current/pidl/tests/ndr.pl

    r414 r740  
    2323        'LINE' => 42 };
    2424
    25 is_deeply(GetElementLevelTable($e, "unique"), [
     25is_deeply(GetElementLevelTable($e, "unique", 0), [
    2626        {
    2727                'IS_DEFERRED' => 0,
     
    3434]);
    3535
    36 my $ne = ParseElement($e, "unique");
     36my $ne = ParseElement($e, "unique", 0);
    3737is($ne->{ORIGINAL}, $e);
    3838is($ne->{NAME}, "v");
     
    6161        'LINE' => 42 };
    6262
    63 is_deeply(GetElementLevelTable($e, "unique"), [
     63is_deeply(GetElementLevelTable($e, "unique", 0), [
    6464        {
    6565                LEVEL_INDEX => 0,
     
    9191        'LINE' => 42 };
    9292
    93 is_deeply(GetElementLevelTable($e, "unique"), [
     93is_deeply(GetElementLevelTable($e, "unique", 0), [
    9494        {
    9595                LEVEL_INDEX => 0,
     
    129129        'LINE' => 42 };
    130130
    131 is_deeply(GetElementLevelTable($e, "unique"), [
     131is_deeply(GetElementLevelTable($e, "unique", 0), [
    132132        {
    133133                LEVEL_INDEX => 0,
     
    159159        'LINE' => 42 };
    160160
    161 is_deeply(GetElementLevelTable($e, "unique"), [
     161is_deeply(GetElementLevelTable($e, "unique", 0), [
    162162        {
    163163                LEVEL_INDEX => 0,
     
    205205        'LINE' => 42 };
    206206
    207 is_deeply(GetElementLevelTable($e, "ref"), [
     207is_deeply(GetElementLevelTable($e, "ref", 0), [
    208208        {
    209209                LEVEL_INDEX => 0,
     
    251251        'LINE' => 42 };
    252252
    253 is_deeply(GetElementLevelTable($e, "unique"), [
     253is_deeply(GetElementLevelTable($e, "unique", 0), [
    254254        {
    255255                LEVEL_INDEX => 0,
     
    281281        'LINE' => 42 };
    282282
    283 is_deeply(GetElementLevelTable($e, "unique"), [
     283is_deeply(GetElementLevelTable($e, "unique", 0), [
    284284        {
    285285                LEVEL_INDEX => 0,
     
    327327        'LINE' => 42 };
    328328
    329 is_deeply(GetElementLevelTable($e, "unique"), [
     329is_deeply(GetElementLevelTable($e, "unique", 0), [
    330330        {
    331331                LEVEL_INDEX => 0,
     
    373373        'LINE' => 42 };
    374374
    375 is_deeply(GetElementLevelTable($e, "ref"), [
     375is_deeply(GetElementLevelTable($e, "ref", 0), [
    376376        {
    377377                LEVEL_INDEX => 0,
     
    419419        'LINE' => 42 };
    420420
    421 is_deeply(GetElementLevelTable($e, "ref"), [
     421is_deeply(GetElementLevelTable($e, "ref", 0), [
    422422        {
    423423                LEVEL_INDEX => 0,
     
    464464        'LINE' => 42 };
    465465
    466 $ne = ParseElement($e, undef);
     466$ne = ParseElement($e, undef, 0);
    467467is($ne->{REPRESENTATION_TYPE}, "bar");
    468468
     
    477477        'LINE' => 42 };
    478478
    479 $ne = ParseElement($e, undef);
     479$ne = ParseElement($e, undef, 0);
    480480is($ne->{REPRESENTATION_TYPE}, "uint8");
    481481
     
    522522        ALIGN => undef
    523523};
    524 is_deeply(ParseType($t->{ORIGINAL}, "ref"), $t);
     524is_deeply(ParseType($t->{ORIGINAL}, "ref", 0), $t);
    525525
    526526$t = {
     
    531531        PROPERTIES => undef,
    532532        HAS_DEFAULT => 0,
     533        IS_MS_UNION => 0,
    533534        ORIGINAL => {
    534535                TYPE => "UNION",
    535536                NAME => "foo"
    536         }
     537        },
     538        ALIGN => undef
    537539};
    538 is_deeply(ParseType($t->{ORIGINAL}, "ref"), $t);
     540is_deeply(ParseType($t->{ORIGINAL}, "ref", 0), $t);
    539541
    540542ok(not can_contain_deferred("uint32"));
     
    553555                ELEMENTS => [ { TYPE => "someunknowntype" } ]}));
    554556# Make sure the elements for a enum without body aren't filled in
    555 ok(not defined(ParseType({TYPE => "ENUM", NAME => "foo" }, "ref")->{ELEMENTS}));
     557ok(not defined(ParseType({TYPE => "ENUM", NAME => "foo" }, "ref", 0)->{ELEMENTS}));
    556558# Make sure the elements for a bitmap without body aren't filled in
    557 ok(not defined(ParseType({TYPE => "BITMAP", NAME => "foo" }, "ref")->{ELEMENTS}));
     559ok(not defined(ParseType({TYPE => "BITMAP", NAME => "foo" }, "ref", 0)->{ELEMENTS}));
    558560# Make sure the elements for a union without body aren't filled in
    559 ok(not defined(ParseType({TYPE => "UNION", NAME => "foo" }, "ref")->{ELEMENTS}));
     561ok(not defined(ParseType({TYPE => "UNION", NAME => "foo" }, "ref", 0)->{ELEMENTS}));
  • vendor/current/pidl/tests/ndr_string.pl

    r414 r740  
    1515        uint8_t data[] = { 0x00, 0x00, 0x00, 0x00 };
    1616        DATA_BLOB b = { data, 4 };
    17         struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
    18                 smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
     17        struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
    1918        struct TestString r;
    2019        r.in.data = NULL;
     
    3837                                           \'f\', \'o\', \'o\', 0 };
    3938        DATA_BLOB b = { data, 8 };
    40         struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
    41                 smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
     39        struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
    4240        struct TestString r;
    4341        r.in.data = NULL;
     
    7573        };
    7674        DATA_BLOB b = { data, sizeof(data) };
    77         struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
    78                 smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
     75        struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
    7976        struct TestString r;
    8077        struct TestStringStruct str;
     
    121118        };
    122119        DATA_BLOB b = { data, sizeof(data) };
    123         struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
    124                 smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
     120        struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
    125121        struct TestString r;
    126122        struct TestStringStruct str;
     
    153149        };
    154150        DATA_BLOB b = { data, sizeof(data) };
    155         struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
    156                 smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
     151        struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
    157152        struct TestString r;
    158153        struct TestStringStruct str;
     
    175170                                           \'f\', \'o\', \'o\', 0 };
    176171        DATA_BLOB b = { data, 8 };
    177         struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
    178                 smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
     172        struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
    179173        struct TestString r;
    180174        char *str = NULL;
  • vendor/current/pidl/tests/parse_idl.pl

    r414 r740  
    159159                'TYPE' => 'TYPEDEF',
    160160                'NAME' => 'y',
     161                'POINTERS' => 0,
    161162                'DATA' => {
    162163                        'TYPE' => 'STRUCT',
     
    181182                'TYPE' => 'TYPEDEF',
    182183                'NAME' => 'y',
     184                'POINTERS' => 0,
    183185                'DATA' => {
    184186                        'TYPE' => 'STRUCT',
     
    203205                'TYPE' => 'TYPEDEF',
    204206                'NAME' => 'y',
     207                'POINTERS' => 0,
    205208                'DATA' => {
    206209                        'TYPE' => 'BITMAP',
     
    226229                'TYPE' => 'TYPEDEF',
    227230                'NAME' => 'y',
     231                'POINTERS' => 0,
    228232                'DATA' => {
    229233                        'TYPE' => 'UNION',
  • vendor/current/pidl/tests/samba-ndr.pl

    r414 r740  
    224224is($generator->{res}, "if (ndr_flags & NDR_SCALARS) {
    225225        NDR_CHECK(ndr_push_align(ndr, 4));
     226        NDR_CHECK(ndr_push_trailer_align(ndr, 4));
    226227}
    227228if (ndr_flags & NDR_BUFFERS) {
     
    249250        NDR_CHECK(ndr_push_align(ndr, 4));
    250251        NDR_CHECK(ndr_push_mytype(ndr, NDR_SCALARS, &x->el1));
     252        NDR_CHECK(ndr_push_trailer_align(ndr, 4));
    251253}
    252254if (ndr_flags & NDR_BUFFERS) {
  • vendor/current/pidl/tests/samba3-cli.pl

    r414 r740  
    55use warnings;
    66
    7 use Test::More tests => 9;
     7use Test::More tests => 8;
    88use FindBin qw($RealBin);
    99use lib "$RealBin";
    1010use Util;
    1111use Parse::Pidl::Util qw(MyDumper);
    12 use Parse::Pidl::Samba3::ClientNDR qw(ParseFunction ParseOutputArgument);
     12use Parse::Pidl::Samba3::ClientNDR qw(ParseFunction);
    1313use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv);
    1414
     
    3232is($x->{res},
    3333"struct rpccli_bar_state {
    34         struct bar orig;
    35         struct bar tmp;
    3634        TALLOC_CTX *out_mem_ctx;
    37         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
    3835};
    3936
     
    5451        }
    5552        state->out_mem_ctx = NULL;
    56         state->dispatch_recv = cli->dispatch_recv;
    57 
    58         /* In parameters */
    59 
    60         /* Out parameters */
    61 
    62         if (DEBUGLEVEL >= 10) {
    63                 NDR_PRINT_IN_DEBUG(bar, &state->orig);
    64         }
    65 
    66         /* make a temporary copy, that we pass to the dispatch function */
    67         state->tmp = state->orig;
    68 
    69         subreq = cli->dispatch_send(state, ev, cli,
    70                                     &ndr_table_foo,
    71                                     NDR_BAR,
    72                                     &state->tmp);
     53
     54        subreq = dcerpc_bar_send(state,
     55                                 ev,
     56                                 cli->binding_handle);
    7357        if (tevent_req_nomem(subreq, req)) {
    7458                return tevent_req_post(req, ev);
     
    9377        }
    9478
    95         status = state->dispatch_recv(subreq, mem_ctx);
     79        status = dcerpc_bar_recv(subreq,
     80                                 mem_ctx);
    9681        TALLOC_FREE(subreq);
    9782        if (!NT_STATUS_IS_OK(status)) {
     
    10085        }
    10186
    102         /* Copy out parameters */
    103 
    104         /* Reset temporary structure */
    105         ZERO_STRUCT(state->tmp);
    106 
    107         if (DEBUGLEVEL >= 10) {
    108                 NDR_PRINT_OUT_DEBUG(bar, &state->orig);
    109         }
    110 
    11187        tevent_req_done(req);
    11288}
     
    124100        }
    125101
    126         /* Steal possbile out parameters to the callers context */
     102        /* Steal possible out parameters to the callers context */
    127103        talloc_steal(mem_ctx, state->out_mem_ctx);
    128104
     
    134110                    TALLOC_CTX *mem_ctx)
    135111{
    136 \tstruct bar r;
    137 \tNTSTATUS status;
    138 
    139 \t/* In parameters */
    140 
    141 \tif (DEBUGLEVEL >= 10) {
    142 \t\tNDR_PRINT_IN_DEBUG(bar, &r);
    143 \t}
    144 
    145         status = cli->dispatch(cli,
    146                                 mem_ctx,
    147                                 &ndr_table_foo,
    148                                 NDR_BAR,
    149                                 &r);
    150 
    151 \tif (!NT_STATUS_IS_OK(status)) {
    152 \t\treturn status;
    153 \t}
    154 
    155 \tif (DEBUGLEVEL >= 10) {
    156 \t\tNDR_PRINT_OUT_DEBUG(bar, &r);
    157 \t}
    158 
    159 \tif (NT_STATUS_IS_ERR(status)) {
    160 \t\treturn status;
    161 \t}
    162 
    163 \t/* Return variables */
    164 
    165 \t/* Return result */
    166 \treturn NT_STATUS_OK;
     112        NTSTATUS status;
     113
     114        status = dcerpc_bar(cli->binding_handle,
     115                            mem_ctx);
     116        if (!NT_STATUS_IS_OK(status)) {
     117                return status;
     118        }
     119
     120        /* Return result */
     121        return NT_STATUS_OK;
    167122}
    168123
     
    175130is($x->{res},
    176131"struct rpccli_bar_state {
    177         struct bar orig;
    178         struct bar tmp;
    179132        TALLOC_CTX *out_mem_ctx;
    180         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
     133        WERROR result;
    181134};
    182135
     
    197150        }
    198151        state->out_mem_ctx = NULL;
    199         state->dispatch_recv = cli->dispatch_recv;
    200 
    201         /* In parameters */
    202 
    203         /* Out parameters */
    204 
    205         /* Result */
    206         ZERO_STRUCT(state->orig.out.result);
    207 
    208         if (DEBUGLEVEL >= 10) {
    209                 NDR_PRINT_IN_DEBUG(bar, &state->orig);
    210         }
    211 
    212         /* make a temporary copy, that we pass to the dispatch function */
    213         state->tmp = state->orig;
    214 
    215         subreq = cli->dispatch_send(state, ev, cli,
    216                                     &ndr_table_foo,
    217                                     NDR_BAR,
    218                                     &state->tmp);
     152
     153        subreq = dcerpc_bar_send(state,
     154                                 ev,
     155                                 cli->binding_handle);
    219156        if (tevent_req_nomem(subreq, req)) {
    220157                return tevent_req_post(req, ev);
     
    239176        }
    240177
    241         status = state->dispatch_recv(subreq, mem_ctx);
     178        status = dcerpc_bar_recv(subreq,
     179                                 mem_ctx,
     180                                 &state->result);
    242181        TALLOC_FREE(subreq);
    243182        if (!NT_STATUS_IS_OK(status)) {
    244183                tevent_req_nterror(req, status);
    245184                return;
    246         }
    247 
    248         /* Copy out parameters */
    249 
    250         /* Copy result */
    251         state->orig.out.result = state->tmp.out.result;
    252 
    253         /* Reset temporary structure */
    254         ZERO_STRUCT(state->tmp);
    255 
    256         if (DEBUGLEVEL >= 10) {
    257                 NDR_PRINT_OUT_DEBUG(bar, &state->orig);
    258185        }
    259186
     
    274201        }
    275202
    276         /* Steal possbile out parameters to the callers context */
     203        /* Steal possible out parameters to the callers context */
    277204        talloc_steal(mem_ctx, state->out_mem_ctx);
    278205
    279206        /* Return result */
    280         *result = state->orig.out.result;
     207        *result = state->result;
    281208
    282209        tevent_req_received(req);
     
    288215                    WERROR *werror)
    289216{
    290 \tstruct bar r;
    291 \tNTSTATUS status;
    292 
    293 \t/* In parameters */
    294 
    295 \tif (DEBUGLEVEL >= 10) {
    296 \t\tNDR_PRINT_IN_DEBUG(bar, &r);
    297 \t}
    298 
    299         status = cli->dispatch(cli,
    300                                 mem_ctx,
    301                                 &ndr_table_foo,
    302                                 NDR_BAR,
    303                                 &r);
    304 
    305 \tif (!NT_STATUS_IS_OK(status)) {
    306 \t\treturn status;
    307 \t}
    308 
    309 \tif (DEBUGLEVEL >= 10) {
    310 \t\tNDR_PRINT_OUT_DEBUG(bar, &r);
    311 \t}
    312 
    313 \tif (NT_STATUS_IS_ERR(status)) {
    314 \t\treturn status;
    315 \t}
    316 
    317 \t/* Return variables */
    318 
    319 \t/* Return result */
    320 \tif (werror) {
    321 \t\t*werror = r.out.result;
    322 \t}
    323 
    324 \treturn werror_to_ntstatus(r.out.result);
     217        WERROR result;
     218        NTSTATUS status;
     219
     220        status = dcerpc_bar(cli->binding_handle,
     221                            mem_ctx,
     222                            &result);
     223        if (!NT_STATUS_IS_OK(status)) {
     224                return status;
     225        }
     226
     227        /* Return result */
     228        if (werror) {
     229                *werror = result;
     230        }
     231
     232        return werror_to_ntstatus(result);
    325233}
    326234
    327235");
    328236
    329 $x = new Parse::Pidl::Samba3::ClientNDR();
    330 
    331 $fn = { NAME => "bar", ELEMENTS => [ ], RETURN_TYPE => "WERROR" };
    332 my $e = { NAME => "foo", ORIGINAL => { FILE => "f", LINE => -1 },
    333           LEVELS => [ { TYPE => "ARRAY", SIZE_IS => "mysize" }, { TYPE => "DATA", DATA_TYPE => "int" } ]};
    334 
    335 $x->ParseOutputArgument($fn, $e);
    336 is($x->{res}, "memcpy(foo, r.out.foo, (mysize) * sizeof(*foo));\n");
Note: See TracChangeset for help on using the changeset viewer.