#NEWLINE# def test_overflow( slabutil ) : #NEWLINE# #INDENT# 'Test that slabs overflow in LRU sequence.' #NEWLINE# slabs = [ ] #NEWLINE# def _mkslab( i ) : #NEWLINE# #INDENT# v = [ ( i * _SLABSZ ) ] #NEWLINE# return slabutil_make_slab ( _NS , zip ( map ( str , v ) , v ) ) #NEWLINE# #UNINDENT# def _cb( slabkey , slabdesc , seq = [ 0 ] ) : #NEWLINE# #INDENT# n = seq [ 0 ] #NEWLINE# assert ( slabdesc is slabs [ n ] ) #NEWLINE# seq [ 0 ] = ( n + 1 ) #NEWLINE# #UNINDENT# lc = LRUCache ( _LRUSZ , _cb ) #NEWLINE# for i in xrange ( ( 2 * _LRUSZ ) ) : #NEWLINE# #INDENT# sl = _mkslab ( i ) #NEWLINE# slabs . append ( sl ) #NEWLINE# lc . insert_slab ( sl )