예제 #1
0
파일: testBST.cpp 프로젝트: irtefa/dumbshit
//main()
int main(int argc, char** argv){
    bool is_colored = (argc > 1 && tolower(argv[1][0]) == 'c') && isatty(STDOUT_FILENO);
    colored_out coloroutput;
    if (is_colored)
    {
        coloroutput.set_expected_file("soln_testbst.out");
        int status = coloroutput.start();
        if (status < 0) return 0;
    }

    cout << "\t\t\tTESTING INSERTIONS\n\n";
    testInsert();

    cout << "\t\t\tTESTING FINDS\n\n";
    testFind();

    cout << "\t\t\tTESTING REMOVALS\n\n";
    testRemove();

    cout << "\t\t\tTESTING KEY SORT\n\n";
    testKeySort();

    cout << "\t\t\tTESTING LEVEL ORDER\n\n";
    testLevelOrder();

    return 0;
}
예제 #2
0
int main(void)
{
  testAdd();
  testRemove();

  return 0;
}
예제 #3
0
void recurse(char *path, FILE *bufferPtr)
{
    
	
	DIR *dirPtr;
	dirPtr = opendir(path); 
    
	FILE *filePtr = fopen(path,"r");
    
    
	if(dirPtr != NULL) // Non-null value means success
	{
		struct dirent *direntPtr = readdir(dirPtr);
        
		while(direntPtr != NULL)
		{
			if(strcmp(direntPtr->d_name,".") == 0)
			{
				direntPtr = readdir(dirPtr);
			}
			else if(strcmp(direntPtr->d_name,"..") == 0)
			{
				direntPtr = readdir(dirPtr);
			}
			else
			{
				char *newPath = getNewPath(path,direntPtr->d_name);
				recurse(newPath,bufferPtr);
                
				// remove the last part of the path so that the next element doesn't get it
				path = testRemove(newPath);
				direntPtr = readdir(dirPtr);
			}
		}
        
	}
	else if(filePtr != NULL)
	{
		processFile(path,bufferPtr);
		return;
	}
	else
	{
		printf("\nThere's an error\n");
	}
	
	return;
}
static void testAPI(RTTEST hTest)
{
    testMappingsQuery(hTest);
    testMappingsQueryName(hTest);
    testMapFolder(hTest);
    testUnmapFolder(hTest);
    testCreate(hTest);
    testClose(hTest);
    testRead(hTest);
    testWrite(hTest);
    testLock(hTest);
    testFlush(hTest);
    testDirList(hTest);
    testReadLink(hTest);
    testFSInfo(hTest);
    testRemove(hTest);
    testRename(hTest);
    testSymlink(hTest);
    testMappingsAdd(hTest);
    testMappingsRemove(hTest);
    /* testSetStatusLed(hTest); */
}