PAPI  5.0.1.0
eventname.c
Go to the documentation of this file.
00001 #include "papi_test.h"
00002 extern int TESTS_QUIET;                /* Declared in test_utils.c */
00003 
00004 int
00005 main( int argc, char **argv )
00006 {
00007     int retval;
00008     int preset;
00009 
00010     tests_quiet( argc, argv );  /* Set TESTS_QUIET variable */
00011 
00012     if ( ( retval =
00013            PAPI_library_init( PAPI_VER_CURRENT ) ) != PAPI_VER_CURRENT )
00014         test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
00015 
00016     retval = PAPI_event_name_to_code( "PAPI_FP_INS", &preset );
00017     if ( retval != PAPI_OK )
00018         test_fail( __FILE__, __LINE__, "PAPI_event_name_to_code", retval );
00019     if ( preset != PAPI_FP_INS )
00020         test_fail( __FILE__, __LINE__, "Wrong preset returned", retval );
00021 
00022     retval = PAPI_event_name_to_code( "PAPI_TOT_CYC", &preset );
00023     if ( retval != PAPI_OK )
00024         test_fail( __FILE__, __LINE__, "PAPI_event_name_to_code", retval );
00025     if ( preset != PAPI_TOT_CYC )
00026         test_fail( __FILE__, __LINE__,
00027                    "*preset returned did not equal PAPI_TOT_CYC", retval );
00028 
00029     test_pass( __FILE__, NULL, 0 );
00030     exit( 1 );
00031 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines