RTXI  2.4
The Real-Time eXperiment Interface Documentation
system_tests.h
Go to the documentation of this file.
1 /*
2  The Real-Time eXperiment Interface (RTXI)
3  Copyright (C) 2011 Georgia Institute of Technology, University of Utah, Weill Cornell Medical College
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  */
19 
20 #ifndef SYSTEM_TESTS_H
21 #define SYSTEM_TESTS_H
22 
23 #include <gtest/gtest.h>
24 #include <gmock/gmock.h>
25 #include <rt.h>
26 #include <event.h>
27 
28 // Define all fixtures for testing purposes
29 class SystemTest : public ::testing::Test
30 {
31 protected:
34  }
36 
38 };
39 
40 class MockRTEvent : public RT::Event
41 {
42 public:
43  MOCK_METHOD(int, callback, (), (override));
44 };
45 
46 class MockRTDevice : public RT::Device
47 {
48 public:
49  MOCK_METHOD(void, read, (), (override));
50  MOCK_METHOD(void, write, (), (override));
51 };
52 
53 class MockRTThread : public RT::Thread
54 {
55 public:
56  MOCK_METHOD(unsigned long, getPriority, (), (const));
57  MOCK_METHOD(void, execute, (), (override));
58 };
59 
60 #endif
RT::Event
Definition: rt.h:82
RT::System
Definition: rt.h:383
MockRTThread::MOCK_METHOD
MOCK_METHOD(unsigned long, getPriority,(),(const))
MockRTEvent
Definition: system_tests.h:40
RT::Device::read
virtual void read(void)
Definition: rt.h:541
RT::Device::write
virtual void write(void)
Definition: rt.h:542
RT::Event::callback
virtual int callback(void)=0
SystemTest::SystemTest
SystemTest()
Definition: system_tests.h:32
RT::Device
Definition: rt.h:517
RT::System::getInstance
static System * getInstance(void)
Definition: rt.cpp:361
MockRTThread
Definition: system_tests.h:53
event.h
SystemTest
Definition: system_tests.h:29
SystemTest::system
RT::System * system
Definition: system_tests.h:37
MockRTDevice
Definition: system_tests.h:46
rt.h
SystemTest::~SystemTest
~SystemTest()
Definition: system_tests.h:35
RT::Thread
Definition: rt.h:561
MockRTDevice::MOCK_METHOD
MOCK_METHOD(void, read,(),(override))
RT::Thread::getPriority
Priority getPriority(void) const
Definition: rt.h:582
MockRTEvent::MOCK_METHOD
MOCK_METHOD(int, callback,(),(override))
RT::Thread::execute
virtual void execute(void)
Definition: rt.h:598