<s> from ctypes import * <EOL> import unittest <EOL> subclasses = [ ] <EOL> for base in [ c_byte , c_short , c_int , c_long , c_longlong , <EOL> c_ubyte , c_ushort , c_uint , c_ulong , c_ulonglong , <EOL> c_float , c_double ] : <EOL> class X ( base ) : <EOL> pass <EOL> subclasses . append ( X ) <EOL> class X ( c_char ) : <EOL> pass <EOL> class ReprTest ( unittest . TestCase ) : <EOL> def test_numbers ( self ) : <EOL> for typ in subclasses : <EOL> base = typ . __bases__ [ <NUM_LIT:0> ] <EOL> self . failUnless ( repr ( base ( <NUM_LIT> ) ) . startswith ( base . __name__ ) ) <EOL> self . failUnlessEqual ( "<STR_LIT>" , repr ( typ ( <NUM_LIT> ) ) [ : <NUM_LIT:12> ] ) <EOL> def test_char ( self ) : <EOL> self . failUnlessEqual ( "<STR_LIT>" , repr ( c_char ( '<STR_LIT:x>' ) ) ) <EOL> self . failUnlessEqual ( "<STR_LIT>" , repr ( X ( '<STR_LIT:x>' ) ) [ : <NUM_LIT:12> ] ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
