[aravis/dom] tests: exercize linked feature in genicam files (pValue).
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis/dom] tests: exercize linked feature in genicam files (pValue).
- Date: Wed, 29 Feb 2012 10:28:10 +0000 (UTC)
commit 8b1f35bb76ee1ffa7686586ef3dafe7256574969
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Wed Feb 29 11:27:38 2012 +0100
tests: exercize linked feature in genicam files (pValue).
tests/data/genicam.xml | 12 ++++++++++++
tests/genicam.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/tests/data/genicam.xml b/tests/data/genicam.xml
index ceca502..640e480 100644
--- a/tests/data/genicam.xml
+++ b/tests/data/genicam.xml
@@ -26,14 +26,26 @@
<Value>0.1</Value>
</Float>
+ <Float Name="P_RWFloat">
+ <pValue>RWFloat</pValue>
+ </Float>
+
<Boolean Name="RWBoolean">
<Value>1</Value>
</Boolean>
+ <Boolean Name="P_RWBoolean">
+ <pValue>RWBoolean</pValue>
+ </Boolean>
+
<Integer Name="RWInteger">
<Value>1</Value>
</Integer>
+ <Integer Name="P_RWInteger">
+ <pValue>RWInteger</pValue>
+ </Integer>
+
<Enumeration Name="Enumeration">
<EnumEntry Name="Entry0">
<Value>0</Value>
diff --git a/tests/genicam.c b/tests/genicam.c
index 06e311a..c108387 100644
--- a/tests/genicam.c
+++ b/tests/genicam.c
@@ -25,6 +25,16 @@ integer_test (void)
v_string = arv_gc_feature_node_get_value_as_string (ARV_GC_FEATURE_NODE (node));
g_assert_cmpstr (v_string, ==, "1");
+ arv_gc_integer_set_value (ARV_GC_INTEGER (node), 2);
+ v_int64 = arv_gc_integer_get_value (ARV_GC_INTEGER (node));
+ g_assert_cmpint (v_int64, ==, 2);
+
+ node = arv_gc_get_node (genicam, "P_RWInteger");
+ g_assert (ARV_IS_GC_INTEGER_NODE (node));
+
+ v_int64 = arv_gc_integer_get_value (ARV_GC_INTEGER (node));
+ g_assert_cmpint (v_int64, ==, 2);
+
g_object_unref (device);
}
@@ -52,6 +62,19 @@ boolean_test (void)
v_string = arv_gc_feature_node_get_value_as_string (ARV_GC_FEATURE_NODE (node));
g_assert_cmpstr (v_string, ==, "true");
+ arv_gc_boolean_set_value (ARV_GC_BOOLEAN (node), 0);
+ v_boolean = arv_gc_boolean_get_value (ARV_GC_BOOLEAN (node));
+ g_assert_cmpint (v_boolean, ==, FALSE);
+
+ v_string = arv_gc_feature_node_get_value_as_string (ARV_GC_FEATURE_NODE (node));
+ g_assert_cmpstr (v_string, ==, "false");
+
+ node = arv_gc_get_node (genicam, "P_RWBoolean");
+ g_assert (ARV_IS_GC_BOOLEAN (node));
+
+ v_boolean = arv_gc_boolean_get_value (ARV_GC_BOOLEAN (node));
+ g_assert_cmpint (v_boolean, ==, FALSE);
+
g_object_unref (device);
}
@@ -79,6 +102,16 @@ float_test (void)
v_string = arv_gc_feature_node_get_value_as_string (ARV_GC_FEATURE_NODE (node));
g_assert_cmpstr (v_string, ==, "0.1");
+ arv_gc_float_set_value (ARV_GC_FLOAT (node), 0.2);
+ v_double = arv_gc_float_get_value (ARV_GC_FLOAT (node));
+ g_assert_cmpfloat (v_double, ==, 0.2);
+
+ node = arv_gc_get_node (genicam, "P_RWFloat");
+ g_assert (ARV_IS_GC_FLOAT_NODE (node));
+
+ v_double = arv_gc_float_get_value (ARV_GC_FLOAT (node));
+ g_assert_cmpfloat (v_double, ==, 0.2);
+
g_object_unref (device);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]