本文整理汇总了C++中dotest函数的典型用法代码示例。如果您正苦于以下问题:C++ dotest函数的具体用法?C++ dotest怎么用?C++ dotest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dotest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
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;
}
示例2: main
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;
}
示例3: main
int main ()
{
dotest (test1);
dotest (test2);
printf ("All attempts failed\n");
return 0;
}
示例4: main
/* main ===================================================================== */
int
main (void) {
vSerialInit (SERIAL_BAUDRATE / 100, SERIAL_IOS);
stdout = &xSerialPort;
dprintf("Memory Debug Test\n");
dotest (false);
dotest (true);
return 0;
}
示例5: main
int
main()
{
setup();
/* Do the whole thing twice */
dotest();
dotest();
cleanup();
return 0;
}
示例6: main
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;
}
示例7: main
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();
}
示例8: main
int main(int argc, char **argv) {
const char *arg;
while ((arg= *++argv)) {
dotest(arg);
}
return !!fails;
}
示例9: main
int
main(void)
{
init();
dotest();
return 0;
}
示例10: mantest
// 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;
}
示例11: dotests
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";
}
示例12: loadfile
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 );
}
示例13: main
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();
}
示例14: runtest
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();
}
示例15: mod_pagefaults
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;
}