test_CdrRingBuffer.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- Python -*-
00003 
00004 # \file test_CdrRingBuffer.py
00005 # \brief test of CdrRingBuffer class
00006 # \date $Date: 2007/09/12 $
00007 # \author Shinji Kurihara
00008 #
00009 # Copyright (C) 2006
00010 #     Noriaki Ando
00011 #     Task-intelligence Research Group,
00012 #     Intelligent Systems Research Institute,
00013 #     National Institute of
00014 #         Advanced Industrial Science and Technology (AIST), Japan
00015 #     All rights reserved.
00016 #
00017   
00018 import sys
00019 sys.path.insert(1,"../")
00020 
00021 import unittest
00022 
00023 from CdrBufferBase import *
00024 from CdrRingBuffer import *
00025 
00026 class TestCdrRingBuffer(unittest.TestCase):
00027         def setUp(self):
00028                 CdrRingBufferInit()
00029                 self._buff = CdrBufferFactory.instance().createObject("ring_buffer")
00030 
00031 
00032         def test_write(self):
00033                 self.assertEqual(self._buff.write(100),0)
00034 
00035 
00036         def test_read(self):
00037                 data = [0]
00038                 self.assertEqual(self._buff.write(100),0)
00039                 self.assertEqual(self._buff.read(data), 0)
00040                 self.assertEqual(data[0], 100)
00041 
00042 
00043 ############### test #################
00044 if __name__ == '__main__':
00045         unittest.main()


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Aug 27 2015 14:17:28