Exemple #1
0
def test_can_get_odd_number_of_bits():
    counts = Counter()
    for i in range(256):
        x = cu.getrandbits(ConjectureData.for_buffer([i]), 3)
        assert 0 <= x <= 7
        counts[x] += 1
    assert len(set(counts.values())) == 1
def test_can_get_odd_number_of_bits():
    counts = Counter()
    for i in range(256):
        x = cu.getrandbits(ConjectureData.for_buffer([i]), 3)
        assert 0 <= x <= 7
        counts[x] += 1
    assert len(set(counts.values())) == 1
Exemple #3
0
 def x(data):
     if cu.getrandbits(data, 8) >> 7:
         data.mark_interesting()
Exemple #4
0
def test_8_bits_just_reads_stream():
    for i in range(256):
        assert cu.getrandbits(ConjectureData.for_buffer([i]), 8) == i
def test_8_bits_just_reads_stream():
    for i in range(256):
        assert cu.getrandbits(ConjectureData.for_buffer([i]), 8) == i