[aravis/dom] tests: exercize OnValue and OffValue of Boolean nodes.



commit d5572bc5d77709ff556d2344ebc3b73804d1d43d
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Mon Mar 5 10:26:37 2012 +0100

    tests: exercize OnValue and OffValue of Boolean nodes.

 tests/data/genicam.xml |    4 +++-
 tests/genicam.c        |    9 +++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/tests/data/genicam.xml b/tests/data/genicam.xml
index 46fb67a..5001a84 100644
--- a/tests/data/genicam.xml
+++ b/tests/data/genicam.xml
@@ -35,11 +35,13 @@
 	</Boolean>
 
 	<Integer Name="RWBooleanValue">
-		<Value>1</Value>
+		<Value>23</Value>
 	</Integer>
 
 	<Boolean Name="P_RWBoolean">
 		<pValue>RWBooleanValue</pValue>
+		<OnValue>23</OnValue>
+		<OffValue>42</OffValue>
 	</Boolean>
 
 	<Integer Name="RWInteger">
diff --git a/tests/genicam.c b/tests/genicam.c
index 53d6ed9..c6f10cf 100644
--- a/tests/genicam.c
+++ b/tests/genicam.c
@@ -44,6 +44,7 @@ boolean_test (void)
 	ArvDevice *device;
 	ArvGc *genicam;
 	ArvGcNode *node;
+	ArvGcNode *node_b;
 	gboolean v_boolean;
 	const char *v_string;
 
@@ -75,6 +76,14 @@ boolean_test (void)
 	v_boolean = arv_gc_boolean_get_value (ARV_GC_BOOLEAN (node));
 	g_assert_cmpint (v_boolean, ==, TRUE);
 
+	node_b = arv_gc_get_node (genicam, "RWBooleanValue");
+	g_assert (ARV_IS_GC_INTEGER (node_b));
+
+	arv_gc_integer_set_value (ARV_GC_INTEGER (node_b), 42);
+
+	v_boolean = arv_gc_boolean_get_value (ARV_GC_BOOLEAN (node));
+	g_assert_cmpint (v_boolean, ==, FALSE);
+
 	g_object_unref (device);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]