midltests: add midltests_varying_string_01.*
authorStefan Metzmacher <metze@samba.org>
Mon, 23 Sep 2013 07:54:13 +0000 (09:54 +0200)
committerMatthieu Patou <mat@matws.net>
Fri, 3 Oct 2014 19:16:40 +0000 (12:16 -0700)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
testprogs/win32/midltests/valid/midltests_varying_string_01.idl [new file with mode: 0644]
testprogs/win32/midltests/valid/midltests_varying_string_01.txt [new file with mode: 0644]

diff --git a/testprogs/win32/midltests/valid/midltests_varying_string_01.idl b/testprogs/win32/midltests/valid/midltests_varying_string_01.idl
new file mode 100644 (file)
index 0000000..925a292
--- /dev/null
@@ -0,0 +1,63 @@
+#ifndef MIDLTESTS_C_CODE
+
+/*
+ * For midltests_tcp.exe you may want to
+ * redirect the traffic via rinetd
+ * with a /etc/rinetd.conf like this:
+ *
+ * 172.31.9.1 5032 172.31.9.8 5032
+ * 172.31.9.1 5064 172.31.9.8 5064
+ *
+ * This is useful to watch the traffic with
+ * a network sniffer.
+ */
+/*
+cpp_quote("#define LISTEN_IP \"0.0.0.0\"")
+cpp_quote("#define FORWARD_IP \"127.0.0.1\"")
+cpp_quote("#define CONNECT_IP \"172.31.9.1\"")
+*/
+
+/*
+ * With midltests_tcp.exe NDR64 is enforced by default.
+ * For testing it might be needed to allow downgrades
+ * to NDR32. This is needed when you use 'pipe'.
+ */
+//cpp_quote("#define DONOT_FORCE_NDR64 1")
+
+[
+  uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+  pointer_default(unique)
+]
+interface midltests
+{
+       struct strings {
+               [string] char str[15];
+       };
+
+       long midltests_fn(
+               [in,ref] struct strings *_s1
+       );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+       struct strings s1;
+
+       memset(&s1, 0, sizeof(s1));
+
+       s1.str[0] = '1';
+       s1.str[1] = '2';
+
+       cli_midltests_fn(&s1);
+}
+
+long srv_midltests_fn(struct strings *s1)
+{
+       printf("srv_midltests_fn: Start\n");
+       printf("srv_midltests_fn: End\n");
+       return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_varying_string_01.txt b/testprogs/win32/midltests/valid/midltests_varying_string_01.txt
new file mode 100644 (file)
index 0000000..0db66d9
--- /dev/null
@@ -0,0 +1,38 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[35] plen[11] ahint[11]
+
+[000] 00 00 00 00 03 00 00 00  31 32 00                 ........ 12.
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65                                       True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[43] plen[19] ahint[19]
+
+[000] 00 00 00 00 00 00 00 00  03 00 00 00 00 00 00 00  ........ ........
+[010] 31 32 00                                          12.
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65                                       True
+
+NDRTcpThread[ndr64] stop
+
+Test OK