diff options
author | Owen Lin <owenlin@android.com> | 2012-08-06 19:55:41 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-06 19:55:45 -0700 |
commit | 1b6f064cd4c3993b60dda00146d15dfb001aade3 (patch) | |
tree | e76439e26d0dcfcc7419aab9068edc470feee28a | |
parent | 138887d13f8c154462d87ccec050b2e541d98341 (diff) | |
parent | 9fae341c1a958285d93d86698ea7ff28dc4bde89 (diff) | |
download | android_packages_apps_Snap-1b6f064cd4c3993b60dda00146d15dfb001aade3.tar.gz android_packages_apps_Snap-1b6f064cd4c3993b60dda00146d15dfb001aade3.tar.bz2 android_packages_apps_Snap-1b6f064cd4c3993b60dda00146d15dfb001aade3.zip |
Merge "Check number of exif tag in test" into gb-ub-photos-arches
-rw-r--r-- | tests/src/com/android/gallery3d/exif/ExifParserTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/src/com/android/gallery3d/exif/ExifParserTest.java b/tests/src/com/android/gallery3d/exif/ExifParserTest.java index f89b1a227..3c9d276e5 100644 --- a/tests/src/com/android/gallery3d/exif/ExifParserTest.java +++ b/tests/src/com/android/gallery3d/exif/ExifParserTest.java @@ -115,6 +115,7 @@ public class ExifParserTest extends ActivityTestCase { private void parseIfd0(IfdParser ifdParser) throws IOException, ExifInvalidFormatException { int type = ifdParser.next(); + int tagNumber=0; while (type != IfdParser.TYPE_END) { switch (type) { case IfdParser.TYPE_NEW_TAG: @@ -123,6 +124,7 @@ public class ExifParserTest extends ActivityTestCase { ifdParser.waitValueOfTag(tag); } else { checkTag(tag, ifdParser, IFD0_VALUE); + tagNumber++; } break; case IfdParser.TYPE_NEXT_IFD: @@ -135,15 +137,18 @@ public class ExifParserTest extends ActivityTestCase { break; case IfdParser.TYPE_VALUE_OF_PREV_TAG: checkTag(ifdParser.getCorrespodingExifTag(), ifdParser, IFD0_VALUE); + tagNumber++; break; } type = ifdParser.next(); } + assertEquals(IFD0_VALUE.size(), tagNumber); } private void parseIfd1(IfdParser ifdParser) throws IOException, ExifInvalidFormatException { int type = ifdParser.next(); + int tagNumber = 0; while (type != IfdParser.TYPE_END) { switch (type) { case IfdParser.TYPE_NEW_TAG: @@ -152,6 +157,7 @@ public class ExifParserTest extends ActivityTestCase { ifdParser.waitValueOfTag(tag); } else { checkTag(tag, ifdParser, IFD1_VALUE); + tagNumber++; } break; case IfdParser.TYPE_NEXT_IFD: @@ -162,15 +168,18 @@ public class ExifParserTest extends ActivityTestCase { break; case IfdParser.TYPE_VALUE_OF_PREV_TAG: checkTag(ifdParser.getCorrespodingExifTag(), ifdParser, IFD1_VALUE); + tagNumber++; break; } type = ifdParser.next(); } + assertEquals(IFD1_VALUE.size(), tagNumber); } private void parseExifIfd(IfdParser ifdParser) throws IOException, ExifInvalidFormatException { int type = ifdParser.next(); + int tagNumber = 0; while (type != IfdParser.TYPE_END) { switch (type) { case IfdParser.TYPE_NEW_TAG: @@ -179,6 +188,7 @@ public class ExifParserTest extends ActivityTestCase { ifdParser.waitValueOfTag(tag); } else { checkTag(tag, ifdParser, EXIF_IFD_VALUE); + tagNumber++; } break; case IfdParser.TYPE_NEXT_IFD: @@ -189,10 +199,12 @@ public class ExifParserTest extends ActivityTestCase { break; case IfdParser.TYPE_VALUE_OF_PREV_TAG: checkTag(ifdParser.getCorrespodingExifTag(), ifdParser, EXIF_IFD_VALUE); + tagNumber++; break; } type = ifdParser.next(); } + assertEquals(EXIF_IFD_VALUE.size(), tagNumber); } private void checkTag(ExifTag tag, IfdParser ifdParser, HashMap<Short, String> truth) |