int main(void) { int i; unsigned long l; printf("\nwithout cast:\n"); printf("return int\n"); dotest(i,test1_int_char(),0x76); dotest(i,test1_int_int(),0x5678); printf("return long\n"); dotest(l,test1_long_char(),0x76); dotest(l,test1_long_int(),0x5678); dotest(l,test1_long_long(),0x12345678); printf("\nwith cast:\n"); printf("return int\n"); dotest(i,test2_int_char(),0x76); dotest(i,test2_int_int(),0x5678); printf("return long\n"); dotest(l,test2_long_char(),0x76); dotest(l,test2_long_int(),0x5678); dotest(l,test2_long_long(),0x12345678); return 0; }
int main(int argc, char *argv[]) { int i, tn, menu=1; if (argc > 1) { for (i=1; i<argc; i++) { dotest(atoi(argv[i])); } return 0; } while (1) { if (menu) { for (i=0; tests[i].num>=0; i++) { printf(" %2d %s\n", tests[i].num, tests[i].desc); } menu = 0; } printf("malloctest: "); tn = geti(); if (tn < 0) { break; } if (dotest(tn)) { menu = 1; } } return 0; }
int main () { dotest (test1); dotest (test2); printf ("All attempts failed\n"); return 0; }
/* main ===================================================================== */ int main (void) { vSerialInit (SERIAL_BAUDRATE / 100, SERIAL_IOS); stdout = &xSerialPort; dprintf("Memory Debug Test\n"); dotest (false); dotest (true); return 0; }
int main() { setup(); /* Do the whole thing twice */ dotest(); dotest(); cleanup(); return 0; }
int main(void) { #if defined(HAVE_LIBPNG) dotest ("times", 16, 20.0, 400, 400, "Hello, there!", "fontwheeltest1.png"); dotest ("times", 16, 30.0, 400, 400, "Hello, there!", "fontwheeltest2.png"); dotest ("arial", 16, 45.0, 400, 400, "Hello, there!", "fontwheeltest3.png"); dotest ("arial", 16, 90.0, 400, 400, "Hello\nthere!", "fontwheeltest4.png"); #elif defined(HAVE_LIBJPEG) dotest ("times", 16, 20.0, 400, 400, "Hello, there!", "fontwheeltest1.jpeg"); dotest ("times", 16, 30.0, 400, 400, "Hello, there!", "fontwheeltest2.jpeg"); dotest ("arial", 16, 45.0, 400, 400, "Hello, there!", "fontwheeltest3.jpeg"); dotest ("arial", 16, 90.0, 400, 400, "Hello\nthere!", "fontwheeltest4.jpeg"); #else fprintf(stderr, "no PNG or JPEG support\n"); #endif return 0; }
int main(void) { plan_tests(5); setvbuf(stdout, 0, _IOLBF, 0); int pts[] = { 1,3, 2,5, 4,0, 8,9, 5,20, 6,23, 10,10, 10,11, 10,12, 15,22, 13,23, -1 }; dotest( 8, 8, pts); dotest( 8, 24, pts); dotest(16, 16, pts); dotest(16, 24, pts); dotest(24, 24, pts); return exit_status(); }
int main(int argc, char **argv) { const char *arg; while ((arg= *++argv)) { dotest(arg); } return !!fails; }
int main(void) { init(); dotest(); return 0; }
// Test the @perm:utation and the inverse thereof of @managedWindows. static unsigned mantest(QVector<unsigned> const &perm, const WindowVec *fromStack, const MRestacker *fromState) { MRestacker::WindowStack stack; foreach (unsigned i, perm) stack.append(managedWindows[i]); dotest(stack, fromStack, fromState); for (int i = 0; i < perm.count(); i++) stack[perm[i]] = managedWindows[i]; dotest(stack, fromStack, fromState); return 2; }
void dotests() { std::chrono::microseconds times[20]; for(int i=0; i<20; ++i) times[i] = dotest(); std::sort(begin(times), end(times)); std::cout << "TestSet min: " << times[0].count() << "ms\n"; }
void loadfile(const std::string& testfname) { hdf5_collection col; col.load_collection(testfname); fprintf(stdout, "\n\n\n\n\n\n\n LOADED NOW!\n"); dotest( col ); }
int main(int argc, const char **argv) { SerialconfigIndication *deviceIndication = 0; fprintf(stderr, "%s %s\n", __DATE__, __TIME__); dev = new SerialconfigRequestProxy(IfcNames_SerialconfigRequest); deviceIndication = new SerialconfigIndication(IfcNames_SerialconfigIndication); if(sem_init(&test_sem, 1, 0)){ fprintf(stderr, "failed to init test_sem\n"); return -1; } pthread_t tid; fprintf(stderr, "creating exec thread\n"); if(pthread_create(&tid, NULL, portalExec, NULL)){ fprintf(stderr, "error creating exec thread\n"); exit(1); } fprintf(stderr, "simple tests\n"); dotest(); }
static void runtest(void) { int child, count, fd, i, nwait, status; nwait = 0; for (i = 0; i < nchild; i++) { if ((child = fork()) == 0) { fd = open(filename, O_RDWR); if (fd < 0) { tst_brkm(TFAIL, NULL, "\tTest[%d]: error %d openning %s.", i, errno, filename); } dotest(nchild, i, fd); close(fd); tst_exit(); } if (child < 0) { tst_brkm(TBROK | TERRNO, NULL, "fork failed"); } else { pidlist[i] = child; nwait++; } } /* * Wait for children to finish. */ count = 0; while ((child = wait(&status)) != -1 || errno == EINTR) { if (child > 0) { //tst_resm(TINFO, "\tTest{%d} exited status = 0x%x", child, status); if (status) { tst_resm(TFAIL, "\tExpected 0 exit status - failed."); local_flag = FAILED; } ++count; } } /* * Should have collected all children. */ if (count != nwait) { tst_resm(TFAIL, "\tWrong # children waited on, count = %d", count); local_flag = FAILED; } unlink(filename); sync(); }
int mod_pagefaults(A_UNUSED int argc,A_UNUSED char *argv[]) { int i,fd = createfile(); for(i = 0; i < TEST_COUNT; ++i) dotest(fd); close(fd); if(unlink("/sys/test") != 0) error("unlink failed"); return EXIT_SUCCESS; }
// Test all rotations of the given @stack:ing. When finished, // @stack will be the same as when started. static unsigned rottest(MRestacker::WindowStack &stack, const WindowVec *fromStack, const MRestacker *fromState) { for (unsigned i = stack.count(); i > 0; i--) { dotest(stack, fromStack, fromState); stack.prepend(stack.takeLast()); } return stack.count(); }
int main(int argc, char *argv[]) { size_t newblocksize; int wss, cs, n = 0, p; #define ITER 3 #define BLOCKS 200 start(72); lmfs_setquiet(1); /* Can the cache handle differently sized blocks? */ for(p = 1; p <= 3; p++) { /* Do not update curblocksize until the cache is flushed. */ newblocksize = PAGE_SIZE*p; lmfs_set_blocksize(newblocksize); curblocksize = newblocksize; /* now it's safe to update */ lmfs_buf_pool(BLOCKS); if(dotest(curblocksize, BLOCKS, ITER)) e(n); n++; } /* Can the cache handle various combinations of the working set * being larger and smaller than the cache? */ for(wss = 2; wss <= 3; wss++) { int wsblocks = 10*wss*wss*wss*wss*wss; for(cs = wsblocks/4; cs <= wsblocks*3; cs *= 1.5) { lmfs_set_blocksize(PAGE_SIZE); curblocksize = PAGE_SIZE; /* same as above */ lmfs_buf_pool(cs); if(dotest(curblocksize, wsblocks, ITER)) e(n); n++; } } quit(); return 0; }
int main(int argc, char *argv[]) { char *progname = argv[0]; char *fname; shrc rc; if(argc != 1){ usage(cerr, progname); } // Establish a connection with the vas and initialize // the object cache. SH_DO(Shore::init(argc, argv)); SH_BEGIN_TRANSACTION(rc); // If that failed, or if a transaction aborted... if(rc){ // after longjmp cerr << rc << endl; return 1; } else { // The main body of the transaction goes here. SH_DO(Shore::chdir("/")); ////////////////////////////////// // GUTS HERE ////////////////////////////////// fname = "XXX"; { bool ok = true; SH_DO( REF(my_obj)::new_persistent (fname, 0644, o_ref) ) ; if(!o_ref ) { cerr << "Cannot create new objects " << fname << endl; ok = false; } else { SH_DO( REF(a)::new_persistent ("a_ref_junk", 0644, a_ref) ) ; if(!a_ref ) { cerr << "Cannot create new objects " << "a_ref_junk" << endl; ok = false; } } dotest(); } SH_DO(SH_COMMIT_TRANSACTION); } destroy_obj(fname); destroy_obj("a_ref_junk"); return 0; }
void __init nmi_selftest(void) { init_nmi_testsuite(); /* * Run the testsuite: */ printk("----------------\n"); printk("| NMI testsuite:\n"); printk("--------------------\n"); print_testname("remote IPI"); dotest(remote_ipi, SUCCESS); printk(KERN_CONT "\n"); print_testname("local IPI"); dotest(local_ipi, SUCCESS); printk(KERN_CONT "\n"); cleanup_nmi_testsuite(); if (unexpected_testcase_failures) { printk("--------------------\n"); printk("BUG: %3d unexpected failures (out of %3d) - debugging disabled! |\n", unexpected_testcase_failures, testcase_total); printk("-----------------------------------------------------------------\n"); } else if (expected_testcase_failures && testcase_successes) { printk("--------------------\n"); printk("%3d out of %3d testcases failed, as expected. |\n", expected_testcase_failures, testcase_total); printk("----------------------------------------------------\n"); } else if (expected_testcase_failures && !testcase_successes) { printk("--------------------\n"); printk("All %3d testcases failed, as expected. |\n", expected_testcase_failures); printk("----------------------------------------\n"); } else { printk("--------------------\n"); printk("Good, all %3d testcases passed! |\n", testcase_successes); printk("---------------------------------\n"); } }
int main() { try { dotest(); } catch (libmapipp::mapi_exception e) { std::cout << e.what() << std::endl; } return 0; }
int main (int argc, char ** argv) { int retval; range = HASHTABLE_SIZE; npaths = NPATHS; nvars = NVARS; retval = dotest(); return retval; }
int main(int argc, char *argv[]) { int i, failures = 0; for (i = 0; i < NTESTVEC; i++) { failures += dotest(&test_vectors[i]); } return failures; }
int main(int argc, char **argv) { RTTEST hTest; RTEXITCODE rcExit = RTTestInitAndCreate("tstRTDarwinMachKernel", &hTest); if (rcExit != RTEXITCODE_SUCCESS) return rcExit; RTTestBanner(hTest); dotest(); return RTTestSummaryAndDestroy(hTest); }
Test(dirReduc, ShouldPassAllTheTestsProvided) { { char* d1[7] = {"NORTH1", "SOUTH2", "SOUTH3", "EAST4", "WEST5", "NORTH6", "WEST7"}; dotest(d1, 7, "{WEST7}"); } { char* d1[4] = {"NORTH", "WEST", "SOUTH", "EAST"}; dotest(d1, 4, "{NORTH, WEST, SOUTH, EAST}"); } { char* d1[10] = {"NORTH1", "WEST2", "SOUTH3", "EAST4", "NORTH5", "WEST6", "SOUTH7", "EAST8", "SOUTH9", "NORTH10"}; dotest(d1, 10, "{NORTH1, WEST2, SOUTH3, EAST4, NORTH5, WEST6, SOUTH7, EAST8}"); } { char* d1[4] = {"NORTH", "SOUTH", "WEST", "EAST"}; dotest(d1, 4, "{}"); } }
int main(void) { plan_tests(5 * 2); setvbuf(stdout, 0, _IOLBF, 0); // Eleven data points inserted into each test matrix, // modulo that matrix' dimensions. int pts[] = { 1,3, 2,5, 4,0, 8,9, 5,20, 6,23, 10,10, 10,11, 10,12, 15,22, 13,23, -1 }; for (bitmat_msb_first = 0; bitmat_msb_first > -2; --bitmat_msb_first) { fprintf(stderr, "# %s SIGNIFICANT BIT FIRST\n", bitmat_msb_first ? "MOST" : "LEAST"); dotest( 8, 8, pts); dotest( 8, 24, pts); dotest(16, 16, pts); dotest(16, 24, pts); dotest(24, 24, pts); } return exit_status(); }
int main(int argc, char *argv[]) { int wss, cs, n = 0, p; #define ITER 3 #define BLOCKS 200 start(72); lmfs_setquiet(1); /* Can the cache handle differently sized blocks? */ for(p = 1; p <= 3; p++) { curblocksize = PAGE_SIZE*p; lmfs_set_blocksize(curblocksize, MYMAJOR); lmfs_buf_pool(BLOCKS); if(dotest(curblocksize, BLOCKS, ITER)) e(n); n++; } /* Can the cache handle various combinations of the working set * being larger and smaller than the cache? */ for(wss = 2; wss <= 3; wss++) { int wsblocks = 10*wss*wss*wss*wss*wss; for(cs = wsblocks/4; cs <= wsblocks*3; cs *= 1.5) { curblocksize = PAGE_SIZE; lmfs_set_blocksize(curblocksize, MYMAJOR); lmfs_buf_pool(cs); if(dotest(curblocksize, wsblocks, ITER)) e(n); n++; } } quit(); return 0; }
// Up to @optExhaustiveCut number of elements, take all possible stackings // of @managedWindows and check whether the superstacker can produce them. static void exhaustiveTest(const WindowVec *fromStack, const MRestacker *fromState) { unsigned ncombs = 0; // Generate all 1, 2, ..., @optExhaustiveCut-element repeating // combinations of @managedWindows. We need the cut to prevent // combinatoric explosion. QVector<unsigned> origOrder; while (origOrder.count() < optExhaustiveCut) origOrder.append(origOrder.count()); QVector<unsigned> setOrder = origOrder; do { // one permutation => some combinations MRestacker::WindowStack stack; foreach (unsigned idx, setOrder) stack.append(managedWindows[idx]); dotest(stack, fromStack, fromState); ncombs++; for (unsigned i = 0; stack.count() > 1; i++) { bool final = !(setOrder[i] < setOrder[i+1]); stack.removeFirst(); dotest(stack, fromStack, fromState); ncombs++; if (final) break; } std::next_permutation(setOrder.begin(), setOrder.end()); } while (setOrder != origOrder); // Verify that we've tried all the combinations we were meant to. qDebug("tested %u combinations", ncombs); QCOMPARE(ncombs, numberOfSubsets(origOrder.count())); // Verify that performance is as expected. verifyStats(fromStack ? &testExhaustiveComparativeStats : &testExhaustiveStandaloneStats, origOrder.count()); printStats(); }
int main(int argc, const char **argv) { unsigned int srcGen = 0; unsigned repeatCount = 0; fprintf(stderr, "%s %s\n", __DATE__, __TIME__); device = new PerfRequestProxy(IfcNames_PerfRequest); DmaDebugRequestProxy *hostDmaDebugRequest = new DmaDebugRequestProxy(IfcNames_HostDmaDebugRequest); dmap = new MMUConfigRequestProxy(IfcNames_HostMMUConfigRequest); DmaManager *dma = new DmaManager(hostDmaDebugRequest, dmap); DmaDebugIndication *hostDmaDebugIndication = new DmaDebugIndication(dma, IfcNames_HostDmaDebugIndication); MMUConfigIndication *hostMMUConfigIndication = new MMUConfigIndication(dma, IfcNames_HostMMUConfigIndication); deviceIndication = new PerfIndication(IfcNames_PerfIndication); fprintf(stderr, "Main::allocating memory...\n"); srcAlloc = portalAlloc(alloc_sz); dstAlloc = portalAlloc(alloc_sz); srcBuffer = (unsigned int *)portalMmap(srcAlloc, alloc_sz); dstBuffer = (unsigned int *)portalMmap(dstAlloc, alloc_sz); portalExec_start(); portalDCacheFlushInval(srcAlloc, alloc_sz, srcBuffer); portalDCacheFlushInval(dstAlloc, alloc_sz, dstBuffer); fprintf(stderr, "Main::flush and invalidate complete\n"); ref_srcAlloc = dma->reference(srcAlloc); ref_dstAlloc = dma->reference(dstAlloc); fprintf(stderr, "ref_srcAlloc %d\n", ref_srcAlloc); fprintf(stderr, "ref_dstAlloc %d\n", ref_dstAlloc); //fprintf(stderr, "Main::starting mempcy numWords:%d\n", 0); //dotest(0); for (repeatCount = 1; repeatCount <= 16; repeatCount <<= 1) { fprintf(stderr, "Main::starting mempcy repeatCount:%d\n", repeatCount); for (numWords = 16; numWords < (1 << 16); numWords <<= 1){ //fprintf(stderr, "Main::starting mempcy numWords:%d\n", numWords); dotest(numWords, repeatCount); } } device->getStateDbg(); fprintf(stderr, "Main::exiting\n"); }
int main(int argc, char *argv[]) { int i, tn; unsigned j; bool menu = true; setup(); if (argc > 1) { for (i=1; i<argc; i++) { dotest(atoi(argv[i])); } return 0; } while (1) { if (menu) { for (j=0; j<numtests; j++) { tprintf(" %2d %s\n", tests[j].num, tests[j].desc); } menu = false; } tprintf("sbrktest: "); tn = geti(); if (tn < 0) { break; } if (dotest(tn)) { menu = true; } } return 0; }
int main(int argc, char **argv) { if (argc >= 4) { int nchildren=atoi(argv[1]); int count=atoi(argv[2]); if (nchildren > 0 && count > 0) exit(dotest(nchildren, count, argv+3)); } fprintf(stderr, "Usage: authdaemontest [nchildren] [count] ./authtest [userid] [password]\n"); exit(1); return (1); }