Skip to content

Commit

Permalink
Zero keys before redis increment/decrement tests
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Dec 16, 2013
1 parent 261ae0e commit 6c19150
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -87,6 +87,9 @@ public void testSetAndDelete() throws Exception {
public void testIncrement() throws Exception {

byte[] key = "INCR".getBytes();

jedis.set(key, "0".getBytes());

for (int i = 1; i < 100; i++) {
Long value = jedis.incr(key);

Expand All @@ -100,6 +103,9 @@ public void testIncrementBy() throws Exception {
long counter = 0;
Random r = new Random();
byte[] key = "INCRBY".getBytes();

jedis.set(key, "0".getBytes());

for (int i = 1; i < 100; i++) {
long delta = r.nextInt();

Expand All @@ -115,6 +121,9 @@ public void testIncrementBy() throws Exception {
public void testDecrement() throws Exception {

byte[] key = "DECR".getBytes();

jedis.set(key, "0".getBytes());

for (int i = 1; i < 100; i++) {
Long value = jedis.decr(key);

Expand All @@ -128,6 +137,9 @@ public void testDecrementBy() throws Exception {
long counter = 0;
Random r = new Random();
byte[] key = "DECRBY".getBytes();

jedis.set(key, "0".getBytes());

for (int i = 1; i < 100; i++) {
long delta = r.nextInt();

Expand Down

0 comments on commit 6c19150

Please sign in to comment.