summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/camera/UnitTests.java4
-rw-r--r--tests/src/com/android/camera/unittest/CameraTest.java26
2 files changed, 28 insertions, 2 deletions
diff --git a/tests/src/com/android/camera/UnitTests.java b/tests/src/com/android/camera/UnitTests.java
index aeed001..4fc0e7d 100644
--- a/tests/src/com/android/camera/UnitTests.java
+++ b/tests/src/com/android/camera/UnitTests.java
@@ -28,8 +28,8 @@ public class UnitTests extends TestSuite {
public static Test suite() {
return new UnitTestSuiteBuilder(UnitTests.class)
- .includeAllPackagesUnderHere()
- .excludePackages("com.android.camera.stress")
+ .includePackages("com.android.camera.unittest",
+ "com.android.camera.gallery")
.named("Camera Unit Tests")
.build();
}
diff --git a/tests/src/com/android/camera/unittest/CameraTest.java b/tests/src/com/android/camera/unittest/CameraTest.java
new file mode 100644
index 0000000..0e851e4
--- /dev/null
+++ b/tests/src/com/android/camera/unittest/CameraTest.java
@@ -0,0 +1,26 @@
+package com.android.camera.unittest;
+
+import com.android.camera.Camera;
+
+import android.test.suitebuilder.annotation.SmallTest;
+
+import junit.framework.TestCase;
+
+@SmallTest
+public class CameraTest extends TestCase {
+ public void testRoundOrientation() {
+ assertEquals(0, Camera.roundOrientation(0));
+ assertEquals(0, Camera.roundOrientation(0 + 44));
+ assertEquals(90, Camera.roundOrientation(0 + 45));
+ assertEquals(90, Camera.roundOrientation(90));
+ assertEquals(90, Camera.roundOrientation(90 + 44));
+ assertEquals(180, Camera.roundOrientation(90 + 45));
+ assertEquals(180, Camera.roundOrientation(180));
+ assertEquals(180, Camera.roundOrientation(180 + 44));
+ assertEquals(270, Camera.roundOrientation(180 + 45));
+ assertEquals(270, Camera.roundOrientation(270));
+ assertEquals(270, Camera.roundOrientation(270 + 44));
+ assertEquals(0, Camera.roundOrientation(270 + 45));
+ assertEquals(0, Camera.roundOrientation(359));
+ }
+}