Пример #1
0
/*
** main function runs all the tests
*/
int main (void)
{

  /* Initialize UnitTest */
  UT_Init("ut_cfe_evs");


  /* Test_Init is a test but also MUST be called 1st and only once */
  Test_Init();

  Test_IllegalAppID();

  Test_UnregisteredApp();

  Test_FilterRegistration();

  Test_FilterReset();
  Test_Format();
  Test_Ports();
  Test_Logging();
  Test_WriteApp();
  Test_BadAppCmd();
  Test_EventCmd();
  Test_FilterCmd();
  Test_Misc();

  /* Final report on number of errors */
  UT_ReportFailures();

  exit(0);

}
Пример #2
0
int main( int argc, char **argv)
{
    int rank; /* My Rank (0 or 1) */
    int act_size = 0;
    int flag, np, rval, i;
    int buffer[SIZE];
    double t0;
    char *Current_Test = NULL;
    MPI_Status status, status1, status2;
    int count1, count2;
    int sizes[4];

    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_Comm_size( MPI_COMM_WORLD, &np );
    if (np != 2) {
        fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
        MPI_Abort( MPI_COMM_WORLD, 1 );
        }

    sizes[0] = 0;
    sizes[1] = 1;
    sizes[2] = 1000;
    sizes[3] = SIZE;
/*    for (i = 0; i < 4; i++ ) { */
    for (i = 1; i < 2; i++ ) {
	act_size = sizes[i];
        if (rank == src) { 
            Generate_Data(buffer, SIZE);
            MPI_Recv( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD, &status );
            MPI_Send( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD );
            MPI_Ssend( buffer, act_size, MPI_INT, dest, 1, MPI_COMM_WORLD );
            MPI_Ssend( buffer, act_size, MPI_INT, dest, 2, MPI_COMM_WORLD );
            
        } else if (rank == dest) {
            Test_Init("ssendtest", rank);
            /* Test 1 */
            Current_Test = (char*)"Ssend Test (Synchronous Send -> Normal Recieve)";
            MPI_Send( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD );
            MPI_Recv( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD, &status );
            t0 = MPI_Wtime();
            flag = 0;
	    /* This test depends on a working wtime.  Make a simple check */
	    if (t0 == 0 && MPI_Wtime() == 0) {
		int loopcount = 1000000;
		/* This test is too severe (systems with fast 
		   processors and large MPI_Wtick values can 
		   fail.  Try harder to test MPI_Wtime */
		while (loopcount-- && MPI_Wtime() == 0) ;
		if (loopcount <= 0) {
		    fprintf( stderr, 
			     "MPI_WTIME is returning 0; a working value is needed\n\
for this test.\n" );
		    Test_Failed(Current_Test);
		    MPI_Abort( MPI_COMM_WORLD, 1 );
		}
		t0 = MPI_Wtime();
	    }
Пример #3
0
/*******************************************************************************
  函数名:  	main
功能说明:	主函数
	参数:  	无
  返回值:  	无
*******************************************************************************/
int main(void)
{
	Thread_Init();
	SysHard_Init();		//系统相关硬件初始化
	WDG_Init(5,2000);
	FIFOInit();			//初始化队列缓冲区
	Instruct_Init();
	DeviceResetCheck_Init();
	Test_Init();
	Unit_Init();
		            
	while(1)
	{
		Process_FIFOData(&rcv433fifo, &rcv_433); 		//处理接收FIFO	
		Process_FIFOData(&rcv433_shortfifo, &rcv_433short); 		//处理接收FIFO		
		Thread_Process();
	}
}
Пример #4
0
/*******************************************************************************
  函数名:  	main
  功能说明:	主函数
  参    数:  	无
  返回值:  	无
*******************************************************************************/
int main(void)
{
	Key_Init();
	KeyLowPowerHandle();
	Thread_Init();	
 	SysHard_Init();		//系统相关硬件初始化        
	FIFOInit();			//初始化队列缓冲区
	Instruct_Init();
	DeviceResetCheck_Init();
	Test_Init();
	Unit_Init();
	KeyTimer_Init();
	
	while(1)
	{
		Process_FIFOData(&rcv433fifo, &rcv_433); 		//处理接收FIFO	
		Thread_Process();      
	}
}
Пример #5
0
END_TEST

/**
 * @brief Test entry point.
 */
int32_t main(int32_t argc, char **argv) {

	Test_Init(argc, argv);

	TCase *tcase = tcase_create("check_r_media");
	tcase_add_checked_fixture(tcase, setup, teardown);

	tcase_add_test(tcase, check_R_RegisterMedia);

	Suite *suite = suite_create("check_r_media");
	suite_add_tcase(suite, tcase);

	int32_t failed = Test_Run(suite);

	Test_Shutdown();
	return failed;
}
Пример #6
0
/**Function*************************************************************

  Synopsis    [Starts all the packages.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Abc_FrameInit( Abc_Frame_t * pAbc )
{
    Cmd_Init( pAbc );
    Cmd_CommandExecute( pAbc, "set checkread" ); 
    Io_Init( pAbc );
    Abc_Init( pAbc );
    Fpga_Init( pAbc );
    Map_Init( pAbc );
    Mio_Init( pAbc );
    Super_Init( pAbc );
    Libs_Init( pAbc );
    Load_Init( pAbc );
    Scl_Init( pAbc );
    Test_Init( pAbc );
#ifdef USE_ABC2
    Abc2_Init( pAbc );
#endif
#ifdef USE_ABC85
    Abc85_Init( pAbc );
#endif
    EXT_ABC_INIT(pAbc) // plugin for external functionality
}
Пример #7
0
} END_TEST

/**
 * @brief Test entry point.
 */
int32_t main(int32_t argc, char **argv) {

	Test_Init(argc, argv);

	TCase *tcase = tcase_create("check_mem");
	tcase_add_checked_fixture(tcase, setup, teardown);

	tcase_add_test(tcase, check_Mem_LinkMalloc);
	tcase_add_test(tcase, check_Mem_CopyString);

	Suite *suite = suite_create("check_mem");
	suite_add_tcase(suite, tcase);

	int32_t failed = Test_Run(suite);

	Test_Shutdown();
	return failed;
}
Пример #8
0
	}END_TEST

/*
 * @brief Test entry point.
 */
int32_t main(int32_t argc, char **argv) {

	Test_Init(argc, argv);

	TCase *tcase = tcase_create("check_master");
	tcase_add_checked_fixture(tcase, setup, teardown);

	tcase_add_test(tcase, check_Ms_AddServer);
	tcase_add_test(tcase, check_Ms_BlacklistServer);

	Suite *suite = suite_create("check_master");
	suite_add_tcase(suite, tcase);

	int32_t failed = Test_Run(suite);

	Test_Shutdown();
	return failed;
}
Пример #9
0
	}END_TEST

/*
 * @brief Test entry point.
 */
int32_t main(int32_t argc, char **argv) {

	Test_Init(argc, argv);

	TCase *tcase = tcase_create("check_filesystem");
	tcase_add_checked_fixture(tcase, setup, teardown);

	tcase_add_test(tcase, check_Fs_OpenRead);
	tcase_add_test(tcase, check_Fs_OpenWrite);
	tcase_add_test(tcase, check_Fs_LoadFile);

	Suite *suite = suite_create("check_filesystem");
	suite_add_tcase(suite, tcase);

	int32_t failed = Test_Run(suite);

	Test_Shutdown();
	return failed;
}
Пример #10
0
int
main( int argc, char **argv)
{
    int rank, size, i, recv_flag, ret, passed;
    MPI_Status Status;
    char message[17];
    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_Comm_size(MPI_COMM_WORLD, &size);

    if (rank == 0) {
	Test_Init("barrier", rank);
	/* Receive the startup messages from each of the 
	   other clients */
	for (i = 0; i < size - 1; i++) {
	    MPI_Recv(message, 17, MPI_CHAR, MPI_ANY_SOURCE, 2000, 
		     MPI_COMM_WORLD, &Status);
	}

	/* Now use Iprobe to make sure no more messages arive for a
	    while */
	passed = 1;
	for (i = 0; i < WAIT_TIMES; i++){
	    recv_flag = 0;
	    MPI_Iprobe(MPI_ANY_SOURCE, 2000, MPI_COMM_WORLD, 
		       &recv_flag, &Status);
	    if (recv_flag)
		passed = 0;
	}

	if (passed)
	    Test_Passed("Barrier Test 1");
	else
	    Test_Failed("Barrier Test 1");

	/* Now go into the barrier myself */
	MPI_Barrier(MPI_COMM_WORLD);

	/* And get everyones message who came out */
	for (i = 0; i < size - 1; i++) {
	    MPI_Recv(message, 13, MPI_CHAR, MPI_ANY_SOURCE, 2000, 
		     MPI_COMM_WORLD, &Status);
	}

	/* Now use Iprobe to make sure no more messages arive for a
	    while */
	passed = 1;
	for (i = 0; i < WAIT_TIMES; i++){
	    recv_flag = 0;
	    MPI_Iprobe(MPI_ANY_SOURCE, 2000, MPI_COMM_WORLD, 
		       &recv_flag, &Status);
	    if (recv_flag)
		passed = 0;
	}
	if (passed)
	    Test_Passed("Barrier Test 2");
	else
	    Test_Failed("Barrier Test 2");

	Test_Waitforall( );
	ret = Summarize_Test_Results();
	Test_Finalize();
	MPI_Finalize();
	return ret;
    } else {
	MPI_Send((char*)"Entering Barrier", 17, MPI_CHAR, 0, 2000, MPI_COMM_WORLD);
	MPI_Barrier(MPI_COMM_WORLD);
	MPI_Send((char*)"Past Barrier", 13, MPI_CHAR, 0, 2000, MPI_COMM_WORLD);
	Test_Waitforall( );
	MPI_Finalize();
	return 0;
    }
}
Пример #11
0
int main( int argc, char **argv)
{
    int rank; /* My Rank (0 or 1) */
    int act_size = 0;
    int flag, np, rval, i;
    int buffer[SIZE];
    double t0;
    char *Current_Test = NULL;
    MPI_Status status, status1, status2;
    int count1, count2;
    int sizes[4];

    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_Comm_size( MPI_COMM_WORLD, &np );
    /*if (np != 2) {
        fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
        MPI_Abort( MPI_COMM_WORLD, 1 );
        }*/

    sizes[0] = 0;
    sizes[1] = 1;
    sizes[2] = 1000;
    sizes[3] = SIZE;
/*    for (i = 0; i < 4; i++ ) { */
    for (i = 1; i < 2; i++ ) {
	act_size = sizes[i];
        if (rank == src) { 
            Generate_Data(buffer, SIZE);
            MPI_Recv( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD, &status );
            MPI_Send( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD );
            MPI_Ssend( buffer, act_size, MPI_INT, dest, 1, MPI_COMM_WORLD );
            MPI_Ssend( buffer, act_size, MPI_INT, dest, 2, MPI_COMM_WORLD );
            
        } else if (rank == dest) {
            Test_Init("ssendtest", rank);
            /* Test 1 */
            Current_Test = "Ssend Test (Synchronous Send -> Normal Recieve)";
            MPI_Send( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD );
            MPI_Recv( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD, &status );
            t0 = MPI_Wtime();
            flag = 0;
	    /* This test depends on a working wtime.  Make a simple check */
	    if (t0 == 0 && MPI_Wtime() == 0) {
		fprintf( stderr, 
		 "MPI_WTIME is returning 0; a working value is needed\n\
for this test.\n" );
		Test_Failed(Current_Test);
		fprintf( stderr, "[%i] Aborting\n",rank );fflush(stderr);
		MPI_Abort( MPI_COMM_WORLD, 1 );
	    }
            while (MPI_Wtime() - t0 < MAX_TIME) {
                MPI_Iprobe( src, 2, MPI_COMM_WORLD, &flag, &status );
                if (flag) {
                    Test_Failed(Current_Test);
                    break;
                    }
                }
            if (!flag) 
                Test_Passed(Current_Test);
            MPI_Recv( buffer, act_size, MPI_INT, src, 1, MPI_COMM_WORLD, 
                     &status1 );
            MPI_Recv( buffer, act_size, MPI_INT, src, 2, MPI_COMM_WORLD, 
                     &status2 );
            
            MPI_Get_count( &status1, MPI_INT, &count1 );
            MPI_Get_count( &status2, MPI_INT, &count2 );
            if (count1 != act_size) {
                fprintf( stdout, 
                        "(1) Wrong count from recv of ssend: got %d (%d)\n", 
                        count1, act_size );
                }
            if (status1.MPI_TAG != 1) {
                fprintf( stdout, "(1) Wrong tag from recv of ssend: got %d\n", 
                        status1.MPI_TAG );
                }
            if (count2 != act_size) {
                fprintf( stdout, 
                        "(2) Wrong count from recv of ssend: got %d (%d)\n", 
                        count1, act_size );
                }
            if (status2.MPI_TAG != 2) {
                fprintf( stdout, "(2) Wrong tag from recv of ssend: got %d\n", 
                        status2.MPI_TAG );
                }

            }
Пример #12
0
int main( int argc, char **argv )
{
    int rank, size, ret, passed, i, *test_array;
    int stride, count, root;
    MPI_Datatype newtype;
    MPI_Comm     comm = MPI_COMM_WORLD;

    /* Set up MPI */
    MPI_Init(&argc, &argv);
    MPI_Comm_rank(comm, &rank);

    /* Setup the tests */
    Test_Init("bcastvec", rank);

    /* Allow for additional communicators */
    MPI_Comm_size(comm, &size);
    /* MPI_Comm_rank(comm, &rank); */
    stride = (rank + 1);
    test_array = (int *)malloc(size*stride*sizeof(int));

    /* Create the vector datatype EXCEPT for process 0 (vector of
       stride 1 is contiguous) */
    if (rank > 0) {
        count = 1;
        MPI_Type_vector( size, 1, stride, MPI_INT, &newtype);
        MPI_Type_commit( &newtype );
    }
    else {
        count = size;
        newtype = MPI_INT;
    }

    /* Perform the test.  Each process in turn becomes the root.
       After each operation, check that nothing has gone wrong */
    passed = 1;
    for (root = 0; root < size; root++) {
        /* Fill the array with -1 for unset, rank + i * size for set */
        for (i=0; i<size*stride; i++) test_array[i] = -1;
        if (rank == root)
            for (i=0; i<size; i++) test_array[i*stride] = rank + i * size;
        MPI_Bcast( test_array, count, newtype, root, comm );
        for (i=0; i<size; i++) {
            if (test_array[i*stride] != root + i * size) {
                passed = 0;
            }
        }
    }
    free(test_array);
    if (rank != 0) MPI_Type_free( &newtype );

    if (!passed)
        Test_Failed("Simple Broadcast test with datatypes");
    else {
        if (rank == 0)
            Test_Passed("Simple Broadcast test with datatypes");
    }

    /* Close down the tests */
    if (rank == 0)
        ret = Summarize_Test_Results();
    else {
        ret = 0;
    }
    Test_Finalize();

    /* Close down MPI */
    Test_Waitforall( );
    MPI_Finalize();
    return ret;
}