diff options
author | Earl Ou <shunhsingou@google.com> | 2012-08-01 16:46:06 +0800 |
---|---|---|
committer | Earl Ou <shunhsingou@google.com> | 2012-08-01 17:06:20 +0800 |
commit | c72fad97373f07b8aa52740104e751d4f440ee72 (patch) | |
tree | a71b22373e4ee1570da2ce996f1794854c5086c2 /tests/src/com/android | |
parent | 6131e77599056a9f1a19d6e4a71d191594b89805 (diff) | |
download | android_packages_apps_Gallery2-c72fad97373f07b8aa52740104e751d4f440ee72.tar.gz android_packages_apps_Gallery2-c72fad97373f07b8aa52740104e751d4f440ee72.tar.bz2 android_packages_apps_Gallery2-c72fad97373f07b8aa52740104e751d4f440ee72.zip |
Test skip to next ifd in ExifParserTest
Change-Id: Icc53e75d563acb304c23349c28d604d439b4b314
Diffstat (limited to 'tests/src/com/android')
-rw-r--r-- | tests/src/com/android/gallery3d/exif/ExifParserTest.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/src/com/android/gallery3d/exif/ExifParserTest.java b/tests/src/com/android/gallery3d/exif/ExifParserTest.java index 91e1d37aa..0c160f21a 100644 --- a/tests/src/com/android/gallery3d/exif/ExifParserTest.java +++ b/tests/src/com/android/gallery3d/exif/ExifParserTest.java @@ -260,6 +260,31 @@ public class ExifParserTest extends ActivityTestCase { return sbuilder.toString(); } + public void testSkipToNextIfd() throws ExifInvalidFormatException, IOException { + ExifParser exifParser = new ExifParser(); + IfdParser ifdParser = exifParser.parse(mImageInputStream); + int type = ifdParser.next(); + while (type != IfdParser.TYPE_END) { + switch (type) { + case IfdParser.TYPE_NEW_TAG: + // Do nothing, we don't care + break; + case IfdParser.TYPE_NEXT_IFD: + parseIfd1(ifdParser.parseIfdBlock()); + break; + case IfdParser.TYPE_SUB_IFD: + // We won't get this since to skip everything + assertTrue(false); + break; + case IfdParser.TYPE_VALUE_OF_PREV_TAG: + // We won't get this since to skip everything + assertTrue(false); + break; + } + type = ifdParser.next(); + } + } + @Override protected void tearDown() throws IOException { mImageInputStream.close(); |