Home | History | Annotate | Download | only in test
      1 #! /usr/bin/env python
      2 """Whimpy test script for the cl module
      3    Roger E. Masse
      4 """
      5 from test.test_support import verbose, import_module
      6 
      7 cl = import_module('cl')
      8 
      9 clattrs = ['ADDED_ALGORITHM_ERROR', 'ALAW', 'ALGORITHM_ID',
     10 'ALGORITHM_VERSION', 'AUDIO', 'AWARE_ERROR', 'AWARE_MPEG_AUDIO',
     11 'AWARE_MULTIRATE', 'AWCMP_CONST_QUAL', 'AWCMP_FIXED_RATE',
     12 'AWCMP_INDEPENDENT', 'AWCMP_JOINT_STEREO', 'AWCMP_LOSSLESS',
     13 'AWCMP_MPEG_LAYER_I', 'AWCMP_MPEG_LAYER_II', 'AWCMP_STEREO',
     14 'Algorithm', 'AlgorithmNumber', 'AlgorithmType', 'AudioFormatName',
     15 'BAD_ALGORITHM_NAME', 'BAD_ALGORITHM_TYPE', 'BAD_BLOCK_SIZE',
     16 'BAD_BOARD', 'BAD_BUFFERING', 'BAD_BUFFERLENGTH_NEG',
     17 'BAD_BUFFERLENGTH_ODD', 'BAD_BUFFER_EXISTS', 'BAD_BUFFER_HANDLE',
     18 'BAD_BUFFER_POINTER', 'BAD_BUFFER_QUERY_SIZE', 'BAD_BUFFER_SIZE',
     19 'BAD_BUFFER_SIZE_POINTER', 'BAD_BUFFER_TYPE',
     20 'BAD_COMPRESSION_SCHEME', 'BAD_COMPRESSOR_HANDLE',
     21 'BAD_COMPRESSOR_HANDLE_POINTER', 'BAD_FRAME_SIZE',
     22 'BAD_FUNCTIONALITY', 'BAD_FUNCTION_POINTER', 'BAD_HEADER_SIZE',
     23 'BAD_INITIAL_VALUE', 'BAD_INTERNAL_FORMAT', 'BAD_LICENSE',
     24 'BAD_MIN_GT_MAX', 'BAD_NO_BUFFERSPACE', 'BAD_NUMBER_OF_BLOCKS',
     25 'BAD_PARAM', 'BAD_PARAM_ID_POINTER', 'BAD_PARAM_TYPE', 'BAD_POINTER',
     26 'BAD_PVBUFFER', 'BAD_SCHEME_POINTER', 'BAD_STREAM_HEADER',
     27 'BAD_STRING_POINTER', 'BAD_TEXT_STRING_PTR', 'BEST_FIT',
     28 'BIDIRECTIONAL', 'BITRATE_POLICY', 'BITRATE_TARGET',
     29 'BITS_PER_COMPONENT', 'BLENDING', 'BLOCK_SIZE', 'BOTTOM_UP',
     30 'BUFFER_NOT_CREATED', 'BUF_DATA', 'BUF_FRAME', 'BytesPerPixel',
     31 'BytesPerSample', 'CHANNEL_POLICY', 'CHROMA_THRESHOLD', 'CODEC',
     32 'COMPONENTS', 'COMPRESSED_BUFFER_SIZE', 'COMPRESSION_RATIO',
     33 'COMPRESSOR', 'CONTINUOUS_BLOCK', 'CONTINUOUS_NONBLOCK',
     34 'CompressImage', 'DATA', 'DECOMPRESSOR', 'DecompressImage',
     35 'EDGE_THRESHOLD', 'ENABLE_IMAGEINFO', 'END_OF_SEQUENCE', 'ENUM_VALUE',
     36 'EXACT_COMPRESSION_RATIO', 'EXTERNAL_DEVICE', 'FLOATING_ENUM_VALUE',
     37 'FLOATING_RANGE_VALUE', 'FRAME', 'FRAME_BUFFER_SIZE',
     38 'FRAME_BUFFER_SIZE_ZERO', 'FRAME_RATE', 'FRAME_TYPE', 'G711_ALAW',
     39 'G711_ULAW', 'GRAYSCALE', 'GetAlgorithmName', 'HDCC',
     40 'HDCC_SAMPLES_PER_TILE', 'HDCC_TILE_THRESHOLD', 'HEADER_START_CODE',
     41 'IMAGE_HEIGHT', 'IMAGE_WIDTH', 'INTERNAL_FORMAT',
     42 'INTERNAL_IMAGE_HEIGHT', 'INTERNAL_IMAGE_WIDTH', 'INTRA', 'JPEG',
     43 'JPEG_ERROR', 'JPEG_NUM_PARAMS', 'JPEG_QUALITY_FACTOR',
     44 'JPEG_QUANTIZATION_TABLES', 'JPEG_SOFTWARE', 'JPEG_STREAM_HEADERS',
     45 'KEYFRAME', 'LAST_FRAME_INDEX', 'LAYER', 'LUMA_THRESHOLD',
     46 'MAX_NUMBER_OF_AUDIO_ALGORITHMS', 'MAX_NUMBER_OF_ORIGINAL_FORMATS',
     47 'MAX_NUMBER_OF_PARAMS', 'MAX_NUMBER_OF_VIDEO_ALGORITHMS', 'MONO',
     48 'MPEG_VIDEO', 'MVC1', 'MVC2', 'MVC2_BLENDING', 'MVC2_BLENDING_OFF',
     49 'MVC2_BLENDING_ON', 'MVC2_CHROMA_THRESHOLD', 'MVC2_EDGE_THRESHOLD',
     50 'MVC2_ERROR', 'MVC2_LUMA_THRESHOLD', 'NEXT_NOT_AVAILABLE',
     51 'NOISE_MARGIN', 'NONE', 'NUMBER_OF_FRAMES', 'NUMBER_OF_PARAMS',
     52 'ORIENTATION', 'ORIGINAL_FORMAT', 'OpenCompressor',
     53 'OpenDecompressor', 'PARAM_OUT_OF_RANGE', 'PREDICTED', 'PREROLL',
     54 'ParamID', 'ParamNumber', 'ParamType', 'QUALITY_FACTOR',
     55 'QUALITY_LEVEL', 'QueryAlgorithms', 'QueryMaxHeaderSize',
     56 'QueryScheme', 'QuerySchemeFromName', 'RANGE_VALUE', 'RGB', 'RGB332',
     57 'RGB8', 'RGBA', 'RGBX', 'RLE', 'RLE24', 'RTR', 'RTR1',
     58 'RTR_QUALITY_LEVEL', 'SAMPLES_PER_TILE', 'SCHEME_BUSY',
     59 'SCHEME_NOT_AVAILABLE', 'SPEED', 'STEREO_INTERLEAVED',
     60 'STREAM_HEADERS', 'SetDefault', 'SetMax', 'SetMin', 'TILE_THRESHOLD',
     61 'TOP_DOWN', 'ULAW', 'UNCOMPRESSED', 'UNCOMPRESSED_AUDIO',
     62 'UNCOMPRESSED_VIDEO', 'UNKNOWN_SCHEME', 'VIDEO', 'VideoFormatName',
     63 'Y', 'YCbCr', 'YCbCr422', 'YCbCr422DC', 'YCbCr422HC', 'YUV', 'YUV422',
     64 'YUV422DC', 'YUV422HC', '__doc__', '__name__', 'cvt_type', 'error']
     65 
     66 
     67 # This is a very inobtrusive test for the existence of the cl
     68 # module and all its attributes.
     69 
     70 def test_main():
     71     # touch all the attributes of al without doing anything
     72     if verbose:
     73         print 'Touching cl module attributes...'
     74     for attr in clattrs:
     75         if verbose:
     76             print 'touching: ', attr
     77         getattr(cl, attr)
     78 
     79 
     80 
     81 if __name__ == '__main__':
     82     test_main()
     83