/*
 *  ======== MpuRcmClientTest ========
 */
Int MpuRcmClientTest(Int testCase)
{
    Int status = 0;

    Osal_printf ("MpuRcmClientTest: Testing RCM Client on MPU\n");

    status = ipcSetup (testCase);
    if (status < 0) {
        Osal_printf ("MpuRcmClientTest: ipcSetup failed, status [0x%x]\n");
        goto exit;
    }

    status = CreateRcmClient (testCase);
    if (status < 0) {
        Osal_printf ("MpuRcmClientTest: Error in creating RcmClient \n");
        goto exit;
    }

    status = GetSymbolIndex ();
    if (status < 0) {
        Osal_printf ("MpuRcmClientTest: Error in GetSymbolIndex \n");
        goto exit;
    }

    status = TestExec ();
    if (status < 0) {
        Osal_printf ("MpuRcmClientTest: Error in TestExec \n");
        goto exit;
    }

    /* status = TestExecDpc ();
    if (status < 0) {
        Osal_printf ("MpuRcmClientTest: Error in TestExecDpc \n");
        goto exit;
    }

    status = TestExecNoWait ();
    if (status < 0) {
        Osal_printf ("MpuRcmClientTest: Error in TestExecNoWait \n");
        goto exit;
    } */

    status = RcmClientCleanup (testCase);
    if (status < 0)
        Osal_printf ("MpuRcmClientTest: Error in RcmClientCleanup \n");

exit:
    Osal_printf ("MpuRcmClientTest: Leaving MpuRcmClientTest()\n");
    return status;
}
Beispiel #2
0
int main(int argc, char **argv)
{
    wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "execmon");

    wxInitializer initializer;
    if ( !initializer )
    {
        fprintf(stderr, "Failed to initialize the wxWidgets library, aborting.");
        return -1;
    }

    static const wxCmdLineEntryDesc cmdLineDesc[] =
    {
        { wxCMD_LINE_SWITCH, "h", "help",
            "show this help message",
            wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
        { wxCMD_LINE_OPTION, "t", "timeout",
            "kills all processes still alive after 'num' seconds",
            wxCMD_LINE_VAL_NUMBER, 0 },
        { wxCMD_LINE_PARAM, "", "",
            "program-to-run",
            wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE },

        { wxCMD_LINE_NONE }
    };

    wxLog::DisableTimestamp();

    wxCmdLineParser parser(cmdLineDesc, argc, argv);
    switch ( parser.Parse() )
    {
    case -1:
        // help was shown
        break;

    case 0:
        {
            // check arguments
            wxVector<wxFileName> programs;
            for (unsigned int i=0; i<parser.GetParamCount(); i++)
            {
                wxFileName fn(parser.GetParam(i));
                if (!fn.IsAbsolute())
                    fn.MakeAbsolute();

                programs.push_back(fn);
            }

            long timeout;
            if (!parser.Found("t", &timeout))
                timeout = 3;

            return TestExec(programs, timeout) ? 0 : 1;
        }
        break;

    default:
        // syntax error
        break;
    }

    return 0;
}
Beispiel #3
0
/**
@SYMTestCaseID			SYSLIB-SQLITE3-UT-4004
@SYMTestCaseDesc		Database handle SQLITE3 tests.
						List of called SQLITE3 functions:
						 - sqlite3_config;
						 - sqlite3_initialize;
						 - sqlite3_threadsafe;
						 - sqlite3_vfs_find;
						 - sqlite3_open;
						 - sqlite3_db_config;
						 - sqlite3_libversion;
						 - sqlite3_libversion_number;
						 - sqlite3_set_authorizer;
						 - sqlite3_commit_hook;
						 - sqlite3_rollback_hook;
						 - sqlite3_update_hook;
						 - sqlite3_close;
						 - sqlite3_shutdown;
@SYMTestPriority		High
@SYMTestActions			Database handle SQLITE3 tests.
@SYMTestExpectedResults Test must not fail
@SYMREQ					REQ8782
*/
static void TestSqliteApi()
	{
	void* prev = 0;
	const char* libverstr = 0;
	int libvernum = 0;
	int err;
	int threadSafe = -1;
	sqlite3_vfs* vfs = 0;

	TEST(!TheDb);
	
	TestStart("@SYMTestCaseID:SYSLIB-SQLITE3-UT-4004: Test \"sqlite3_config()\"");
	err = sqlite3_config(SQLITE_CONFIG_MEMSTATUS, 0);
	TEST2(err, SQLITE_OK);
	
	TestNext("Test \"sqlite3_initialize()\"");
	err = sqlite3_initialize();
	TEST2(err, SQLITE_OK);

	TestNext("Test \"sqlite3_threadsafe()\"");
	threadSafe = sqlite3_threadsafe();
	PrintI("SQLITE_THREADSAFE=%d\r\n", threadSafe);
	
	vfs = sqlite3_vfs_find(0);
	TEST(vfs != NULL);
	PrintS("Vfs name=\"%s\"\r\n", vfs->zName);
	
	err = sqlite3_open(TheTestDbName, &TheDb);
	TEST2(err, SQLITE_OK);
	TEST(TheDb != 0);
	
	err = sqlite3_db_config(TheDb, SQLITE_DBCONFIG_LOOKASIDE, 0, 128, 100);
	TEST2(err, SQLITE_OK);
	
	libverstr = sqlite3_libversion();
	libvernum = sqlite3_libversion_number();
	PrintSI("SQLITE version: \"%s\", Number: %d\r\n", libverstr, libvernum);
	
	err = sqlite3_set_authorizer(TheDb, &authorizer_callback, 0);
	TEST2(err, SQLITE_OK);
	
	prev = sqlite3_commit_hook(TheDb, &commit_hook, 0);
	TEST(!prev);
	prev = sqlite3_rollback_hook(TheDb, &rollback_hook, 0);
	TEST(!prev);
	prev = sqlite3_update_hook(TheDb, &update_hook, 0);
	TEST(!prev);
	
	TestNext("@SYMTestCaseID:SYSLIB-SQLITE3-UT-4001: Test \"sqlite3\" handle API");
	TestExec();
	TestNext("@SYMTestCaseID:SYSLIB-SQLITE3-UT-4002: Test \"sqlite3_stmt\" handle API-1");
	TestStatement1();
	TestNext("@SYMTestCaseID:SYSLIB-SQLITE3-UT-4003: Test \"sqlite3_stmt\" handle API-2");
	TestStatement2();
	TestNext("@SYMTestCaseID:PDS-SQLITE3-UT-4038: Test more sqlite3 API");
	TestSqliteApi2();
	TestNext("@SYMTestCaseID:PDS-SQLITE3-UT-4039: Test blob API");
	TestSqliteBlobApi();
	TestNext("@SYMTestCaseID:PDS-SQLITE3-UT-4040: Test mutex API");
	TestSqliteMutexApi();

	err = sqlite3_close(TheDb);
	TEST2(err, SQLITE_OK);
	TheDb = 0;
	
	TestNext("Test \"sqlite3_shutdown()\"");
	err = sqlite3_shutdown();
	TEST2(err, SQLITE_OK);
	
	err = remove(TheTestDbName);
	TEST2(err, 0);
	}