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):
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()


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:34