Main
| 16 | // ***************************************************************************** |
| 17 | // Main |
| 18 | int main(int argc, char* const argv[]) { |
| 19 | Exiv2::XmpParser::initialize(); |
| 20 | ::atexit(Exiv2::XmpParser::terminate); |
| 21 | |
| 22 | try { |
| 23 | if (argc != 3) { |
| 24 | std::cout << "Usage: write-test file case\n\n" |
| 25 | << "where case is an integer between 1 and 11\n"; |
| 26 | return EXIT_FAILURE; |
| 27 | } |
| 28 | |
| 29 | std::string testFile = argv[1]; |
| 30 | std::istringstream iss(argv[2]); |
| 31 | int testNo = 0; |
| 32 | iss >> testNo; |
| 33 | |
| 34 | int rc = EXIT_SUCCESS; |
| 35 | switch (testNo) { |
| 36 | case 1: |
| 37 | std::cerr << "Case 1: "; |
| 38 | std::cerr << "Non-intrusive change to the standard Exif metadata\n"; |
| 39 | testCase(testFile, "test1.jpg", "thumb1", "Exif.Photo.DateTimeOriginal", "1999:11:22 00:11:22"); |
| 40 | break; |
| 41 | case 2: |
| 42 | std::cerr << "Case 2: "; |
| 43 | std::cerr << "Non-intrusive change to the makernote metadata\n"; |
| 44 | testCase(testFile, "test2.jpg", "thumb2", "Exif.Canon.OwnerName", "Chan YeeSend"); |
| 45 | break; |
| 46 | case 3: |
| 47 | std::cerr << "Case 3: "; |
| 48 | std::cerr << "Non-intrusive change to the Exif metadata (w/o makernote)\n"; |
| 49 | testCase(testFile, "test3.jpg", "thumb3", "Exif.Photo.DateTimeOriginal", "1999:11:22 00:11:22"); |
| 50 | break; |
| 51 | case 4: |
| 52 | std::cerr << "Case 4: "; |
| 53 | std::cerr << "Intrusive change to the standard Exif metadata\n"; |
| 54 | testCase(testFile, "test4.jpg", "thumb4", "Exif.Photo.DateTimeOriginal", |
| 55 | "1999:11:22 00:11:22 and twenty seconds"); |
| 56 | break; |
| 57 | case 5: |
| 58 | std::cerr << "Case 5: "; |
| 59 | std::cerr << "Intrusive change to the Canon makernote metadata\n"; |
| 60 | testCase(testFile, "test5.jpg", "thumb5", "Exif.Canon.OwnerName", "Frau Chan YeeSend und Herr Andreas Huggel"); |
| 61 | break; |
| 62 | case 6: |
| 63 | std::cerr << "Case 6: "; |
| 64 | std::cerr << "Intrusive change to the Exif metadata (w/o makernote)\n"; |
| 65 | testCase(testFile, "test6.jpg", "thumb6", "Exif.Photo.DateTimeOriginal", |
| 66 | "1999:11:22 00:11:22 and twenty seconds"); |
| 67 | break; |
| 68 | case 7: |
| 69 | std::cerr << "Case 7: "; |
| 70 | std::cerr << "Intrusive change to the Fujifilm makernote metadata\n"; |
| 71 | testCase(testFile, "test7.jpg", "thumb7", "Exif.Fujifilm.Quality", "Typical Fujifilm Quality"); |
| 72 | break; |
| 73 | case 8: |
| 74 | std::cerr << "Case 8: "; |
| 75 | std::cerr << "Intrusive change to the Sigma makernote metadata\n"; |
nothing calls this directly
no test coverage detected