svn commit: samba r20962 - in branches/SAMBA_4_0: . source/torture/local

jelmer at samba.org jelmer at samba.org
Tue Jan 23 00:39:13 GMT 2007


Author: jelmer
Date: 2007-01-23 00:39:12 +0000 (Tue, 23 Jan 2007)
New Revision: 20962

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20962

Log:
Fix lcov
Added:
   branches/SAMBA_4_0/source/torture/local/tdr.c
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/torture/local/config.mk
   branches/SAMBA_4_0/source/torture/local/local.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
   - jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc

   + jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k


Modified: branches/SAMBA_4_0/source/torture/local/config.mk
===================================================================
--- branches/SAMBA_4_0/source/torture/local/config.mk	2007-01-23 00:26:03 UTC (rev 20961)
+++ branches/SAMBA_4_0/source/torture/local/config.mk	2007-01-23 00:39:12 UTC (rev 20962)
@@ -26,12 +26,14 @@
 		util_file.o \
 		sddl.o \
 		ndr.o \
+		tdr.o \
 		event.o \
 		local.o \
 		dbspeed.o \
 		torture.o
 PUBLIC_DEPENDENCIES = \
 		RPC_NDR_ECHO \
+		TDR \
 		LIBCLI_SMB \
 		MESSAGING \
 		ICONV \

Modified: branches/SAMBA_4_0/source/torture/local/local.c
===================================================================
--- branches/SAMBA_4_0/source/torture/local/local.c	2007-01-23 00:26:03 UTC (rev 20961)
+++ branches/SAMBA_4_0/source/torture/local/local.c	2007-01-23 00:39:12 UTC (rev 20962)
@@ -40,6 +40,7 @@
 	torture_local_resolve,
 	torture_local_sddl,
 	torture_local_ndr, 
+	torture_local_tdr, 
 	torture_local_event, 
 	torture_local_torture,
 	torture_local_dbspeed, 

Added: branches/SAMBA_4_0/source/torture/local/tdr.c
===================================================================
--- branches/SAMBA_4_0/source/torture/local/tdr.c	2007-01-23 00:26:03 UTC (rev 20961)
+++ branches/SAMBA_4_0/source/torture/local/tdr.c	2007-01-23 00:39:12 UTC (rev 20962)
@@ -0,0 +1,61 @@
+/* 
+   Unix SMB/CIFS implementation.
+   test suite for basic tdr functions
+
+   Copyright (C) Jelmer Vernooij 2007
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "torture/torture.h"
+#include "lib/tdr/tdr.h"
+
+static bool test_push_uint8(struct torture_context *tctx)
+{
+	uint8_t v = 4;
+	struct tdr_push *tdr = talloc_zero(tctx, struct tdr_push);
+
+	torture_assert_ntstatus_ok(tctx, tdr_push_uint8(tdr, &v), "push failed");
+	torture_assert_int_equal(tctx, tdr->data.length, 1, "length incorrect");
+	torture_assert_int_equal(tctx, tdr->data.data[0], 4, "data incorrect");
+	return true;
+}
+
+static bool test_pull_uint8(struct torture_context *tctx)
+{
+	uint8_t d = 2;
+	uint8_t l;
+	struct tdr_pull tdr;
+	tdr.data.data = &d;
+	tdr.data.length = 1;
+	tdr.offset = 0;
+	tdr.flags = 0;
+	torture_assert_ntstatus_ok(tctx, tdr_pull_uint8(&tdr, tctx, &l), 
+							   "pull failed");
+	torture_assert_int_equal(tctx, 1, tdr.offset, 
+							 "offset invalid");
+	return true;
+}
+
+struct torture_suite *torture_local_tdr(TALLOC_CTX *mem_ctx)
+{
+	struct torture_suite *suite = torture_suite_create(mem_ctx, "TDR");
+
+	torture_suite_add_simple_test(suite, "pull_uint8", test_pull_uint8);
+	torture_suite_add_simple_test(suite, "push_uint8", test_push_uint8);
+
+	return suite;
+}



More information about the samba-cvs mailing list