Adds CommandTests to the C++ Integration Test Suite

Also adds/updates some comments in the Java Command Tests

Change-Id: I24ae6cce06b8d5251e1cb115cd725f24a871635f
This commit is contained in:
Jonathan Leitschuh
2014-06-23 15:12:58 -04:00
parent 801efe601a
commit 61ca865117
6 changed files with 563 additions and 4 deletions

View File

@@ -0,0 +1,51 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2014. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#include "command/MockCommand.h"
MockCommand::MockCommand(){
m_initializeCount = 0;
m_executeCount = 0;
m_isFinishedCount = 0;
m_hasFinished = false;
m_endCount = 0;
m_interruptedCount = 0;
}
void MockCommand::Initialize(){
++m_initializeCount;
}
void MockCommand::Execute(){
++m_executeCount;
}
bool MockCommand::IsFinished(){
++m_isFinishedCount;
return IsHasFinished();
}
void MockCommand::End(){
++m_endCount;
}
void MockCommand::Interrupted(){
++m_interruptedCount;
}
bool MockCommand::HasInitialized(){
return GetInitializeCount()>0;
}
bool MockCommand::HasEnd(){
return GetEndCount()>0;
}
bool MockCommand::HasInterrupted(){
return GetInterruptedCount()>0;
}