summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/camera/unittest/CameraTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/com/android/camera/unittest/CameraTest.java')
-rw-r--r--tests/src/com/android/camera/unittest/CameraTest.java26
1 files changed, 26 insertions, 0 deletions
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));
+ }
+}