[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Thu Nov 4 16:52:02 MDT 2010


The branch, master has been updated
       via  4f8b59e s4: don't run etags over .inst files
       via  a971424 compression: added a simple lzxpress test
       via  199399e compression: fixed an uninitialised data but in lzxpress
      from  a5d4851 s3: Remove the use of cli_send_trans from cli_get_fs_full_size_info

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4f8b59edbcb976a8ad40e9c1214d3b1d8abe99c9
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Nov 5 09:01:47 2010 +1100

    s4: don't run etags over .inst files
    
    Autobuild-User: Andrew Tridgell <tridge at samba.org>
    Autobuild-Date: Thu Nov  4 22:51:06 UTC 2010 on sn-devel-104

commit a9714246a30107597210077d3c6d7188018fde32
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Nov 5 09:01:28 2010 +1100

    compression: added a simple lzxpress test

commit 199399ef7451482ce6efbb15cbbc165e5d29a800
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Nov 5 09:00:57 2010 +1100

    compression: fixed an uninitialised data but in lzxpress

-----------------------------------------------------------------------

Summary of changes:
 lib/compression/lzxpress.c  |    2 +
 lib/compression/testsuite.c |   49 ++++++++++++++++++++++++++++++++++++++++++-
 source4/wscript             |    4 +-
 3 files changed, 52 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/compression/lzxpress.c b/lib/compression/lzxpress.c
index 26b1bd5..0396c9d 100644
--- a/lib/compression/lzxpress.c
+++ b/lib/compression/lzxpress.c
@@ -80,6 +80,7 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
 
 	uncompressed_pos = 0;
 	indic = 0;
+	*(uint32_t *)compressed = 0;
 	compressed_pos = sizeof(uint32_t);
 	indic_pos = &compressed[0];
 
@@ -223,6 +224,7 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
 		for (; (indic_bit % 32) != 0; indic_bit++)
 			indic |= 0 << (32 - ((indic_bit % 32) + 1));
 
+		*(uint32_t *)&compressed[compressed_pos] = 0;
 		*(uint32_t *)indic_pos = indic;
 		compressed_pos += sizeof(uint32_t);
 	}
diff --git a/lib/compression/testsuite.c b/lib/compression/testsuite.c
index b9cebb2..8c3c66a 100644
--- a/lib/compression/testsuite.c
+++ b/lib/compression/testsuite.c
@@ -20,11 +20,58 @@
 
 #include "includes.h"
 #include "torture/torture.h"
-#include "../compression/mszip.h"
+#include "talloc.h"
+#include "mszip.h"
+#include "lzxpress.h"
+
+/*
+  test lzxpress
+ */
+static bool test_lzxpress(struct torture_context *test)
+{
+	TALLOC_CTX *tmp_ctx = talloc_new(test);
+	uint8_t *data;
+	const char *fixed_data = "this is a test. and this is a test too";
+	const uint8_t fixed_out[] = { 0x00, 0x20, 0x00, 0x04, 0x74, 0x68, 0x69, 0x73,
+				      0x20, 0x10, 0x00, 0x61, 0x20, 0x74, 0x65, 0x73,
+				      0x74, 0x2E, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x9F,
+				      0x00, 0x04, 0x20, 0x74, 0x6F, 0x6F, 0x00, 0x00,
+				      0x00, 0x00 };
+	ssize_t c_size;
+	uint8_t *out, *out2;
+
+	data = talloc_size(tmp_ctx, 1023);
+	out  = talloc_size(tmp_ctx, 2048);
+	memset(out, 0x42, talloc_get_size(out));
+
+	torture_comment(test, "lzxpress fixed compression\n");
+	c_size = lzxpress_compress((const uint8_t *)fixed_data,
+				   strlen(fixed_data),
+				   out,
+				   talloc_get_size(out));
+
+	torture_assert_int_equal(test, c_size, sizeof(fixed_out), "fixed lzxpress_compress size");
+	torture_assert_mem_equal(test, out, fixed_out, c_size, "fixed lzxpress_compress data");
+
+	torture_comment(test, "lzxpress fixed decompression\n");
+	out2  = talloc_size(tmp_ctx, strlen(fixed_data));
+	c_size = lzxpress_decompress(out,
+				     sizeof(fixed_out),
+				     out2,
+				     talloc_get_size(out2));
+
+	torture_assert_int_equal(test, c_size, strlen(fixed_data), "fixed lzxpress_decompress size");
+	torture_assert_mem_equal(test, out2, fixed_data, c_size, "fixed lzxpress_decompress data");
+
+	return true;
+}
+
 
 struct torture_suite *torture_local_compression(TALLOC_CTX *mem_ctx)
 {
 	struct torture_suite *suite = torture_suite_create(mem_ctx, "COMPRESSION");
 
+	torture_suite_add_simple_test(suite, "lzxpress", test_lzxpress);
+
 	return suite;
 }
diff --git a/source4/wscript b/source4/wscript
index ac4971c..fad9c34 100644
--- a/source4/wscript
+++ b/source4/wscript
@@ -134,7 +134,7 @@ def etags(ctx):
     '''build TAGS file using etags'''
     import Utils
     source_root = os.path.dirname(Utils.g_module.root_path)
-    cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root
+    cmd = 'etags $(find %s/.. -name "*.[ch]" | egrep -v \.inst\.)' % source_root
     print("Running: %s" % cmd)
     os.system(cmd)
 
@@ -142,7 +142,7 @@ def ctags(ctx):
     "build 'tags' file using ctags"
     import Utils
     source_root = os.path.dirname(Utils.g_module.root_path)
-    cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
+    cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h" | egrep -v \.inst\.)' % source_root
     print("Running: %s" % cmd)
     os.system(cmd)
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list