Exemplo n.º 1
0
    def test_fillunfill(self):
        S = 4
        buf = RingBuffer(S)
        for i in range(12):
            for j in range(S):
                buf.push(100 * i + j)
            for j in range(S):
                self.assertEqual(buf.pop(), 100 * i + j)

            # Moves ahead one space
            buf.push('NaN')
            buf.pop()
Exemplo n.º 2
0
    def test_fillunfill(self):
        S = 4
        buf = RingBuffer(S)
        for i in range(12):
            for j in range(S):
                buf.push(100 * i + j)
            for j in range(S):
                self.assertEqual(buf.pop(), 100 * i + j)

            # Moves ahead one space
            buf.push('NaN')
            buf.pop()
Exemplo n.º 3
0
 def test_pushpop(self):
     buf = RingBuffer(4)
     for i in range(12):
         buf.push(i)
         self.assertEqual(buf.pop(), i)
Exemplo n.º 4
0
 def test_pushpop(self):
     buf = RingBuffer(4)
     for i in range(12):
         buf.push(i)
         self.assertEqual(buf.pop(), i)