summaryrefslogtreecommitdiffstats
path: root/xml/test
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-03-03 10:34:49 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-03-03 10:34:49 +0100
commitee16e47966afe180d3c32e2b1d93301052894fac (patch)
tree56aecf261aaae57e28c08cef573ae6642ec5394d /xml/test
parent02d0026e2df2ba5c68c0c1a67aec4437c9e8e8f3 (diff)
parent195c28f3074486165b6e0935362810f8a1fb9531 (diff)
downloadpcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.gz
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.bz2
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.xz
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.zip
Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 369 revision
Diffstat (limited to 'xml/test')
-rw-r--r--xml/test/props.xml6
-rw-r--r--xml/test/test_prop2.py3
-rw-r--r--xml/test/test_prop4.py (renamed from xml/test/test_prop_mt.py)15
3 files changed, 9 insertions, 15 deletions
diff --git a/xml/test/props.xml b/xml/test/props.xml
index dc08cbe..750881d 100644
--- a/xml/test/props.xml
+++ b/xml/test/props.xml
@@ -3,9 +3,5 @@
<transform path="/test/prop1" register="test_prop1" unit="C" read_from_register="(503975./1024000)*${/registers/fpga/sensor_temperature:C} - 27315./100" description="formula to get real fpga temperature from the fpga_temperature register in decimal"/>
<transform path="/test/prop2" register="test_prop2" unit="C" script="test_prop2.py" description="test python script #1" write_verification="0" />
<transform path="/test/prop3" register="test_prop3" unit="C" script="test_prop3.py" description="test python script #2" />
- <transform path="/test/prop_mt"
- register="test_prop_mt"
- unit="C"
- script="test_prop_mt.py"
- description="Example of thread safe python property"/>
+ <transform path="/test/prop4" register="test_prop4" unit="C" script="test_prop4.py" description="Example of thread safe python property"/>
</model>
diff --git a/xml/test/test_prop2.py b/xml/test/test_prop2.py
index d78dbea..8a3ebf6 100644
--- a/xml/test/test_prop2.py
+++ b/xml/test/test_prop2.py
@@ -1,6 +1,5 @@
def read_from_register(ctx, value):
return ctx.get_property('/test/prop3') / 2
-
+
def write_to_register(ctx, value):
ctx.set_property(value*2, '/test/prop3')
-
diff --git a/xml/test/test_prop_mt.py b/xml/test/test_prop4.py
index 224a80c..30e9ece 100644
--- a/xml/test/test_prop_mt.py
+++ b/xml/test/test_prop4.py
@@ -4,21 +4,20 @@ lock = threading.Lock()
def read_from_register(ctx, value):
with lock:
- ctx.lock('lock12')
-
+ ctx.lock('test_prop4')
+
cur = read_from_register.counter
read_from_register.counter += 1
for i in range (0, 5):
time.sleep(0.1)
- print(cur)
out = ctx.get_property('/test/prop3') / 2
- ctx.unlock('lock12')
-
+
+ ctx.unlock('test_prop4')
+
return out
-
-
+
read_from_register.counter = 0
-
+
def write_to_register(ctx, value):
with lock:
ctx.set_property(value*2, '/test/prop3')