Example #1
0
int main(int argc, char **argv)
{
	int returnResult = 0;
	if (!testCalcDepthVerbose(3, 3, 2, 2, 1))
	{
		returnResult = - 1;
	}
	if (!testCalcDepthVerbose(5, 5, 2, 2, 1))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(10, 10, 2, 2, 1))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(10, 10, 5, 5, 2))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(100, 100, 3, 3, 14))
	{
		returnResult = -1;
	}

	if (!testCalcDepthVerbose(1, 20, 3, 3, 14))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(20, 1, 3, 3, 14))
	{
		returnResult = -1;
	}

	if (!testCalcDepthVerbose(10, 10, 2, 5, 1))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(10, 10, 5, 2, 2))
	{
		returnResult = -1;
	}

	if (!testCalcDepthVerbose(21, 5, 9, 5, 15))
	{
		returnResult = -1;
	}

	return returnResult;
}
Example #2
0
int main(int argc, char **argv)
{
	int returnResult = 0;
	if (!testCalcDepthVerbose(200, 100, 5, 7, 20))
	{
		returnResult = - 1;
	}
	if (!testCalcDepthVerbose(203, 103, 7, 9, 13))
	{
		returnResult = - 1;
	}
	if (!testCalcDepthVerbose(151, 151, 7, 7, 12))
	{
		returnResult = - 1;
	}
	if (!testCalcDepthVerbose(139, 125, 3, 7, 8))
	{
		returnResult = - 1;
	}
	if (!testCalcDepthVerbose(100, 100, 3, 5, 9))
	{
		returnResult = - 1;
	}
	if (!testCalcDepthVerbose(50, 51, 43, 42, 3))
	{
		returnResult = - 1;
	}


	if (!testCalcDepthVerbose(3, 3, 2, 2, 1))
	{
		returnResult = - 1;
	}
	if (!testCalcDepthVerbose(5, 5, 2, 2, 1))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(10, 10, 2, 2, 1))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(10, 10, 5, 5, 2))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(100, 100, 3, 3, 14))
	{
		returnResult = -1;
	}

	if (!testCalcDepthVerbose(1, 20, 3, 3, 14))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(20, 1, 3, 3, 14))
	{
		returnResult = -1;
	}

	if (!testCalcDepthVerbose(10, 10, 2, 5, 1))
	{
		returnResult = -1;
	}
	if (!testCalcDepthVerbose(10, 10, 5, 2, 2))
	{
		returnResult = -1;
	}

	if (!testCalcDepthVerbose(21, 5, 9, 5, 15))
	{
		returnResult = -1;
	}
	if(1 == 1) {
		for(int i = 0; i < 25; i ++) {
			int w = (rand()%200)+1;
			int h = (rand()%200)+1;
			int fw = (rand()%15);
			int fh = (rand()%15);
			int disp = (rand()%10);
			if(!testCalcDepthVerbose(w, h, fw, fh, disp)){
				returnResult = -1;
			}
		}
	}


	return returnResult;
}