{
Range range = TestCamera.Settings.PanRange;
- /* TESTCODE
- * Test Absolute Pan Type.
- */
- int val = 1;
- TestCamera.Settings.SetPan(CameraPtzMoveType.Absoulute, val);
- Assert.AreEqual(val, TestCamera.Settings.GetPan(), "Pan should be same as set value");
+ int absPan = range.Min + 1;
+ TestCamera.Settings.SetPan(CameraPtzMoveType.Absoulute, absPan);
+ Assert.AreEqual(absPan, TestCamera.Settings.GetPan(), "Pan should be same as set value");
- /* TESTCODE
- * Test Relative Pan Type.
- */
- TestCamera.Settings.SetPan(CameraPtzMoveType.Relative, val);
- Assert.AreEqual(val, TestCamera.Settings.GetPan(), "Pan should be same as set value");
+ int relPan = range.Min + 1;
+ TestCamera.Settings.SetPan(CameraPtzMoveType.Relative, relPan);
+ Assert.AreEqual(absPan + relPan, TestCamera.Settings.GetPan(),
+ "Relative Pan value should be same as set value based on current pan value");
}
catch (NotSupportedException)
{
{
Range range = TestCamera.Settings.TiltRange;
- int val = 1;
- TestCamera.Settings.SetTilt(CameraPtzMoveType.Absoulute, val);
- Assert.AreEqual(val, TestCamera.Settings.GetTilt(), "Tilt should be same as set value");
+ int absPan = range.Min + 1;
+ TestCamera.Settings.SetTilt(CameraPtzMoveType.Absoulute, absPan);
+ Assert.AreEqual(absPan, TestCamera.Settings.GetTilt(), "Tilt should be same as set value");
- TestCamera.Settings.SetTilt(CameraPtzMoveType.Relative, val);
- Assert.AreEqual(val, TestCamera.Settings.GetTilt(), "Tilt should be same as set value");
+ int relPan = range.Min + 1;
+ TestCamera.Settings.SetTilt(CameraPtzMoveType.Relative, relPan);
+ Assert.AreEqual(absPan + relPan, TestCamera.Settings.GetTilt(),
+ "Relative Tilt value should be same as set value based on current pan value");
}
catch (NotSupportedException)
{
[Property("AUTHOR", "Vivek Ellur, vivek.ellur@samsung.com")]
public void PtzType_PROPERTY_SET_ENUM_ALL()
{
- try
- {
- TestCamera.Settings.PtzType = CameraPtzType.Mechanical;
- }
- catch (NotSupportedException)
+ foreach ( CameraPtzType type in Enum.GetValues(typeof(CameraPtzType)))
{
- Assert.Pass("Ptz feature is not supported.");
- }
-
- try
- {
- TestCamera.Settings.PtzType = CameraPtzType.Electronic;
- }
- catch (NotSupportedException)
- {
- Assert.Pass("Ptz feature is not supported.");
+ try
+ {
+ TestCamera.Settings.PtzType = type;
+ }
+ catch (NotSupportedException)
+ {
+ Log.Info("Tizen.Camera.Tests", type + " is not supported.");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("PtzType setting is failed. " + e.Message);
+ }
}
}