summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Ou <shunhsingou@google.com>2012-08-01 17:19:49 +0800
committerEarl Ou <shunhsingou@google.com>2012-08-01 17:23:34 +0800
commit4285894ea4facfae76ff57df97f4fd8342608bd4 (patch)
tree4f1e74ab160ac9819077e1badce8cf60288fae21
parent1819ed3baf83be8476ba82f7854f5c2d17c0fcf0 (diff)
downloadandroid_packages_apps_Snap-4285894ea4facfae76ff57df97f4fd8342608bd4.tar.gz
android_packages_apps_Snap-4285894ea4facfae76ff57df97f4fd8342608bd4.tar.bz2
android_packages_apps_Snap-4285894ea4facfae76ff57df97f4fd8342608bd4.zip
Test only keep some exif tags for value
Change-Id: I06962ffb4e1c6844cc8c0d24b686571483f16c22
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifParserTest.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/src/com/android/gallery3d/exif/ExifParserTest.java b/tests/src/com/android/gallery3d/exif/ExifParserTest.java
index 0c160f21a..2e92231de 100644
--- a/tests/src/com/android/gallery3d/exif/ExifParserTest.java
+++ b/tests/src/com/android/gallery3d/exif/ExifParserTest.java
@@ -285,6 +285,38 @@ public class ExifParserTest extends ActivityTestCase {
}
}
+ public void testOnlySaveSomeValue() 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:
+ ExifTag tag = ifdParser.readTag();
+ // only interested in these two tags
+ if (tag.getOffset() > 0) {
+ if(tag.getTagId() == ExifTag.TIFF_TAG.TAG_MODEL
+ || tag.getTagId() == ExifTag.TIFF_TAG.TAG_EXIF_IFD) {
+ ifdParser.waitValueOfTag(tag);
+ }
+ }
+ break;
+ case IfdParser.TYPE_NEXT_IFD:
+ parseIfd1(ifdParser.parseIfdBlock());
+ break;
+ case IfdParser.TYPE_SUB_IFD:
+ assertEquals(ExifTag.TIFF_TAG.TAG_EXIF_IFD,
+ ifdParser.getCorrespodingExifTag().getTagId());
+ parseExifIfd(ifdParser.parseIfdBlock());
+ break;
+ case IfdParser.TYPE_VALUE_OF_PREV_TAG:
+ checkTag(ifdParser.getCorrespodingExifTag(), ifdParser, IFD0_VALUE);
+ break;
+ }
+ type = ifdParser.next();
+ }
+ }
+
@Override
protected void tearDown() throws IOException {
mImageInputStream.close();