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 | dbbfed236dc1bb81826ea87e9e2cd09aa141cb8d (patch) | |
tree | 2f1b97f129d9b97953e8eb4a8ca4651c2f32b4f5 /tests | |
parent | fb11e05fff4b17f0954ce3be96e5c4b5e478ba57 (diff) | |
download | android_packages_apps_Snap-dbbfed236dc1bb81826ea87e9e2cd09aa141cb8d.tar.gz android_packages_apps_Snap-dbbfed236dc1bb81826ea87e9e2cd09aa141cb8d.tar.bz2 android_packages_apps_Snap-dbbfed236dc1bb81826ea87e9e2cd09aa141cb8d.zip |
Test skip to next ifd in ExifParserTest
Change-Id: Icc53e75d563acb304c23349c28d604d439b4b314
Diffstat (limited to 'tests')
-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(); |