/usr/share/doc/papi-examples/ctests/version.c is in papi-examples 5.3.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | /* This file performs the following test: compare and report versions from papi.h and the papi library */
#include "papi_test.h"
extern int TESTS_QUIET; /* Declared in test_utils.c */
int
main( int argc, char **argv )
{
int retval, init_version, lib_version;
tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
init_version = PAPI_library_init( PAPI_VER_CURRENT );
if ( init_version != PAPI_VER_CURRENT )
test_fail( __FILE__, __LINE__, "PAPI_library_init", init_version );
if ( ( lib_version =
PAPI_get_opt( PAPI_LIB_VERSION, NULL ) ) == PAPI_EINVAL )
test_fail( __FILE__, __LINE__, "PAPI_get_opt", PAPI_EINVAL );
if ( !TESTS_QUIET ) {
printf
( "Version.c: Compare and report versions from papi.h and the papi library.\n" );
printf
( "-------------------------------------------------------------------------\n" );
printf( " MAJOR MINOR REVISION\n" );
printf
( "-------------------------------------------------------------------------\n" );
printf( "PAPI_VER_CURRENT : %4d %6d %7d\n",
PAPI_VERSION_MAJOR( PAPI_VER_CURRENT ),
PAPI_VERSION_MINOR( PAPI_VER_CURRENT ),
PAPI_VERSION_REVISION( PAPI_VER_CURRENT ) );
printf( "PAPI_library_init: %4d %6d %7d\n",
PAPI_VERSION_MAJOR( init_version ),
PAPI_VERSION_MINOR( init_version ),
PAPI_VERSION_REVISION( init_version ) );
printf( "PAPI_VERSION : %4d %6d %7d\n",
PAPI_VERSION_MAJOR( PAPI_VERSION ),
PAPI_VERSION_MINOR( PAPI_VERSION ),
PAPI_VERSION_REVISION( PAPI_VERSION ) );
printf( "PAPI_get_opt : %4d %6d %7d\n",
PAPI_VERSION_MAJOR( lib_version ),
PAPI_VERSION_MINOR( lib_version ),
PAPI_VERSION_REVISION( lib_version ) );
printf
( "-------------------------------------------------------------------------\n" );
}
if ( lib_version != PAPI_VERSION )
test_fail( __FILE__, __LINE__, "Version Mismatch", PAPI_EINVAL );
test_pass( __FILE__, NULL, 0 );
exit( 1 );
}
|