summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2010-11-26 14:14:16 +0800
committerWu-cheng Li <wuchengli@google.com>2010-11-29 14:00:07 +0800
commit2ff6c061fe55ad46b192961f27379853c20362bc (patch)
treee4da984bc1a1da5091a396a17e79155b9436c906 /tests
parent559f5cf9f42c4983eaef9e6e55ff3ba7c406426a (diff)
downloadLegacyCamera-2ff6c061fe55ad46b192961f27379853c20362bc.zip
LegacyCamera-2ff6c061fe55ad46b192961f27379853c20362bc.tar.gz
LegacyCamera-2ff6c061fe55ad46b192961f27379853c20362bc.tar.bz2
Log the exception stack so it is easier to debug.
Also remove unnecessary assertion. Change-Id: If7a51ecf1f884d8cc8804b79b7d6c6242ee626ed
Diffstat (limited to 'tests')
-rwxr-xr-xtests/src/com/android/camera/power/ImageAndVideoCapture.java9
-rwxr-xr-xtests/src/com/android/camera/stress/CameraLatency.java3
-rw-r--r--tests/src/com/android/camera/stress/CameraStartUp.java4
-rwxr-xr-xtests/src/com/android/camera/stress/ImageCapture.java9
-rwxr-xr-xtests/src/com/android/camera/stress/SwitchPreview.java5
5 files changed, 12 insertions, 18 deletions
diff --git a/tests/src/com/android/camera/power/ImageAndVideoCapture.java b/tests/src/com/android/camera/power/ImageAndVideoCapture.java
index f814107..2cce126 100755
--- a/tests/src/com/android/camera/power/ImageAndVideoCapture.java
+++ b/tests/src/com/android/camera/power/ImageAndVideoCapture.java
@@ -66,10 +66,9 @@ public class ImageAndVideoCapture extends ActivityInstrumentationTestCase2 <Came
try {
Thread.sleep(WAIT_FOR_STABLE_STATE);
} catch (Exception e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
assertTrue("testImageCaptureDoNothing", false);
}
- assertTrue("testImageCaptureDoNothing", true);
}
@LargeTest
@@ -85,10 +84,9 @@ public class ImageAndVideoCapture extends ActivityInstrumentationTestCase2 <Came
}
Thread.sleep(WAIT_FOR_STABLE_STATE);
} catch (Exception e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
assertTrue("testImageCapture", false);
}
- assertTrue("testImageCapture", true);
}
@LargeTest
@@ -111,9 +109,8 @@ public class ImageAndVideoCapture extends ActivityInstrumentationTestCase2 <Came
}
Thread.sleep(WAIT_FOR_STABLE_STATE);
} catch (Exception e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
assertTrue("testVideoCapture", false);
}
- assertTrue("testVideoCapture", true);
}
}
diff --git a/tests/src/com/android/camera/stress/CameraLatency.java b/tests/src/com/android/camera/stress/CameraLatency.java
index 1d0daab..24def76 100755
--- a/tests/src/com/android/camera/stress/CameraLatency.java
+++ b/tests/src/com/android/camera/stress/CameraLatency.java
@@ -90,7 +90,7 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> {
}
}
} catch (Exception e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
}
//ToDO: yslau
//1) Need to get the baseline from the cupcake so that we can add the
@@ -135,7 +135,6 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> {
Log.v(TAG, "Avg mPictureDisplayedToJpegCallbackTime = "
+ mAvgPictureDisplayedToJpegCallbackTime);
Log.v(TAG, "Avg mJpegCallbackFinishTime = " + mAvgJpegCallbackFinishTime);
- assertTrue("testImageCapture", true);
}
}
diff --git a/tests/src/com/android/camera/stress/CameraStartUp.java b/tests/src/com/android/camera/stress/CameraStartUp.java
index 90e3892..3e1ae25 100644
--- a/tests/src/com/android/camera/stress/CameraStartUp.java
+++ b/tests/src/com/android/camera/stress/CameraStartUp.java
@@ -42,7 +42,7 @@ public class CameraStartUp extends InstrumentationTestCase {
Thread.sleep(1000);
Log.v(TAG, "camera startup time: " + startupTime);
} catch (Exception e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
fail("Fails to get the output file");
}
return startupTime;
@@ -66,7 +66,7 @@ public class CameraStartUp extends InstrumentationTestCase {
Thread.sleep(WAIT_TIME_FOR_PREVIEW);
Log.v(TAG, "video startup time: " + startupTime);
} catch (Exception e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
fail("Fails to launch video output file");
}
return startupTime;
diff --git a/tests/src/com/android/camera/stress/ImageCapture.java b/tests/src/com/android/camera/stress/ImageCapture.java
index 32500a6..dfe3ed6 100755
--- a/tests/src/com/android/camera/stress/ImageCapture.java
+++ b/tests/src/com/android/camera/stress/ImageCapture.java
@@ -113,7 +113,7 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> {
//Write to file output
output.write(memusage);
} catch (Exception e) {
- e.toString();
+ Log.v(TAG, "Got exception", e);
}
}
@@ -131,7 +131,7 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> {
}
memoryUsage = sb.toString();
} catch (IOException e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
}
String[] poList = memoryUsage.split("\r|\n|\r\n");
String memusage = poList[1].concat("\n");
@@ -224,10 +224,9 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> {
output.close();
assertTrue("Camera image capture memory test", memoryResult);
} catch (Exception e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
assertTrue("testImageCapture", false);
}
- assertTrue("testImageCapture", true);
}
@LargeTest
@@ -275,7 +274,7 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> {
output.close();
assertTrue("Camera video capture memory test", memoryResult);
} catch (Exception e) {
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
fail("Fails to capture video");
}
}
diff --git a/tests/src/com/android/camera/stress/SwitchPreview.java b/tests/src/com/android/camera/stress/SwitchPreview.java
index 0ffe0ac..6af915e 100755
--- a/tests/src/com/android/camera/stress/SwitchPreview.java
+++ b/tests/src/com/android/camera/stress/SwitchPreview.java
@@ -72,7 +72,7 @@ public class SwitchPreview extends ActivityInstrumentationTestCase2 <VideoCamera
mfstream = new FileWriter(CAMERA_TEST_OUTPUT_FILE, true);
mOut = new BufferedWriter(mfstream);
} catch (Exception e){
- assertTrue("Camera Switch Mode",false);
+ assertTrue("Camera Switch Mode", false);
}
}
@@ -108,8 +108,7 @@ public class SwitchPreview extends ActivityInstrumentationTestCase2 <VideoCamera
mOut.flush();
}
} catch (Exception e){
- Log.v(TAG, e.toString());
+ Log.v(TAG, "Got exception", e);
}
- assertTrue("testSwitchMode",true);
}
}