From 8d95a47408e5b1accc8e51d182684e8c83cd133d Mon Sep 17 00:00:00 2001
From: antirez <antirez@gmail.com>
Date: Thu, 27 Feb 2014 10:07:29 +0100
Subject: [PATCH] Added two more BITCOUNT tests stressing misaligned access.

---
 tests/unit/bitops.tcl | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/unit/bitops.tcl b/tests/unit/bitops.tcl
index a145199a3..e7f289f94 100644
--- a/tests/unit/bitops.tcl
+++ b/tests/unit/bitops.tcl
@@ -98,6 +98,18 @@ start_server {tags {"bitops"}} {
         }
     } {1}
 
+    test {BITCOUNT misaligned prefix} {
+        r del str
+        r set str ab
+        r bitcount str 1 -1
+    } {3}
+
+    test {BITCOUNT misaligned prefix + full words + remainder} {
+        r del str
+        r set str __PPxxxxxxxxxxxxxxxxRR__
+        r bitcount str 2 -3
+    } {74}
+
     test {BITOP NOT (empty string)} {
         r set s ""
         r bitop not dest s