Main Page
Namespaces
Classes
Files
File List
OpenRTM_aist
test
test_CdrRingBuffer.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# -*- Python -*-
3
4
# \file test_CdrRingBuffer.py
5
# \brief test of CdrRingBuffer class
6
# \date $Date: 2007/09/12 $
7
# \author Shinji Kurihara
8
#
9
# Copyright (C) 2006
10
# Noriaki Ando
11
# Task-intelligence Research Group,
12
# Intelligent Systems Research Institute,
13
# National Institute of
14
# Advanced Industrial Science and Technology (AIST), Japan
15
# All rights reserved.
16
#
17
18
import
sys
19
sys.path.insert(1,
"../"
)
20
21
import
unittest
22
23
from
CdrBufferBase
import
*
24
from
CdrRingBuffer
import
*
25
26
class
TestCdrRingBuffer
(unittest.TestCase):
27
def
setUp
(self):
28
CdrRingBufferInit
()
29
self.
_buff
= CdrBufferFactory.instance().createObject(
"ring_buffer"
)
30
31
32
def
test_write
(self):
33
self.assertEqual(self._buff.write(100),0)
34
35
36
def
test_read
(self):
37
data = [0]
38
self.assertEqual(self._buff.write(100),0)
39
self.assertEqual(self._buff.read(data), 0)
40
self.assertEqual(data[0], 100)
41
42
43
############### test #################
44
if
__name__ ==
'__main__'
:
45
unittest.main()
test_CdrRingBuffer.TestCdrRingBuffer.test_read
def test_read(self)
Definition:
test_CdrRingBuffer.py:36
test_CdrRingBuffer.TestCdrRingBuffer.test_write
def test_write(self)
Definition:
test_CdrRingBuffer.py:32
test_CdrRingBuffer.TestCdrRingBuffer
Definition:
test_CdrRingBuffer.py:26
OpenRTM_aist.CdrRingBuffer.CdrRingBufferInit
def CdrRingBufferInit()
Definition:
CdrRingBuffer.py:30
test_CdrRingBuffer.TestCdrRingBuffer._buff
_buff
Definition:
test_CdrRingBuffer.py:29
test_CdrRingBuffer.TestCdrRingBuffer.setUp
def setUp(self)
Definition:
test_CdrRingBuffer.py:27
openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:34