The branch, master has been updated via 6fe2166... testprogs/midltests: add some example IDL files and there midltests.exe output from f7e14a8... s3: Reduce the load on the echo handler
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 6fe216642a1003a2fda2b8332199ff84c8712984 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Aug 12 09:31:38 2010 +0200 testprogs/midltests: add some example IDL files and there midltests.exe output metze ----------------------------------------------------------------------- Summary of changes: testprogs/win32/midltests/invalid/README.txt | 3 + testprogs/win32/midltests/midltests.idl | 2 +- testprogs/win32/midltests/valid/README.txt | 6 +++ .../valid/midltests_fixed_size_in_array_01.idl | 29 +++++++++++++ .../valid/midltests_fixed_size_in_array_01.txt | 6 +++ .../valid/midltests_strings_array_01.err.txt | 13 ++++++ .../midltests/valid/midltests_strings_array_01.idl | 44 ++++++++++++++++++++ .../midltests/valid/midltests_strings_array_02.idl | 44 ++++++++++++++++++++ .../midltests/valid/midltests_strings_array_02.txt | 9 ++++ .../midltests/valid/midltests_union_align_01.idl | 42 +++++++++++++++++++ .../midltests/valid/midltests_union_align_01.txt | 24 +++++++++++ 11 files changed, 221 insertions(+), 1 deletions(-) create mode 100644 testprogs/win32/midltests/invalid/README.txt create mode 100644 testprogs/win32/midltests/valid/README.txt create mode 100644 testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.idl create mode 100644 testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.txt create mode 100644 testprogs/win32/midltests/valid/midltests_strings_array_01.err.txt create mode 100644 testprogs/win32/midltests/valid/midltests_strings_array_01.idl create mode 100644 testprogs/win32/midltests/valid/midltests_strings_array_02.idl create mode 100644 testprogs/win32/midltests/valid/midltests_strings_array_02.txt create mode 100644 testprogs/win32/midltests/valid/midltests_union_align_01.idl create mode 100644 testprogs/win32/midltests/valid/midltests_union_align_01.txt Changeset truncated at 500 lines: diff --git a/testprogs/win32/midltests/invalid/README.txt b/testprogs/win32/midltests/invalid/README.txt new file mode 100644 index 0000000..f10cc15 --- /dev/null +++ b/testprogs/win32/midltests/invalid/README.txt @@ -0,0 +1,3 @@ +This directory contains IDL files which give errors, +when they're compiled as midltests.idl. + diff --git a/testprogs/win32/midltests/midltests.idl b/testprogs/win32/midltests/midltests.idl index 1932549..b327657 100644 --- a/testprogs/win32/midltests/midltests.idl +++ b/testprogs/win32/midltests/midltests.idl @@ -24,4 +24,4 @@ long srv_midltests_fn(void) return 0x65757254; } -#endif \ No newline at end of file +#endif diff --git a/testprogs/win32/midltests/valid/README.txt b/testprogs/win32/midltests/valid/README.txt new file mode 100644 index 0000000..9208fae --- /dev/null +++ b/testprogs/win32/midltests/valid/README.txt @@ -0,0 +1,6 @@ +This directory contains IDL files which demonstrate +the relationship between IDL definitions and NDR representation. + +In order to test them, you can compile them as midltests.idl. + +Note: some examples trigger runtime errors. diff --git a/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.idl b/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.idl new file mode 100644 index 0000000..170b147 --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.idl @@ -0,0 +1,29 @@ +#ifndef MIDLTESTS_C_CODE + +[ + uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"), + pointer_default(unique) +] +interface midltests +{ + long midltests_fn( + [in] long a[2] + ); +} + +#elif MIDLTESTS_C_CODE + +static void midltests(void) +{ + long a[2] = { 1, 2 }; + cli_midltests_fn(a); +} + +long srv_midltests_fn(long a[2]) +{ + printf("srv_midltests_fn: Start\n"); + printf("srv_midltests_fn: End\n"); + return 0x65757254; +} + +#endif diff --git a/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.txt b/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.txt new file mode 100644 index 0000000..8903c4c --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_fixed_size_in_array_01.txt @@ -0,0 +1,6 @@ +[in] Buffer[8/24] +[000] 01 00 00 00 02 00 00 00 ........ +srv_midltests_fn: Start +srv_midltests_fn: End +[out] Buffer[4] +[000] 54 72 75 65 True diff --git a/testprogs/win32/midltests/valid/midltests_strings_array_01.err.txt b/testprogs/win32/midltests/valid/midltests_strings_array_01.err.txt new file mode 100644 index 0000000..dbbc89a --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_strings_array_01.err.txt @@ -0,0 +1,13 @@ +[in] Buffer[53/53] +[000] 03 00 00 00 03 00 00 00 00 00 02 00 04 00 02 00 ........ ........ +[010] 00 00 00 00 04 00 00 00 00 00 00 00 04 00 00 00 ........ ........ +[020] 66 6F 6F 00 05 00 00 00 00 00 00 00 05 00 00 00 foo..... ........ +[030] 62 61 72 32 00 bar2. +srv_midltests_fn: Start +srv_midltests_fn: End +[out] Buffer[60] +[000] 03 00 00 00 03 00 00 00 00 00 02 00 04 00 02 00 ........ ........ +[010] 00 00 00 00 04 00 00 00 00 00 00 00 04 00 00 00 ........ ........ +[020] 66 6F 6F 00 05 00 00 00 00 00 00 00 05 00 00 00 foo..... ........ +[030] 62 61 72 32 00 00 00 00 54 72 75 65 bar2.... True +Runtime error 0x6f7 diff --git a/testprogs/win32/midltests/valid/midltests_strings_array_01.idl b/testprogs/win32/midltests/valid/midltests_strings_array_01.idl new file mode 100644 index 0000000..db05bb2 --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_strings_array_01.idl @@ -0,0 +1,44 @@ +#ifndef MIDLTESTS_C_CODE + +[ + uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"), + pointer_default(unique) +] +interface midltests +{ + struct strings { + long count; + [size_is(count),string] char *val[]; + }; + + long midltests_fn( + [in,out,ref] struct strings *s + ); +} + +#elif MIDLTESTS_C_CODE + +static void midltests(void) +{ + const char *s1 = "foo"; + const char *s2 = "bar"; + char *a[] = { "foo", "bar2", NULL }; + char buffer[1024]; + struct strings *s = buffer; + + s->count = 3; + s->val[0] = "foo"; + s->val[1] = "bar2"; + s->val[2] = NULL; + + cli_midltests_fn(s); +} + +long srv_midltests_fn(struct strings *a) +{ + printf("srv_midltests_fn: Start\n"); + printf("srv_midltests_fn: End\n"); + return 0x65757254; +} + +#endif diff --git a/testprogs/win32/midltests/valid/midltests_strings_array_02.idl b/testprogs/win32/midltests/valid/midltests_strings_array_02.idl new file mode 100644 index 0000000..46154c9 --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_strings_array_02.idl @@ -0,0 +1,44 @@ +#ifndef MIDLTESTS_C_CODE + +[ + uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"), + pointer_default(unique) +] +interface midltests +{ + struct strings { + long count; + [size_is(count),string] char *val[]; + }; + + long midltests_fn( + [in,ref] struct strings *s + ); +} + +#elif MIDLTESTS_C_CODE + +static void midltests(void) +{ + const char *s1 = "foo"; + const char *s2 = "bar"; + char *a[] = { "foo", "bar2", NULL }; + char buffer[1024]; + struct strings *s = buffer; + + s->count = 3; + s->val[0] = "foo"; + s->val[1] = "bar2"; + s->val[2] = NULL; + + cli_midltests_fn(s); +} + +long srv_midltests_fn(struct strings *a) +{ + printf("srv_midltests_fn: Start\n"); + printf("srv_midltests_fn: End\n"); + return 0x65757254; +} + +#endif diff --git a/testprogs/win32/midltests/valid/midltests_strings_array_02.txt b/testprogs/win32/midltests/valid/midltests_strings_array_02.txt new file mode 100644 index 0000000..2bec6a0 --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_strings_array_02.txt @@ -0,0 +1,9 @@ +[in] Buffer[53/53] +[000] 03 00 00 00 03 00 00 00 00 00 02 00 04 00 02 00 ........ ........ +[010] 00 00 00 00 04 00 00 00 00 00 00 00 04 00 00 00 ........ ........ +[020] 66 6F 6F 00 05 00 00 00 00 00 00 00 05 00 00 00 foo..... ........ +[030] 62 61 72 32 00 bar2. +srv_midltests_fn: Start +srv_midltests_fn: End +[out] Buffer[4] +[000] 54 72 75 65 True diff --git a/testprogs/win32/midltests/valid/midltests_union_align_01.idl b/testprogs/win32/midltests/valid/midltests_union_align_01.idl new file mode 100644 index 0000000..fcea072 --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_union_align_01.idl @@ -0,0 +1,42 @@ +#ifndef MIDLTESTS_C_CODE + +[ + uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"), + pointer_default(unique) +] +interface midltests +{ + [switch_type(short)] union u { + [case(0)]; + [case(2)] short s; + [case(4)] long l; + [case(8)] hyper h; + }; + + long midltests_fn( + [in] short level, + [in,switch_is(level)] union u u + ); +} + +#elif MIDLTESTS_C_CODE + +static void midltests(void) +{ + union u u; + u.h = 0xFFFFFFFFFFFFFFFFLL; + + cli_midltests_fn(0, u); + cli_midltests_fn(2, u); + cli_midltests_fn(4, u); + cli_midltests_fn(8, u); +} + +long srv_midltests_fn(short level, union u u) +{ + printf("srv_midltests_fn: Start\n"); + printf("srv_midltests_fn: End\n"); + return 0x65757254; +} + +#endif diff --git a/testprogs/win32/midltests/valid/midltests_union_align_01.txt b/testprogs/win32/midltests/valid/midltests_union_align_01.txt new file mode 100644 index 0000000..a7f737c --- /dev/null +++ b/testprogs/win32/midltests/valid/midltests_union_align_01.txt @@ -0,0 +1,24 @@ +[in] Buffer[4/8] +[000] 00 00 00 00 .... +srv_midltests_fn: Start +srv_midltests_fn: End +[out] Buffer[4] +[000] 54 72 75 65 True +[in] Buffer[6/10] +[000] 02 00 02 00 FF FF ...... +srv_midltests_fn: Start +srv_midltests_fn: End +[out] Buffer[4] +[000] 54 72 75 65 True +[in] Buffer[8/12] +[000] 04 00 04 00 FF FF FF FF ........ +srv_midltests_fn: Start +srv_midltests_fn: End +[out] Buffer[4] +[000] 54 72 75 65 True +[in] Buffer[16/16] +[000] 08 00 08 00 00 00 00 00 FF FF FF FF FF FF FF FF ........ ........ +srv_midltests_fn: Start +srv_midltests_fn: End +[out] Buffer[4] +[000] 54 72 75 65 True -- Samba Shared Repository