Beispiel #1
0
int main(void)
{
	testCopy();
	testCast();
	
	return 0;
}
Beispiel #2
0
int _tmain(int argc, _TCHAR* argv[])
{
	testAttorneyClient();
	testCopy();

	return 0;
}
Beispiel #3
0
void PspMemory::copy(byte *dst, const byte *src, uint32 bytes) {
	DEBUG_ENTER_FUNC();

#ifdef TEST_MEMORY_COPY
	uint32 debugBytes = bytes;
	const byte *debugDst = dst, *debugSrc = src;
#endif

	PSP_DEBUG_PRINT("copy(): dst[%p], src[%p], bytes[%d]\n", dst, src, bytes);

	// align the destination pointer first
	uint32 prefixDst = (((uint32)dst) & 0x3);

	if (prefixDst) {
		prefixDst = 4 - prefixDst;				// prefix only if we have address % 4 != 0
		PSP_DEBUG_PRINT("prefixDst[%d]\n", prefixDst);

		bytes -= prefixDst;						// remember we assume bytes >= 4

		if (bytes < MIN_AMOUNT_FOR_COMPLEX_COPY) {	// check if it's worthwhile to continue
			copy8(dst, src, bytes + prefixDst);
#ifdef TEST_MEMORY_COPY
			testCopy(debugDst, debugSrc, debugBytes);
#endif
			return;
		}

		while (prefixDst--) {
			*dst++ = *src++;
		}
	}

	// check the source pointer alignment now
	uint32 alignSrc = (((uint32)src) & 0x3);

	if (alignSrc) {						// we'll need to realign our reads
		copy32Misaligned((uint32 *)dst, src, bytes, alignSrc);
	} else {
		copy32Aligned((uint32 *)dst, (uint32 *)src, bytes);
	}

#ifdef TEST_MEMORY_COPY
	testCopy(debugDst, debugSrc, debugBytes);
#endif
}
int main(int argc, char **argv) {
	testTime();
	printf("\n");
	testClock();
	printf("\n");
	testSysTime();
	printf("\n");
	// TODO: timeofday
	testSet();
	printf("\n");
	testCopy();
	return 0;
}
Beispiel #5
0
	bool TestBTree::doTest()
	{
		if( benchmark )
		{
			doBenchmark();
			return true;
		}
		else
		{
			return testRandom() && testClear() && testIteration() 
				&& testComparisons() && testSearching() && testSwap() 
				&& testInsert() && testErase() && testCopy();
		}
	}
Beispiel #6
0
void testActions() {
  printf("== TEST ACTIONS ==\n");
  ActionProperties props(3, nActions);
  Action test(&props);
  printf("- Testing conflated\n");
  assert( test.nConflated() == 3*2*2 );
  for (action_t i=0; i<test.nConflated(); i++) {
    action_t conf = test.setConflated(i).conflated();
//    printf("action=%d confl=%d val = (%d %d %d)\n", i, conf, test[0], test[1], test[2] );
    assert( conf == i );
  }
  printf("-> PASSED\n");

  printf("- Testing iteration\n");
  test.reset();
  Q_ASSERT_ERROR(test.undefined());
  action_t i = 0;
  while (test.hasNext()) {
    test.next();
    Q_ASSERT_ERROR(! test.undefined());
    Q_ASSERT_ERROR( i < test.nConflated() );
    Q_ASSERT_ERROR( test.conflated() == i );
    i++;
  }
  printf("-> PASSED\n");

  printf("- Testing copyFrom\n");
  Action testCopy(&props);
  i = 0;
  while (test.hasNext()) {
    test.next();
    testCopy.copyFrom(test);
    Q_ASSERT_ERROR( test.conflated() == testCopy.conflated() );
    i++;
  }
  printf("-> PASSED\n");
}
Beispiel #7
0
int main()
{
	testCopy();
	getchar();
	return 0;
}