int main(int, char**) { testInts(); testStrings(); testIntsAndStrings(); return 0; }
void data(const QByteArray &a) { if(a.isEmpty()) /* cout << "<no more data>" << endl*/; else { testStrings("Content: ", content_expected, a); } /*end if*/ }
bool TestSerializationBuffer::doTest() { bool pass = true; pass &= testReadWrite( ); pass &= testExternalBuffer( ); pass &= testStrings( ); performanceTest( ); return pass; }
bool testLexer() { bool passed; passed = testWhitespaces(); passed = passed && testDelimiters(); passed = passed && testStrings(); passed = passed && testPosInts(); passed = passed && testNegInts(); passed = passed && testReals(); passed = passed && testSymbols(); return passed; }
int main() { testInts(); testStrings(); #ifdef _WIN32 if (_CrtDumpMemoryLeaks()) { cout << "Memory leaks!" << endl; } #endif char c; cin >> c; return 0; }
void setMetaData(const QString &key, const QString &value) { // meta_data[key] = value; // cout << "§ " << key << " = " << value << endl; QString prefix = "Metadata[\"" + key + "\"]: "; KIO::MetaData::Iterator it = attributes_expected.find(key); if(it != attributes_expected.end()) { testStrings(prefix, it.data(), value); // remove key from map attributes_expected.remove(it); } else { cout << endl << prefix << " no such key expected"; total++; } }
int main( void ) { string result; testInts(); testFloats(); testBools(); testStrings(); testCStrings(); result = tests_failed ? "FAILURE" : "SUCCESS"; printf( "\ntotal: %d\npassed: %d\nfailed: %d\n", tests_total, tests_passed, tests_failed ); printf( "\nTest results: %s\n\n", result.c_str() ); /* exit status 0 if nothing failed */ return tests_failed; }
int main() { printf("\nCalling Wren code from C++...\n\n"); testMethodCall(); printf("\nTesting method calls...\n\n"); testClassMethods(); printf("\nTesting return values...\n\n"); testReturnValues(); printf("\nTesting to see if passing string to C++ works...\n\n"); testStrings(); return 0; }
static int runCommand(int argc, const char **argv, DFError **dferr) { if ((argc == 3) && !strcmp(argv[1],"-pp")) { return prettyPrintFile(argv[2],dferr); } else if ((argc == 4) && !strcmp(argv[1],"-fp")) { return fromPlain(argv[2],argv[3],dferr); } else if ((argc == 3) && !strcmp(argv[1],"-normalize")) { return normalizeFile(argv[2],dferr); } else if ((argc >= 2) && !strcmp(argv[1],"-bdt")) { BDT_Test(argc-2,&argv[2]); return 1; } else if ((argc == 3) && !strcmp(argv[1],"-css")) { return testCSS(argv[2],dferr); } else if ((argc == 3) && !strcmp(argv[1],"-parsehtml")) { return parseHTMLFile(argv[2],dferr); } else if ((argc == 3) && !strcmp(argv[1],"-tplist")) { return textPackageList(argv[2],dferr); } else if ((argc == 4) && !strcmp(argv[1],"-tpget")) { return textPackageGet(argv[2],argv[3],dferr); } else if ((argc == 4) && !strcmp(argv[1],"-diff")) { return diffFiles(argv[2],argv[3],dferr); } else if ((argc == 3) && !strcmp(argv[1],"-parsecontent")) { parseContent(argv[2]); return 1; } else if ((argc >= 2) && !strcmp(argv[1],"-btos")) { const char *inFilename = (argc >= 3) ? argv[2] : NULL; const char *outFilename = (argc >= 4) ? argv[3] : NULL; return btosFile(inFilename,outFilename,dferr); } else if ((argc >= 2) && !strcmp(argv[1],"-stob")) { const char *inFilename = (argc >= 3) ? argv[2] : NULL; const char *outFilename = (argc >= 4) ? argv[3] : NULL; return stobFile(inFilename,outFilename,dferr); } else if ((argc == 3) && (!strcmp(argv[1],"-css-escape"))) { return escapeCSSIdent(argv[2],dferr); } else if ((argc == 3) && (!strcmp(argv[1],"-css-unescape"))) { return unescapeCSSIdent(argv[2],dferr); } #ifdef __APPLE__ else if ((argc == 2) && (!strcmp(argv[1],"-test-unicode"))) { return testUnicode(); } else if ((argc == 2) && (!strcmp(argv[1],"-test-strings"))) { return testStrings(); } else if ((argc == 2) && (!strcmp(argv[1],"-test-path"))) { testPathFunctions(); return 1; } #endif else if ((argc == 4) && !strcmp(argv[1],"-zip")) { DFStorage *storage = DFStorageNewFilesystem(argv[3],DFFileFormatUnknown); int r = DFZip(argv[2],storage,dferr); DFStorageRelease(storage); return r; } else if ((argc == 4) && !strcmp(argv[1],"-unzip")) { DFStorage *storage = DFStorageNewFilesystem(argv[3],DFFileFormatUnknown); int r = DFUnzip(argv[2],storage,dferr); DFStorageRelease(storage); return r; } else { //////////////////////////////////////////////////////////////////////////////// printf("Usage:\n" "\n" "dfutil -pp filename\n" " Print a plain text version of a .docx or .odt file to standard output\n" "\n" "dfutil -fp infilename outfilename\n" " Create a .docx or .odt file based on a plain text representation. If\n" " infilename is -, read from standard input.\n" "\n" "dfutil -normalize filename\n" " Normalize a HTML file\n" "\n" "dfutil -parsecontent string\n" " Parse a value as if it were given as a CSS 'content' property, and print parts\n" "\n" "dfutil -btos [infilename] [outfilename]\n" " Convert binary data to string\n" "\n" "dfutil -stob [infilename] [outfilename]\n" " Convert string to binary data\n" "\n" "dfutil -css-escape [infilename]\n" " Escape CSS class name\n" "\n" "dfutil -css-unescape [infilename]\n" " Unescape CSS class name\n" "\n" "dfutil -zip zipFilename sourceDir\n" " Create a zip file\n" "\n" "dfutil -unzip zipFilename destDir\n" " Extract a zip file\n" "\n" "dfutil input.html output.docx\n" "dfutil input.html output.odt\n" "dfutil input.docx output.html\n" "dfutil input.docx output.html\n" " Convert to/from .docx or .odt and .html\n"); return 1; } }
void mimeType(const QString &type) { testStrings("MIME Type: ", mime_type_expected, type); }