From 2ff6c061fe55ad46b192961f27379853c20362bc Mon Sep 17 00:00:00 2001 From: Wu-cheng Li Date: Fri, 26 Nov 2010 14:14:16 +0800 Subject: Log the exception stack so it is easier to debug. Also remove unnecessary assertion. Change-Id: If7a51ecf1f884d8cc8804b79b7d6c6242ee626ed --- tests/src/com/android/camera/power/ImageAndVideoCapture.java | 9 +++------ tests/src/com/android/camera/stress/CameraLatency.java | 3 +-- tests/src/com/android/camera/stress/CameraStartUp.java | 4 ++-- tests/src/com/android/camera/stress/ImageCapture.java | 9 ++++----- tests/src/com/android/camera/stress/SwitchPreview.java | 5 ++--- 5 files changed, 12 insertions(+), 18 deletions(-) (limited to 'tests') 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 { } } } 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 { 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 { //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 { } 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 { 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 { 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