int main(int argc, char **argv) { int i; char temp[32]; checkpointNext("Names:"); testCreate(" Normal", "create", &testFunc, 0x20, 0x10000, 0, NULL); testCreate(" NULL name", NULL, &testFunc, 0x20, 0x10000, 0, NULL); testCreate(" Blank name", "", &testFunc, 0x20, 0x10000, 0, NULL); testCreate(" Long name", "1234567890123456789012345678901234567890123456789012345678901234", &testFunc, 0x20, 0x10000, 0, NULL); checkpointNext("Attributes:"); u32 attrs[] = {1, 0x10, 0x50, 0x100, 0x200, 0x400, 0x600, 0x800, 0xF00, 0x1000, 0x2000, 0x4000, 0x8000, 0x6000, 0xF000, 0x10000, 0x20000, 0x40000, 0x80000, 0xF0000, 0x100000, 0x200000, 0x400000, 0x800000, 0xF00000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0xF000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xF0000000}; for (i = 0; i < sizeof(attrs) / sizeof(attrs[0]); ++i) { sprintf(temp, " 0x%x attr", attrs[i]); testCreate(temp, "create", &testFunc, 0x20, 0x10000, attrs[i], NULL); } checkpointNext("Stack size:"); testCreate(" Zero stack", "create", &testFunc, 0x20, 0, 0, NULL); int stacks[] = {-1, 1, -0x10000, 0x100, 0x1FF, 0x200, 0x1000, 0x100000, 0x1000000, 0x1000001, 0x20000000}; for (i = 0; i < sizeof(stacks) / sizeof(stacks[0]); ++i) { sprintf(temp, " 0x%08x stack", stacks[i]); testCreate(temp, "create", &testFunc, 0x20, stacks[i], 0, NULL); } checkpointNext("Priorities:"); int prios[] = {0, 0x06, 0x07, 0x08, 0x77, 0x78, -1}; for (i = 0; i < sizeof(prios) / sizeof(prios[0]); ++i) { sprintf(temp, " 0x%02x priority", prios[i]); testCreate(temp, "create", &testFunc, prios[i], 0x200, 0, NULL); } checkpointNext("Entry:"); testCreate(" Null entry", "create", NULL, 0x20, 0x10000, 0, NULL); testCreate(" Invalid entry", "create", (SceKernelThreadEntry) 0xDEADBEEF, 0x20, 0x10000, 0, NULL); // TODO: Options? checkpointNext(NULL); SceUID thread1 = sceKernelCreateThread("create", &testFunc, 0x20, 0x1000, 0, NULL); SceUID thread2 = sceKernelCreateThread("create", &testFunc, 0x20, 0x1000, 0, NULL); if (thread1 > 0 && thread2 > 0) { checkpoint("Two with same name: OK"); } else { checkpoint("Two with same name: Failed (%X, %X)", thread1, thread2); } sceKernelDeleteThread(thread1); sceKernelDeleteThread(thread2); checkpointNext(NULL); SceUID thread; BASIC_SCHED_TEST("NULL name", thread = sceKernelCreateThread(NULL, &testFunc, 0x20, 0x1000, 0, NULL); result = thread > 0 ? 1 : thread; );
MojErr MojDbPerfCreateTest::run() { MojErr err = file.open(CreateTestFileName, MOJ_O_RDWR | MOJ_O_CREAT | MOJ_O_TRUNC, MOJ_S_IRUSR | MOJ_S_IWUSR); MojString buf; err = buf.format("MojoDb Create Performance Test,,,,,\n\nOperation,Kind,Total Time,Time Per Iteration,Time Per Object\n"); MojTestErrCheck(err); err = fileWrite(file, buf); MojTestErrCheck(err); err = testCreate(); MojTestErrCheck(err); allTestsTime += totalTestTime; err = MojPrintF("\n\n TOTAL TEST TIME: %llu nanoseconds. | %10.3f seconds.\n\n", totalTestTime, totalTestTime / 1000000000.0f); MojTestErrCheck(err); err = MojPrintF("\n-------\n"); MojTestErrCheck(err); err = buf.format("\n\nTOTAL TEST TIME,,%llu,,,", totalTestTime); MojTestErrCheck(err); err = fileWrite(file, buf); MojTestErrCheck(err); err = file.close(); MojTestErrCheck(err); return MojErrNone; }
int main() { int score = 0; printf("Iniciando o teste do modulo entry\n"); score += testCreate(); score += testDup(); printf("Resultados do teste do modulo entry: %d/2\n",score); return score; }
int CXXTest::doTests() { LOG_INFO("Running CXX tests"); if (testInit() != TEST_PASS) { FAIL("C++ init test failed"); } if (testCreate() != TEST_PASS) { FAIL("pthread_create test failed"); } if (testSelf() != TEST_PASS) { FAIL("pthread_self test failed"); } if (testExit() != TEST_PASS) { FAIL("pthread_exit test failed"); } return TEST_PASS; }
static void Tests(skiatest::Reporter* reporter) { // Test flattening SkShader SkPoint points[2]; points[0].set(0, 0); points[1].set(SkIntToScalar(20), SkIntToScalar(20)); SkColor colors[2]; colors[0] = SK_ColorRED; colors[1] = SK_ColorBLUE; SkShader* shader = SkGradientShader::CreateLinear(points, colors, NULL, 2, SkShader::kRepeat_TileMode); SkAutoUnref aur(shader); testCreate(reporter, shader, flattenFlattenableProc); // Test SkBitmap { SkBitmap bm; bm.setConfig(SkBitmap::kARGB_8888_Config, 50, 50); bm.allocPixels(); SkCanvas canvas(bm); SkPaint paint; paint.setShader(shader); canvas.drawPaint(paint); testCreate(reporter, &bm, &SkFlattenObjectProc<SkBitmap>); } // Test SkColorFilter SkColorFilter* cf = SkColorFilter::CreateLightingFilter(SK_ColorBLUE, SK_ColorRED); SkAutoUnref aurcf(cf); testCreate(reporter, cf, &flattenFlattenableProc); // Test SkXfermode SkXfermode* xfer = SkXfermode::Create(SkXfermode::kDstOver_Mode); SkAutoUnref aurxf(xfer); testCreate(reporter, xfer, &flattenFlattenableProc); }
int main() { int score = 0; printf("Iniciando o teste do modulo data \n"); score += testCreate(); score += testCreate2(); score += testDup(); printf("Resultado do teste do modulo data: %d/3\n",score); return score; }
int main() { testCreate(); // TODO insert duplicate testInsert(); // Linked list head delete test /*LL_Delete( &head, 2, compare_ints );*/ /*LL_Delete( &head, 8, compare_ints );*/ /*LL_show(head);*/ printf("\nEnd of program."); // 2 4 8 return EXIT_SUCCESS; }
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); */ }