"Fossies" - the Fresh Open Source Software Archive

Member "libextractor-1.11/src/plugins/test_exiv2.c" (30 Jan 2021, 7764 Bytes) of package /linux/privat/libextractor-1.11.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test_exiv2.c": 1.10_vs_1.11.

    1 /*
    2      This file is part of libextractor.
    3      Copyright (C) 2012 Vidyut Samanta and Christian Grothoff
    4 
    5      libextractor is free software; you can redistribute it and/or modify
    6      it under the terms of the GNU General Public License as published
    7      by the Free Software Foundation; either version 3, or (at your
    8      option) any later version.
    9 
   10      libextractor is distributed in the hope that it will be useful, but
   11      WITHOUT ANY WARRANTY; without even the implied warranty of
   12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   13      General Public License for more details.
   14 
   15      You should have received a copy of the GNU General Public License
   16      along with libextractor; see the file COPYING.  If not, write to the
   17      Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   18      Boston, MA 02110-1301, USA.
   19 */
   20 /**
   21  * @file plugins/test_exiv2.c
   22  * @brief testcase for exiv2 plugin
   23  * @author Christian Grothoff
   24  */
   25 #include "platform.h"
   26 #include "test_lib.h"
   27 
   28 
   29 /**
   30  * Main function for the EXIV2 testcase.
   31  *
   32  * @param argc number of arguments (ignored)
   33  * @param argv arguments (ignored)
   34  * @return 0 on success
   35  */
   36 int
   37 main (int argc, char *argv[])
   38 {
   39   struct SolutionData exiv2_iptc_sol[] = {
   40     {
   41       EXTRACTOR_METATYPE_GPS_LATITUDE_REF,
   42       EXTRACTOR_METAFORMAT_UTF8,
   43       "text/plain",
   44       "North",
   45       strlen ("North") + 1,
   46       0
   47     },
   48     {
   49       EXTRACTOR_METATYPE_GPS_LATITUDE,
   50       EXTRACTOR_METAFORMAT_UTF8,
   51       "text/plain",
   52       "28deg 8' (18|17.585)\" ?",
   53       strlen ("28deg 8' (18|17.585)\" ?") + 1,
   54       0,
   55       .regex = 1
   56     },
   57     {
   58       EXTRACTOR_METATYPE_GPS_LONGITUDE_REF,
   59       EXTRACTOR_METAFORMAT_UTF8,
   60       "text/plain",
   61       "West",
   62       strlen ("West") + 1,
   63       0
   64     },
   65     {
   66       EXTRACTOR_METATYPE_GPS_LONGITUDE,
   67       EXTRACTOR_METAFORMAT_UTF8,
   68       "text/plain",
   69       "14deg 14' (22|21.713)\" ?",
   70       strlen ("14deg 14' (22|21.713)\" ?"),
   71       0,
   72       .regex = 1
   73     },
   74     {
   75       EXTRACTOR_METATYPE_CAMERA_MAKE,
   76       EXTRACTOR_METAFORMAT_UTF8,
   77       "text/plain",
   78       "PENTAX Corporation",
   79       strlen ("PENTAX Corporation") + 1,
   80       0
   81     },
   82     {
   83       EXTRACTOR_METATYPE_CAMERA_MODEL,
   84       EXTRACTOR_METAFORMAT_UTF8,
   85       "text/plain",
   86       "PENTAX Optio W30",
   87       strlen ("PENTAX Optio W30") + 1,
   88       0
   89     },
   90     {
   91       EXTRACTOR_METATYPE_ORIENTATION,
   92       EXTRACTOR_METAFORMAT_UTF8,
   93       "text/plain",
   94       "top, left",
   95       strlen ("top, left") + 1,
   96       0
   97     },
   98     {
   99       EXTRACTOR_METATYPE_CREATION_DATE,
  100       EXTRACTOR_METAFORMAT_UTF8,
  101       "text/plain",
  102       "2008:06:29 16:06:10",
  103       strlen ("2008:06:29 16:06:10") + 1,
  104       0
  105     },
  106     {
  107       EXTRACTOR_METATYPE_EXPOSURE_BIAS,
  108       EXTRACTOR_METAFORMAT_UTF8,
  109       "text/plain",
  110       "0 EV",
  111       strlen ("0 EV") + 1,
  112       0
  113     },
  114     {
  115       EXTRACTOR_METATYPE_FLASH,
  116       EXTRACTOR_METAFORMAT_UTF8,
  117       "text/plain",
  118       "No, compulsory",
  119       strlen ("No, compulsory") + 1,
  120       0
  121     },
  122     {
  123       EXTRACTOR_METATYPE_FOCAL_LENGTH,
  124       EXTRACTOR_METAFORMAT_UTF8,
  125       "text/plain",
  126       "18.9 mm",
  127       strlen ("18.9 mm") + 1,
  128       0
  129     },
  130     {
  131       EXTRACTOR_METATYPE_FOCAL_LENGTH_35MM,
  132       EXTRACTOR_METAFORMAT_UTF8,
  133       "text/plain",
  134       "114.0 mm",
  135       strlen ("114.0 mm") + 1,
  136       0
  137     },
  138     {
  139       EXTRACTOR_METATYPE_ISO_SPEED,
  140       EXTRACTOR_METAFORMAT_UTF8,
  141       "text/plain",
  142       "64",
  143       strlen ("64") + 1,
  144       0
  145     },
  146     {
  147       EXTRACTOR_METATYPE_METERING_MODE,
  148       EXTRACTOR_METAFORMAT_UTF8,
  149       "text/plain",
  150       "Multi-segment",
  151       strlen ("Multi-segment") + 1,
  152       0
  153     },
  154     {
  155       EXTRACTOR_METATYPE_APERTURE,
  156       EXTRACTOR_METAFORMAT_UTF8,
  157       "text/plain",
  158       "F8",
  159       strlen ("F8") + 1,
  160       0
  161     },
  162     {
  163       EXTRACTOR_METATYPE_EXPOSURE,
  164       EXTRACTOR_METAFORMAT_UTF8,
  165       "text/plain",
  166       "1/320 s",
  167       strlen ("1/320 s") + 1,
  168       0
  169     },
  170     {
  171       EXTRACTOR_METATYPE_LOCATION_CITY,
  172       EXTRACTOR_METAFORMAT_UTF8,
  173       "text/plain",
  174       "Los Verdes",
  175       strlen ("Los Verdes") + 1,
  176       0
  177     },
  178     {
  179       EXTRACTOR_METATYPE_LOCATION_CITY,
  180       EXTRACTOR_METAFORMAT_UTF8,
  181       "text/plain",
  182       "Los Verdes",
  183       strlen ("Los Verdes") + 1,
  184       0
  185     },
  186     {
  187       EXTRACTOR_METATYPE_LOCATION_SUBLOCATION,
  188       EXTRACTOR_METAFORMAT_UTF8,
  189       "text/plain",
  190       "Fuerteventura",
  191       strlen ("Fuerteventura") + 1,
  192       0
  193     },
  194     {
  195       EXTRACTOR_METATYPE_LOCATION_COUNTRY,
  196       EXTRACTOR_METAFORMAT_UTF8,
  197       "text/plain",
  198       "Spain",
  199       strlen ("Spain") + 1,
  200       0
  201     },
  202     {
  203       EXTRACTOR_METATYPE_LOCATION_COUNTRY,
  204       EXTRACTOR_METAFORMAT_UTF8,
  205       "text/plain",
  206       "Spain",
  207       strlen ("Spain") + 1,
  208       0
  209     },
  210     {
  211       EXTRACTOR_METATYPE_KEYWORDS,
  212       EXTRACTOR_METAFORMAT_UTF8,
  213       "text/plain",
  214       "Fuerteventura",
  215       strlen ("Fuerteventura") + 1,
  216       0
  217     },
  218     {
  219       EXTRACTOR_METATYPE_KEYWORDS,
  220       EXTRACTOR_METAFORMAT_UTF8,
  221       "text/plain",
  222       "Landschaftsbild",
  223       strlen ("Landschaftsbild") + 1,
  224       0
  225     },
  226     {
  227       EXTRACTOR_METATYPE_KEYWORDS,
  228       EXTRACTOR_METAFORMAT_UTF8,
  229       "text/plain",
  230       "ProCenter Rene Egli",
  231       strlen ("ProCenter Rene Egli") + 1,
  232       0
  233     },
  234     {
  235       EXTRACTOR_METATYPE_KEYWORDS,
  236       EXTRACTOR_METAFORMAT_UTF8,
  237       "text/plain",
  238       "Sand",
  239       strlen ("Sand") + 1,
  240       0
  241     },
  242     {
  243       EXTRACTOR_METATYPE_KEYWORDS,
  244       EXTRACTOR_METAFORMAT_UTF8,
  245       "text/plain",
  246       "Sport",
  247       strlen ("Sport") + 1,
  248       0
  249     },
  250     {
  251       EXTRACTOR_METATYPE_KEYWORDS,
  252       EXTRACTOR_METAFORMAT_UTF8,
  253       "text/plain",
  254       "Urlaub",
  255       strlen ("Urlaub") + 1,
  256       0
  257     },
  258     {
  259       EXTRACTOR_METATYPE_KEYWORDS,
  260       EXTRACTOR_METAFORMAT_UTF8,
  261       "text/plain",
  262       "Was?",
  263       strlen ("Was?") + 1,
  264       0
  265     },
  266     {
  267       EXTRACTOR_METATYPE_KEYWORDS,
  268       EXTRACTOR_METAFORMAT_UTF8,
  269       "text/plain",
  270       "Wind",
  271       strlen ("Wind") + 1,
  272       0
  273     },
  274     {
  275       EXTRACTOR_METATYPE_KEYWORDS,
  276       EXTRACTOR_METAFORMAT_UTF8,
  277       "text/plain",
  278       "Windsurfen",
  279       strlen ("Windsurfen") + 1,
  280       0
  281     },
  282     {
  283       EXTRACTOR_METATYPE_KEYWORDS,
  284       EXTRACTOR_METAFORMAT_UTF8,
  285       "text/plain",
  286       "Wo?",
  287       strlen ("Wo?") + 1,
  288       0
  289     },
  290     {
  291       EXTRACTOR_METATYPE_RATING,
  292       EXTRACTOR_METAFORMAT_UTF8,
  293       "text/plain",
  294       "3",
  295       strlen ("3") + 1,
  296       0
  297     },
  298     {
  299       EXTRACTOR_METATYPE_RATING,
  300       EXTRACTOR_METAFORMAT_UTF8,
  301       "text/plain",
  302       "50",
  303       strlen ("50") + 1,
  304       0
  305     },
  306     {
  307       EXTRACTOR_METATYPE_LOCATION_COUNTRY_CODE,
  308       EXTRACTOR_METAFORMAT_UTF8,
  309       "text/plain",
  310       "ES",
  311       strlen ("ES") + 1,
  312       0
  313     },
  314     {
  315       EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE,
  316       EXTRACTOR_METAFORMAT_UTF8,
  317       "text/plain",
  318       "Optio W30 Ver 1.00",
  319       strlen ("Optio W30 Ver 1.00") + 1,
  320       0
  321     },
  322     {
  323       EXTRACTOR_METATYPE_SUBJECT,
  324       EXTRACTOR_METAFORMAT_UTF8,
  325       "text/plain",
  326       "Wo?, Wo?|Fuerteventura, Was?, Was?|Anlass]|Urlaub, Was?|Aufnahme]|Landschaftsbild, Was?|Natur]|Wind, Was?|Natur]|Sand, Wo?|Fuerteventura|ProCenter Rene Egli, Was?|Sport, Was?|Sport|Windsurfen",
  327       strlen (
  328         "Wo?, Wo?|Fuerteventura, Was?, Was?|Anlass]|Urlaub, Was?|Aufnahme]|Landschaftsbild, Was?|Natur]|Wind, Was?|Natur]|Sand, Wo?|Fuerteventura|ProCenter Rene Egli, Was?|Sport, Was?|Sport|Windsurfen")
  329       + 1,
  330       0
  331     },
  332     { 0, 0, NULL, NULL, 0, -1 }
  333   };
  334   struct ProblemSet ps[] = {
  335     { "testdata/exiv2_iptc.jpg",
  336       exiv2_iptc_sol },
  337     { NULL, NULL }
  338   };
  339   return ET_main ("exiv2", ps);
  340 }
  341 
  342 
  343 /* end of test_exiv2.c */