summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEarl Ou <shunhsingou@google.com>2012-08-01 16:46:06 +0800
committerEarl Ou <shunhsingou@google.com>2012-08-01 17:06:20 +0800
commitdbbfed236dc1bb81826ea87e9e2cd09aa141cb8d (patch)
tree2f1b97f129d9b97953e8eb4a8ca4651c2f32b4f5 /tests
parentfb11e05fff4b17f0954ce3be96e5c4b5e478ba57 (diff)
downloadandroid_packages_apps_Snap-dbbfed236dc1bb81826ea87e9e2cd09aa141cb8d.zip
android_packages_apps_Snap-dbbfed236dc1bb81826ea87e9e2cd09aa141cb8d.tar.gz
android_packages_apps_Snap-dbbfed236dc1bb81826ea87e9e2cd09aa141cb8d.tar.bz2
Test skip to next ifd in ExifParserTest
Change-Id: Icc53e75d563acb304c23349c28d604d439b4b314
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifParserTest.java25
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 91e1d37..0c160f2 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();