summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEarl Ou <shunhsingou@google.com>2012-10-19 16:49:34 +0800
committerEarl Ou <shunhsingou@google.com>2012-10-31 10:14:06 +0800
commit1927ec5dc5ae1d202f6a0e2a55a2e8d834f6ce60 (patch)
tree78adfe495dbf8955cf018e4bb9700fce6a66dd32 /tests
parente4084d2752689f01f38ad0b929acfb8a30625afb (diff)
downloadandroid_packages_apps_Snap-1927ec5dc5ae1d202f6a0e2a55a2e8d834f6ce60.zip
android_packages_apps_Snap-1927ec5dc5ae1d202f6a0e2a55a2e8d834f6ce60.tar.gz
android_packages_apps_Snap-1927ec5dc5ae1d202f6a0e2a55a2e8d834f6ce60.tar.bz2
print image path when setup error in Exif test
Change-Id: Ia4391571695ea518eac53f2b8c6b1a2acb5159c1
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java b/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java
index 5b61778..6a4d29e 100644
--- a/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java
+++ b/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java
@@ -63,15 +63,19 @@ public class ExifXmlDataTestCase extends InstrumentationTestCase {
@Override
public void setUp() throws Exception {
- if (mImagePath != null) {
- mImageInputStream = new FileInputStream(mImagePath);
- mXmlInputStream = new FileInputStream(mXmlPath);
- mXmlParser = Xml.newPullParser();
- mXmlParser.setInput(new InputStreamReader(mXmlInputStream));
- } else {
- Resources res = getInstrumentation().getContext().getResources();
- mImageInputStream = res.openRawResource(mImageResourceId);
- mXmlParser = res.getXml(mXmlResourceId);
+ try {
+ if (mImagePath != null) {
+ mImageInputStream = new FileInputStream(mImagePath);
+ mXmlInputStream = new FileInputStream(mXmlPath);
+ mXmlParser = Xml.newPullParser();
+ mXmlParser.setInput(new InputStreamReader(mXmlInputStream));
+ } else {
+ Resources res = getInstrumentation().getContext().getResources();
+ mImageInputStream = res.openRawResource(mImageResourceId);
+ mXmlParser = res.getXml(mXmlResourceId);
+ }
+ } catch (Exception e) {
+ throw new Exception(getImageTitle(), e);
}
}