]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
remove util.ring, no longer used. also remove test_ring.py
authorBrian Warner <warner@lothar.com>
Sun, 1 Apr 2007 03:38:43 +0000 (20:38 -0700)
committerBrian Warner <warner@lothar.com>
Sun, 1 Apr 2007 03:38:43 +0000 (20:38 -0700)
src/allmydata/test/test_ring.py [deleted file]
src/allmydata/util/ring.py [deleted file]

diff --git a/src/allmydata/test/test_ring.py b/src/allmydata/test/test_ring.py
deleted file mode 100644 (file)
index 59737f2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /usr/bin/python
-
-from twisted.trial import unittest
-
-from allmydata.util import ring
-
-class Ring(unittest.TestCase):
-    def test_1(self):
-        self.failUnlessEquals(ring.distance(8, 9), 1)
-        self.failUnlessEquals(ring.distance(9, 8), 2**160-1)
-        self.failUnlessEquals(ring.distance(2, 2**160-1), 2**160-3)
-        self.failUnlessEquals(ring.distance(2**160-1, 2), 3)
-        self.failUnlessEquals(ring.distance(0, 2**159), 2**159)
-        self.failUnlessEquals(ring.distance(2**159, 0), 2**159)
-        self.failUnlessEquals(ring.distance(2**159-1, 2**159+1), 2)
-        self.failUnlessEquals(ring.distance(2**159-1, 1), 2**159+2)
-        self.failUnlessEquals(ring.distance(2**159-1, 2**159-1), 0)
-        self.failUnlessEquals(ring.distance(0, 0), 0)
-
diff --git a/src/allmydata/util/ring.py b/src/allmydata/util/ring.py
deleted file mode 100644 (file)
index 0ffebec..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-def distance(p1, p2, FULL = 2**160, HALF = 2**159):
-    """
-    Distance between two points in the space, expressed as longs.
-
-    @param p1: long of first point
-    @param p2: long of second point
-    """
-    d = p2 - p1
-    if d < 0:
-        d = FULL + d
-    return d
-