예제 #1
0
void main(){
	int X = 0;
	create_connect();
	set_create_distance(0);
	set_create_total_angle(0);
	enable_servos();
	armPosBlockStack1();
	clawStack1();
/*	create_drive(-500,-380);
	sleep(2.3);
	create_stop();
}
*/  
//	writeToFile();
	printf("%f",seconds());
	while(1) //black_button
	{
		if (a_button()){
			testDrive();
		}
		if (b_button()){
			testDetectPVC();
		}
		if (up_button()){
			
		}
		if (down_button()){
			testTurnAdjust();
		}
		if (left_button()){
			testTurnCCW();
		}
		if (right_button()){
			testTurnCW();
		}	
	}
}
예제 #2
0
/**
@SYMTestCaseID          PDS-SQL-UT-4224
@SYMTestCaseDesc        CSqlServer::GetBackUpListL() functional test
@SYMTestPriority        High
@SYMTestActions         Calls CSqlServer::GetBackUpListL() and tests the output, when the drive is read-only,
                        when there is a sub-directory which name is matching the search pattern.
@SYMTestExpectedResults Test must not fail
*/  
void GetBackupListFunctionalTest()
	{
    CSqlServer* server = NULL;
    TRAPD(err, server = CreateSqlServerL());
    TEST2(err, KErrNone);
    //Case 1: database with specified uid bellow do exist (on drive C). There will be one subdirectory matching the search pattern. 
    const TDriveNumber KTestDrvNum1 = EDriveC;
    const TUid KDbUid = {0x98765432};
	TDriveUnit testDrive(KTestDrvNum1);
	TDriveName testDriveName = testDrive.Name();
	testDriveName.LowerCase(); 
	//One test directory will be created, which name will be matching the search pattern.
	//The directory name should not be included in the list with the file names.
    TFileName testFileName;
    err = server->Fs().PrivatePath(testFileName);
    TEST2(err, KErrNone);
    testFileName.Append(KDbUid.Name());
    _LIT(KTestPath, "t_startup\\");
    testFileName.Append(KTestPath);
    testFileName.Append(_L("t_startup.db"));
    TParse parse;
    err = parse.Set(testFileName, &testDriveName, 0);
    TEST2(err, KErrNone);
    err = server->Fs().MkDirAll(parse.FullName());
    TEST(err == KErrNone || err == KErrAlreadyExists);
    //
    RArray<HBufC*> files;
    TRAP(err, server->GetBackUpListL(KDbUid, KTestDrvNum1, files));
    TEST2(err, KErrNone);
    TInt fileCnt = files.Count();
    for(TInt i=0;i<fileCnt;++i)
    	{
		TPtrC fname = files[i]->Des();
		TheTest.Printf(_L("Db: %S\r\n"), &fname);
		TEST(fname.FindF(KTestPath) < 0);
		//The name should include the full path + the drive
		err = parse.Set(fname, 0, 0);
		TEST2(err, KErrNone);
		TEST(parse.DrivePresent());
		TEST(parse.PathPresent());
		TDriveName driveName(parse.Drive());
		driveName.LowerCase(); 
		delete files[i];
		TEST(driveName == testDriveName);		
    	}
    files.Close();
    //Case 2: drive Z:. No files should be returned.
    const TDriveNumber KTestDrvNum2 = EDriveZ;
    TRAP(err, server->GetBackUpListL(KDbUid, KTestDrvNum2, files));
    TEST2(err, KErrNone);
    fileCnt = files.Count();
    TEST2(fileCnt, 0);
    //Case 3: drive A:. The drive does not exist. No files should be returned.
    const TDriveNumber KTestDrvNum3 = EDriveA;
    TRAP(err, server->GetBackUpListL(KDbUid, KTestDrvNum3, files));
	TheTest.Printf(_L("Drive %d, err=%d\r\n"), KTestDrvNum3, err);
    fileCnt = files.Count();
    TEST2(fileCnt, 0);
    //
    delete server;
	}