Пример #1
0
GLDEF_C void CallTestsL(void)
//
// Do all tests
//
	{

	TBuf<64> b;

	TFileName sessionPath;

	TInt r=TheFs.SessionPath(sessionPath);
	test_KErrNone(r);
	TChar driveLetter=sessionPath[0];
	b.Format(_L("Testing filesystem on %c:"),(TText)driveLetter);
	test.Next(b);

	CreateUidTestFiles();
	Test1();
	Test2();
	Test3();
	Test4();

	test.Next(_L("Testing filesystem on Z:"));
	TRAP(r,TestZ());
	if (r!=KErrNone)
		test.Printf(_L("Error: %d\n"),r);
	}
Пример #2
0
/*----------------------------------------------------------------------
|       main
+---------------------------------------------------------------------*/
int
main(int argc, char** argv) 
{
    NPT_COMPILER_UNUSED(argc);
    NPT_COMPILER_UNUSED(argv);

#if defined(WIN32) && defined(_DEBUG)
    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF    |
                   _CRTDBG_CHECK_ALWAYS_DF |
                   _CRTDBG_LEAK_CHECK_DF);
    _CrtSetAllocHook(AllocHook);
#endif
    
    TestSharedVariables();
    TestPrio();
    Test3(100000, 0.0f, 0.0f);
    Test3(300, 0.1f, 0.0f);
    Test3(100, 0.5f, 0.4f);
    Test4();
    Test1();
    Test2();

    NPT_Debug("- program done -\n");

    return 0;
}
Пример #3
0
int main (void)
{
    unsigned long T;

    /* Show info at start */
    ShowInfo ();

    /* Remember the time */
    T = clock ();

    /* Do the tests */
    Test1 ();
    Test2 ();
    Test3 ();
    Test4 ();
    Test5 ();
    Test6 ();

    /* Calculate the time and print it */
    T = clock () - T;
    printf ("Time needed: %lu ticks\n", T);

    /* Done */
    return EXIT_SUCCESS;
}
Пример #4
0
void Test::RunTests()
{
	Test1();
	Test2a();
	Test2b();
	Test3a();
	Test3b();
	Test4();
	Test5();
	Test6a();
	Test6b();
	Test7a();
	Test7b();
	Test8a();
	Test8b();
	Test9a();
	Test9b();
	Test10a();
	Test10b();
	Test11a();
	Test11b();
	Test12a();
	Test12b();
	Test13();
	Test14();
	Test15a();
	Test15b();
	Test16();
	Test17();
	Test18();
}
Пример #5
0
int main(int argc,char **argv)
{
	Test1();
	Test2();
	Test3();
	Test4();
	Test5();
}
int main(int argc, char* argv[])
{
    Test1();
    Test2();
    Test3();
    Test4();

    return 0;
}
int main()
{
	Test1();
	Test2();
	Test3();
	Test4();

	return 0;
}
Пример #8
0
int _tmain(int argc, _TCHAR* argv[])
{
    Test1();
    Test2();
    Test3();
    Test4();

    return 0;
}
int main(int argc, char* argv[])
{
    Test1();
    Test2();
    Test3();
    Test4();
    Test5();
    Test6();
}
Пример #10
0
int main()
{
	//Test1();
	//Test2();
	//Test3();
	Test4();
	system("pause");
	return 0;
}
Пример #11
0
int main()
{
	w.SetTimeScale(TimeScale::MILLI);
	// Test suites
	Test1();
	Test2();
	Test3();
	Test4();
	return 0;
}
Пример #12
0
int
main(void)
{
	Test0();
	Test1();
	Test2();
	Test3();
#ifdef CLONE_THREAD
	Test4();
#endif       
        exit(0);
}
Пример #13
0
int main(int agrc, char* argv[])
{
    Test1();
    Test2();
    Test3();
    Test4();
    Test5();
    Test6();
    Test7();
    
    return 0;
}
HRESULT CTestMessageHandler::Run()
{
    
    HRESULT hr = S_OK;

    Chk(Test1());
    Chk(Test2());
    Chk(Test3());
    Chk(Test4());
    
Cleanup:
    return hr;
}
Пример #15
0
int main(int, char** argv)
{
    verbose = getenv("PEGASUS_TEST_VERBOSE") ? true : false;

    Test1();
    Test2();
    Test3();
    Test4();

    cout << argv[0] << " +++++ passed all tests" << endl;

    return(0);
}
Пример #16
0
GLDEF_C void CallTestsDefaultL(TInt aDrive)
//
// Call tests that may leave
//
	{
	Test0(test);
	Test1();		
	Test2();
	Test3();
	Test4();
	Test5();
	MultipleSessions(aDrive,test);
	}
Пример #17
0
int main()
{
    Test1();
    Test2();
    Test3();
    Test4();
    Test5();
    Test6();
    Test7();
    Test8();

    return 0;
}
Пример #18
0
// constructor
Test::Test()
{
    Test1();
    Test2();
    Test3();
    Test4();
    Test5();
    Test6();
    Test7();
    Test8();
    Test9();
    Test10();
    Test11();
}
int main(int argc, char* argv[])
{
    Test1();
    Test2();
    Test3();
    Test4();
    Test5();
    Test6();
    Test7();
    Test8();
    Test9();
    Test10();
        
    return 0;
}
Пример #20
0
int _tmain(int argc, _TCHAR* argv[])
{
    Test1();
    Test2();
    Test3();
    Test4();
    Test5();
    Test6();
    Test7();
    Test8();
    Test9();
    Test10();
    Test11();

    return 0;
}
Пример #21
0
void DLCSystemTests::NextTest()
{
	needNextTest = false;

    delete DLCSystem::Instance();

    switch ( state )
    {
        case TEST_1:
            Logger::Debug( " TEST 1 = %s", (isSucsess) ? "Success" : "Fail" );
            Test2();
            break;
        case TEST_2:
            Logger::Debug( " TEST 2 = %s", (isSucsess) ? "Success" : "Fail" );
            Test3();
            break;
        case TEST_3:
            Logger::Debug( " TEST 3 = %s", (isSucsess) ? "Success" : "Fail" );
            Test4();
            break;
        case TEST_4:
            Logger::Debug( " TEST 4 = %s", (isSucsess) ? "Success" : "Fail" );
            Test5();
            break;
        case TEST_5:
            Logger::Debug( " TEST 5 = %s", (isSucsess) ? "Success" : "Fail" );
            Test6();
            break;
        case TEST_6:
            Logger::Debug( " TEST 6 = %s", (isSucsess) ? "Success" : "Fail" );
            Test7();
            break;
        case TEST_7:
            Logger::Debug( " TEST 7 = %s", (isSucsess) ? "Success" : "Fail" );
            Test8();
            break;
        case TEST_8:
            Logger::Debug( " TEST 8 = %s", (isSucsess) ? "Success" : "Fail" );
			isFinished = true;

//            FileSystem::Instance()->DeleteDirectory( FileSystem::Instance()->SystemPathForFrameworkPath( std::string( "~doc:/downloads/" ) ) );
            break;
        default:
            break;
    }
}
Пример #22
0
void DLCSystemTests::NextTest()
{
	needNextTest = false;

    delete DLCSystem::Instance();

    switch ( state )
    {
        case TEST_1:
            Logger::Debug( " TEST 1 = %s", (isSucsess) ? "Success" : "Fail" );
            Test2();
            break;
        case TEST_2:
            Logger::Debug( " TEST 2 = %s", (isSucsess) ? "Success" : "Fail" );
            Test3();
            break;
        case TEST_3:
            Logger::Debug( " TEST 3 = %s", (isSucsess) ? "Success" : "Fail" );
            Test4();
            break;
        case TEST_4:
            Logger::Debug( " TEST 4 = %s", (isSucsess) ? "Success" : "Fail" );
            Test5();
            break;
        case TEST_5:
            Logger::Debug( " TEST 5 = %s", (isSucsess) ? "Success" : "Fail" );
            Test6();
            break;
        case TEST_6:
            Logger::Debug( " TEST 6 = %s", (isSucsess) ? "Success" : "Fail" );
            Test7();
            break;
        case TEST_7:
            Logger::Debug( " TEST 7 = %s", (isSucsess) ? "Success" : "Fail" );
            Test8();
            break;
        case TEST_8:
            Logger::Debug( " TEST 8 = %s", (isSucsess) ? "Success" : "Fail" );
			isFinished = true;

            break;
        default:
            break;
    }
}
Пример #23
0
int main(int argc, char * argv[])
{
    int which;

    emInitLocale();
    emEnableDLog();

    if (argc>=2) which=atoi(argv[1]);
    else which=-1;

    if (which<0 || which==1) Test1();
    if (which<0 || which==2) Test2();
    if (which<0 || which==3) Test3();
    if (which<0 || which==4) Test4();
    if (which<0 || which==5) Test5();
    if (which<0 || which==6) Test6();

    printf("Success\n");
    return 0;
}
Пример #24
0
Файл: main.c Проект: taysom/tau
int main(int argc, char *argv[]) {
	Print = false;
	offDump();
	offNode();
	if (true) Test1();
	if (true) Test2();
	if (true) Test3();
	if (true) Test4();
	if (true) Test5();
	if (true) Test6();
	if (true) Test7();
	if (true) Test8();
	if (true) Test9();
	if (true) Test10();
	if (true) Test11();
	if (true) Test12();
	if (true) Test13();
	if (true) Test14();
	if (true) Test15();
	return 0;
}
Пример #25
0
GLDEF_C void TestTDes<T,S,L,R>::test_TPtr()
//
//	Test the TPtr class special member functions
//
	{

 	test.Start(_L("Invariant for null pointer descriptor"));
 	TestP();
	test.Next(_L("R/W view over buffer with length & maxlength"));
	Test4();
	test.Next(_L("R/W view over buffer with maxlength"));
	Test5();
//	Skipped the following test because Colly hasn't
//	written the templates yet for the TBufC8 & 16 classes
//	test.Next(_L("R/W view over LcbBase with maxlength"));
//	Test6();
	test.Next(_L("String assignment"));
	TestA();
	test.Next(_L("DesW assignment"));
	TestB();
	test.Next(_L("DesC assignment"));
	TestC();
	}
Пример #26
0
bool
TestDataStructuresChild::RecvStart()
{
    puts("[TestDataStructuresChild] starting");

    Test1();
    Test2();
    Test3();
    Test4();
    Test5();
    Test6();
    Test7_0();
    Test7();
    Test8();
    Test9();
    Test10();
    Test11();
    Test12();
    Test13();
    Test14();
    Test15();
    Test16();
    Test17();
    if (OtherProcess() != 0) {
        //FIXME/bug 703317 allocation of nsIntRegion uses a global
        //region pool which breaks threads
        Test18();
    }

    for (uint32_t i = 0; i < nactors; ++i)
        if (!PTestDataStructuresSubChild::Send__delete__(mKids[i]))
            fail("can't send dtor");

    Close();

    return true;
}
int main(int argc, char **argv)
{
    RT_NOREF_PV(argv);
    int rc = RTTestInitAndCreate("tstRTCritSectRw", &g_hTest);
    if (rc)
        return 1;
    RTTestBanner(g_hTest);

    if (Test1())
    {
        RTCPUID cCores = RTMpGetOnlineCoreCount();
        if (argc == 1)
        {
            TestNegative();

            /*    threads, seconds, writePercent,  yield,  quiet */
            Test4(      1,       1,            0,   true,  false);
            Test4(      1,       1,            1,   true,  false);
            Test4(      1,       1,            5,   true,  false);
            Test4(      2,       1,            3,   true,  false);
            Test4(     10,       1,            5,   true,  false);
            Test4(     10,      10,           10,  false,  false);

            if (cCores > 1)
            {
                RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "benchmarking (%u CPU cores)...\n", cCores);
                for (unsigned cThreads = 1; cThreads < 32; cThreads++)
                Test4(cThreads,  2,            1,  false,   true);
            }
            else
                RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "skipping benchmarking (only %u core available)\n", cCores);

            /** @todo add a testcase where some stuff times out. */
        }
        else
        {
            if (cCores > 1)
            {
                /*    threads, seconds, writePercent,  yield,  quiet */
                RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "benchmarking (%u CPU cores)...\n", cCores);
                Test4(      1,       3,            1,  false,   true);
                Test4(      1,       3,            1,  false,   true);
                Test4(      1,       3,            1,  false,   true);
                Test4(      2,       3,            1,  false,   true);
                Test4(      2,       3,            1,  false,   true);
                Test4(      2,       3,            1,  false,   true);
                Test4(      3,       3,            1,  false,   true);
                Test4(      3,       3,            1,  false,   true);
                Test4(      3,       3,            1,  false,   true);
            }
            else
                RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "skipping benchmarking (only %u core available)\n", cCores);
        }
    }

    return RTTestSummaryAndDestroy(g_hTest);
}
Пример #28
0
/*----------------------------------------------------------------------
|   main
+---------------------------------------------------------------------*/
int
main(int argc, char** argv)
{
    NPT_COMPILER_UNUSED(argc);
    
    NPT_HttpRequestHandler* handler;
    NPT_Reference<NPT_DataBuffer> buffer;
    bool result;

    /* parse command line */
    ParseCommandLine(argv);

    /* create http server */
    PLT_HttpServer http_server(Options.port?Options.port:8089);
    NPT_String url;

    if (!Options.path.IsEmpty()) {
        /* extract folder path */
        int index1 = Options.path.ReverseFind('\\');
        int index2 = Options.path.ReverseFind('/');
        if (index1 <= 0 && index2 <=0) {
            fprintf(stderr, "ERROR: invalid path\n");
            exit(1);
        }

        NPT_FileInfo info;
        NPT_CHECK_SEVERE(NPT_File::GetInfo(Options.path, &info));

        /* add file request handler */
        handler = new NPT_HttpFileRequestHandler(
            Options.path.Left(index1>index2?index1:index2), 
            "/");
        http_server.AddRequestHandler(handler, "/", true);

        /* build url */
        url = "/" + Options.path.SubString((index1>index2?index1:index2)+1);
    } else {
        /* create random garbage data */
        buffer = new NPT_DataBuffer(32768);
        buffer->SetDataSize(32768);

        /* add static handler */
        handler = new NPT_HttpStaticRequestHandler(buffer->GetData(),
            buffer->GetDataSize(),
            "application/octet-stream");
        http_server.AddRequestHandler(handler, "/test");

        /* build url */
        url = "/test";
    }

    /* add custom handler */
    PLT_RingBufferStreamReference ringbuffer_stream(new PLT_RingBufferStream());
    NPT_InputStreamReference stream(ringbuffer_stream);
    NPT_HttpRequestHandler* custom_handler = new PLT_HttpCustomRequestHandler(stream, "text/xml");
    http_server.AddRequestHandler(custom_handler, "/custom");
    
    /* start server */
    NPT_CHECK_SEVERE(http_server.Start());

    /* a task manager for the tests downloader */
    PLT_TaskManager task_manager;

    /* small delay to let the server start */
    NPT_System::Sleep(NPT_TimeInterval(1.f));
    
    /* execute tests */
    NPT_Size size;
    NPT_COMPILER_UNUSED(size);
    
#ifdef TEST1
    result = Test1(&task_manager, NPT_HttpUrl("127.0.0.1", http_server.GetPort(), url), size);
    if (!result) return -1;
#endif
    
#ifdef TEST2
    result = Test2(&task_manager, NPT_HttpUrl("127.0.0.1", http_server.GetPort(), url), size);
    if (!result) return -1;
#endif
    
#ifdef TEST3
    result = Test3(&task_manager, NPT_HttpUrl("127.0.0.1", http_server.GetPort(), "/custom"), ringbuffer_stream, size);
    if (!result) return -1;
#endif
    
#ifdef TEST4
    result = Test4(&task_manager, NPT_HttpUrl("127.0.0.1", http_server.GetPort(), "/custom"), NPT_TimeInterval(.1f));
    if (!result) return -1;
    
    result = Test4(&task_manager, NPT_HttpUrl("127.0.0.1", http_server.GetPort(), "/custom"), NPT_TimeInterval(1.f));
    if (!result) return -1;
    
    result = Test4(&task_manager, NPT_HttpUrl("127.0.0.1", http_server.GetPort(), "/custom"), NPT_TimeInterval(2.f));
    if (!result) return -1;
#endif
    
#ifdef TEST5
    result = Test5(NPT_HttpUrl("127.0.0.1", http_server.GetPort(), "/test"));
    if (!result) return -1;
#endif
    
    NPT_System::Sleep(NPT_TimeInterval(1.f));
    
    // abort server tasks that are waiting on ring buffer stream
    ringbuffer_stream->Abort();
    
    http_server.Stop();
    
    return 0;
}
Пример #29
0
int main(int argc, char **argv)
{
    int rc = RTTestInitAndCreate("tstRTSemRW", &g_hTest);
    if (rc)
        return 1;
    RTTestBanner(g_hTest);

    if (Test1())
    {
        if (argc == 1)
        {
            Test2();
            Test3();

            /*    threads, seconds, writePercent,  yield,  quiet */
            Test4(      1,       1,            0,   true,  false);
            Test4(      1,       1,            1,   true,  false);
            Test4(      1,       1,            5,   true,  false);
            Test4(      2,       1,            3,   true,  false);
            Test4(     10,       1,            5,   true,  false);
            Test4(     10,      10,           10,  false,  false);

            RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "benchmarking...\n");
            for (unsigned cThreads = 1; cThreads < 32; cThreads++)
                Test4(cThreads,  2,            1,  false,   true);

            /** @todo add a testcase where some stuff times out. */
        }
        else
        {
            /*    threads, seconds, writePercent,  yield,  quiet */
            RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "benchmarking...\n");
            Test4(      1,       3,            1,  false,   true);
            Test4(      1,       3,            1,  false,   true);
            Test4(      1,       3,            1,  false,   true);
            Test4(      2,       3,            1,  false,   true);
            Test4(      2,       3,            1,  false,   true);
            Test4(      2,       3,            1,  false,   true);
            Test4(      3,       3,            1,  false,   true);
            Test4(      3,       3,            1,  false,   true);
            Test4(      3,       3,            1,  false,   true);
        }
    }

    return RTTestSummaryAndDestroy(g_hTest);
}
Пример #30
0
TInt E32Main()
	{
	TInt r;
	test.Title();
	test.Start(_L("Starting T_DENYCLAMP ..."));
	test(TheFs.Connect()==KErrNone);

	GetDriveLetters();
	TBuf<256> pathName;	

	//************************************************************************
	//
	// Test on FAT (writable file system)
	//
	//************************************************************************
	if(NandFatDrv!='?')
		{
		pathName=_L("?:\\CLAMP-TST\\");	// FAT on NAND
		pathName[0]=(TText)NandFatDrv;
		r=TheFs.MkDirAll(pathName);
		test(r==KErrNone || r== KErrAlreadyExists);
		TheFs.SetSessionPath(pathName);
		test.Printf( _L("T_DENYCLAMP: testing FAT drive on %C\n"),(TText)NandFatDrv);

		Test1();		// Basic clamp operation
		Test2();		// Invalid clamp requests
//		Test3(pathName);// Denied FS requests when files are clamped - invalid for T_DENYCLAMP

		r=TheFs.RmDir(pathName);
		test(r==KErrNone);
		}
	else
		test.Printf( _L("T_DENYCLAMP: FAT drive not tested\n"));

	//************************************************************************
	//
	// Test on ROFS (non-writable file system) 
	//
	//************************************************************************
	if(RofsDrv!='?')
		{
		pathName=_L("?:\\");
		pathName[0]=(TText)RofsDrv;
		TheFs.SetSessionPath(pathName);
		test.Printf( _L("T_DENYCLAMP: testing ROFS drive on %C\n"),(TText)RofsDrv);

		Test4(pathName);	// Clamp tests for non-writable file system
		}
	else
		test.Printf( _L("T_DENYCLAMP: ROFS drive not tested\n"));

	//************************************************************************
	//
	// Test on Z: - Composite File System, or ROMFS (non-writable file system)
	//
	//************************************************************************
	if(CompDrv!='?')
		{
		pathName=_L("?:\\TEST\\");
		pathName[0]=(TText)CompDrv;
		TheFs.SetSessionPath(pathName);
		test.Printf( _L("T_DENYCLAMP: testing Z drive (on %C)\n"),(TText)CompDrv);

		Test4(pathName);	// Clamp tests for non-writable file system
		}
	else
		test.Printf( _L("T_DENYCLAMP: Z drive not tested\n"));

	//************************************************************************
	//
	// Test on LFFS (non-clampable file system)
	//
	//************************************************************************
	if(LffsDrv!='?')
		{
		TBuf<256> unsuppPath;	
		unsuppPath=_L("?:\\CLAMP-TST\\");
		unsuppPath[0]=(TText)LffsDrv;
		r=TheFs.MkDirAll(unsuppPath);
		test(r==KErrNone || r== KErrAlreadyExists);
		TheFs.SetSessionPath(unsuppPath);
		test.Printf( _L("T_DENYCLAMP: testing LFFS drive on %C\n"),(TText)LffsDrv);

		Test5();		// Clamp requests on non-clamping file systems
		}
	else
		test.Printf( _L("T_DENYCLAMP: LFFS drive not tested\n"));

	test.End();
	return 0;
	}