[aravis/aravis-0-2] tests: add a test for && entities.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis/aravis-0-2] tests: add a test for && entities.
- Date: Mon, 29 Apr 2013 18:31:54 +0000 (UTC)
commit a62562542839bb670d2e20d0f033f49ca8f50aaf
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Mon Apr 29 20:28:04 2013 +0200
tests: add a test for && entities.
tests/data/genicam.xml | 338 ++++++++++++++++++++++++------------------------
tests/genicam.c | 6 +
2 files changed, 177 insertions(+), 167 deletions(-)
---
diff --git a/tests/data/genicam.xml b/tests/data/genicam.xml
index ff6e807..d229419 100644
--- a/tests/data/genicam.xml
+++ b/tests/data/genicam.xml
@@ -1,167 +1,171 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<RegisterDescription
- ModelName="Model"
- VendorName="Emmanuel"
- StandardNameSpace="None"
- SchemaMajorVersion="1"
- SchemaMinorVersion="0"
- SchemaSubMinorVersion="0"
- MajorVersion="292"
- MinorVersion="0"
- SubMinorVersion="0"
- ToolTip="TestTooltip"
- ProductGuid="111-222"
- VersionGuid="222-333"
- xmlns="http://www.genicam.org/GenApi/Version_1_0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.genicam.org/GenApi/Version_1_0 GenApiSchema.xsd">
-
- <Category Name="Root" NameSpace="Standard">
- <pFeature>RWFloat</pFeature>
- <pFeature>RWBoolean</pFeature>
- <pFeature>RWInteger</pFeature>
- <pFeature>Enumeration</pFeature>
- </Category>
-
- <Float Name="RWFloat">
- <Value>0.1</Value>
- <Min>-10.0</Min>
- <Max>10.0</Max>
- <Inc>2.0</Inc>
- </Float>
-
- <Float Name="P_RWFloat_Min">
- <Value>-20.0</Value>
- </Float>
-
- <Float Name="P_RWFloat_Max">
- <Value>20.0</Value>
- </Float>
-
- <Float Name="P_RWFloat_Inc">
- <Value>3.0</Value>
- </Float>
-
- <Float Name="P_RWFloat">
- <pValue>RWFloat</pValue>
- <pMin>P_RWFloat_Min</pMin>
- <pMax>P_RWFloat_Max</pMax>
- <pInc>P_RWFloat_Inc</pInc>
- </Float>
-
- <Boolean Name="RWBoolean">
- <Value>1</Value>
- </Boolean>
-
- <Integer Name="RWBooleanValue">
- <Value>23</Value>
- </Integer>
-
- <Boolean Name="P_RWBoolean">
- <pValue>RWBooleanValue</pValue>
- <OnValue>23</OnValue>
- <OffValue>42</OffValue>
- </Boolean>
-
- <Integer Name="RWInteger">
- <Value>1</Value>
- <Min>-10</Min>
- <Max>10</Max>
- <Inc>2</Inc>
- </Integer>
-
- <Integer Name="P_RWInteger_Min">
- <Value>-20</Value>
- </Integer>
-
- <Integer Name="P_RWInteger_Max">
- <Value>20</Value>
- </Integer>
-
- <Integer Name="P_RWInteger_Inc">
- <Value>3</Value>
- </Integer>
-
- <Integer Name="P_RWInteger">
- <pValue>RWInteger</pValue>
- <pMin>P_RWInteger_Min</pMin>
- <pMax>P_RWInteger_Max</pMax>
- <pInc>P_RWInteger_Inc</pInc>
- </Integer>
-
- <Enumeration Name="Enumeration">
- <EnumEntry Name="Entry0">
- <Value>0</Value>
- </EnumEntry>
- <EnumEntry Name="Entry1">
- <Value>1</Value>
- </EnumEntry>
- <EnumEntry Name="EntryNotAvailable">
- <pIsAvailable>NotAvailable</pIsAvailable>
- <Value>2</Value>
- </EnumEntry>
- <EnumEntry Name="EntryNotImplemented">
- <pIsImplemented>NotAvailable</pIsImplemented>
- <Value>3</Value>
- </EnumEntry>
- <pValue>EnumerationValue</pValue>
- </Enumeration>
-
- <Integer Name="NotImplemented">
- <Value>0</Value>
- </Integer>
-
- <Integer Name="NotAvailable">
- <Value>0</Value>
- </Integer>
-
- <Integer Name="EnumerationValue">
- <Value>0</Value>
- </Integer>
-
- <Integer Name="IntRegisterAddress">
- <Value>0x50</Value>
- </Integer>
-
- <IntReg Name="IntRegisterA">
- <Address>0x1000</Address>
- <pAddress>IntRegisterAddress</pAddress>
- <Length>8</Length>
- <AccessMode>RW</AccessMode>
- <Cachable>NoCache</Cachable>
- <PollingTime>5</PollingTime>
- <Sign>Unsigned</Sign>
- <Endianess>BigEndian</Endianess>
- </IntReg>
-
- <IntReg Name="IntRegisterB">
- <Address>0x2000</Address>
- <IntSwissKnife Name="IntRegisterBAddress">
- <Formula>0xff</Formula>
- </IntSwissKnife>
- <Length>8</Length>
- <AccessMode>RW</AccessMode>
- <Cachable>NoCache</Cachable>
- <PollingTime>5</PollingTime>
- <Sign>Unsigned</Sign>
- <Endianess>BigEndian</Endianess>
- </IntReg>
-
- <IntSwissKnife Name="IntSwissKnifeTestEntity">
- <Formula>(0x12345678 & 0x10305070)</Formula>
- </IntSwissKnife>
-
- <IntSwissKnife Name="IntSwissKnifeTest">
- <Formula>0x1234</Formula>
- </IntSwissKnife>
-
- <Integer Name="TLParamsLocked">
- <ToolTip> Indicates whether a live grab is under way</ToolTip>
- <Visibility>Invisible</Visibility>
- <Value>0</Value>
- <Min>0</Min>
- <Max>1</Max>
- </Integer>
-
-</RegisterDescription>
+<?xml version="1.0" encoding="utf-8"?>
+
+<RegisterDescription
+ ModelName="Model"
+ VendorName="Emmanuel"
+ StandardNameSpace="None"
+ SchemaMajorVersion="1"
+ SchemaMinorVersion="0"
+ SchemaSubMinorVersion="0"
+ MajorVersion="292"
+ MinorVersion="0"
+ SubMinorVersion="0"
+ ToolTip="TestTooltip"
+ ProductGuid="111-222"
+ VersionGuid="222-333"
+ xmlns="http://www.genicam.org/GenApi/Version_1_0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.genicam.org/GenApi/Version_1_0 GenApiSchema.xsd">
+
+ <Category Name="Root" NameSpace="Standard">
+ <pFeature>RWFloat</pFeature>
+ <pFeature>RWBoolean</pFeature>
+ <pFeature>RWInteger</pFeature>
+ <pFeature>Enumeration</pFeature>
+ </Category>
+
+ <Float Name="RWFloat">
+ <Value>0.1</Value>
+ <Min>-10.0</Min>
+ <Max>10.0</Max>
+ <Inc>2.0</Inc>
+ </Float>
+
+ <Float Name="P_RWFloat_Min">
+ <Value>-20.0</Value>
+ </Float>
+
+ <Float Name="P_RWFloat_Max">
+ <Value>20.0</Value>
+ </Float>
+
+ <Float Name="P_RWFloat_Inc">
+ <Value>3.0</Value>
+ </Float>
+
+ <Float Name="P_RWFloat">
+ <pValue>RWFloat</pValue>
+ <pMin>P_RWFloat_Min</pMin>
+ <pMax>P_RWFloat_Max</pMax>
+ <pInc>P_RWFloat_Inc</pInc>
+ </Float>
+
+ <Boolean Name="RWBoolean">
+ <Value>1</Value>
+ </Boolean>
+
+ <Integer Name="RWBooleanValue">
+ <Value>23</Value>
+ </Integer>
+
+ <Boolean Name="P_RWBoolean">
+ <pValue>RWBooleanValue</pValue>
+ <OnValue>23</OnValue>
+ <OffValue>42</OffValue>
+ </Boolean>
+
+ <Integer Name="RWInteger">
+ <Value>1</Value>
+ <Min>-10</Min>
+ <Max>10</Max>
+ <Inc>2</Inc>
+ </Integer>
+
+ <Integer Name="P_RWInteger_Min">
+ <Value>-20</Value>
+ </Integer>
+
+ <Integer Name="P_RWInteger_Max">
+ <Value>20</Value>
+ </Integer>
+
+ <Integer Name="P_RWInteger_Inc">
+ <Value>3</Value>
+ </Integer>
+
+ <Integer Name="P_RWInteger">
+ <pValue>RWInteger</pValue>
+ <pMin>P_RWInteger_Min</pMin>
+ <pMax>P_RWInteger_Max</pMax>
+ <pInc>P_RWInteger_Inc</pInc>
+ </Integer>
+
+ <Enumeration Name="Enumeration">
+ <EnumEntry Name="Entry0">
+ <Value>0</Value>
+ </EnumEntry>
+ <EnumEntry Name="Entry1">
+ <Value>1</Value>
+ </EnumEntry>
+ <EnumEntry Name="EntryNotAvailable">
+ <pIsAvailable>NotAvailable</pIsAvailable>
+ <Value>2</Value>
+ </EnumEntry>
+ <EnumEntry Name="EntryNotImplemented">
+ <pIsImplemented>NotAvailable</pIsImplemented>
+ <Value>3</Value>
+ </EnumEntry>
+ <pValue>EnumerationValue</pValue>
+ </Enumeration>
+
+ <Integer Name="NotImplemented">
+ <Value>0</Value>
+ </Integer>
+
+ <Integer Name="NotAvailable">
+ <Value>0</Value>
+ </Integer>
+
+ <Integer Name="EnumerationValue">
+ <Value>0</Value>
+ </Integer>
+
+ <Integer Name="IntRegisterAddress">
+ <Value>0x50</Value>
+ </Integer>
+
+ <IntReg Name="IntRegisterA">
+ <Address>0x1000</Address>
+ <pAddress>IntRegisterAddress</pAddress>
+ <Length>8</Length>
+ <AccessMode>RW</AccessMode>
+ <Cachable>NoCache</Cachable>
+ <PollingTime>5</PollingTime>
+ <Sign>Unsigned</Sign>
+ <Endianess>BigEndian</Endianess>
+ </IntReg>
+
+ <IntReg Name="IntRegisterB">
+ <Address>0x2000</Address>
+ <IntSwissKnife Name="IntRegisterBAddress">
+ <Formula>0xff</Formula>
+ </IntSwissKnife>
+ <Length>8</Length>
+ <AccessMode>RW</AccessMode>
+ <Cachable>NoCache</Cachable>
+ <PollingTime>5</PollingTime>
+ <Sign>Unsigned</Sign>
+ <Endianess>BigEndian</Endianess>
+ </IntReg>
+
+ <IntSwissKnife Name="IntSwissKnifeTestEntity">
+ <Formula>(0x12345678 & 0x10305070)</Formula>
+ </IntSwissKnife>
+
+ <IntSwissKnife Name="IntSwissKnifeTestEntity2">
+ <Formula>(0 && 1)?2:3</Formula>
+ </IntSwissKnife>
+
+ <IntSwissKnife Name="IntSwissKnifeTest">
+ <Formula>0x1234</Formula>
+ </IntSwissKnife>
+
+ <Integer Name="TLParamsLocked">
+ <ToolTip> Indicates whether a live grab is under way</ToolTip>
+ <Visibility>Invisible</Visibility>
+ <Value>0</Value>
+ <Min>0</Min>
+ <Max>1</Max>
+ </Integer>
+
+</RegisterDescription>
diff --git a/tests/genicam.c b/tests/genicam.c
index 47b633e..1843d7f 100644
--- a/tests/genicam.c
+++ b/tests/genicam.c
@@ -250,6 +250,12 @@ swiss_knife_test (void)
value = arv_gc_integer_get_value (ARV_GC_INTEGER (node), NULL);
g_assert_cmpint (value, ==, 0x10305070);
+ node = arv_gc_get_node (genicam, "IntSwissKnifeTestEntity2");
+ g_assert (ARV_IS_GC_SWISS_KNIFE (node));
+
+ value = arv_gc_integer_get_value (ARV_GC_INTEGER (node), NULL);
+ g_assert_cmpint (value, ==, 3);
+
g_object_unref (device);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]