Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: libexif/sources/test/test-sorted.c

Issue 10535156: Add libexif to deps/third_party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « libexif/sources/test/test-parse.c ('k') | libexif/sources/test/test-tagtable.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /* test-sorted.c
2 *
3 * This test ensures that the ExifTagTable[] array is stored in sorted
4 * order. If that were not so, then it a binary search of the array would
5 * not give correct results.
6 *
7 * Copyright 2009 Dan Fandrich <dan@coneharvesters.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA
23 */
24
25 #include <libexif/exif-tag.h>
26 #include <stdio.h>
27
28 int
29 main (void)
30 {
31 int rc = 0;
32 unsigned int i, num;
33 ExifTag last = 0, current;
34 num = exif_tag_table_count() - 1; /* last entry is a NULL terminator */
35 for (i=0; i < num; ++i) {
36 current = exif_tag_table_get_tag(i);
37 if (current < last) {
38 printf("Tag 0x%04x in ExifTagTable[] is out of order\n",
39 current);
40 rc = 1;
41 }
42 if (exif_tag_table_get_name(i) == NULL) {
43 printf("Tag 0x%04x has a NULL name\n", current);
44 rc = 1;
45 }
46 last = current;
47 }
48
49 return rc;
50 }
OLDNEW
« no previous file with comments | « libexif/sources/test/test-parse.c ('k') | libexif/sources/test/test-tagtable.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698