Namespace all wpilibc functions/classes into "frc" namespace. (#311)

Base.h provides a backwards compatibility shim (enabled unless
NAMESPACED_WPILIB is defined) that does a "using namespace frc".
However, as some header files do not include Base.h, this may
be a breaking change in some corner cases (with an easy fix).

Fixes #218.
This commit is contained in:
Peter Johnson
2016-11-01 22:33:12 -07:00
committed by GitHub
parent 36ad45c07d
commit 59267da72b
318 changed files with 988 additions and 10 deletions

View File

@@ -13,6 +13,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
static const double kDelayTime = 0.01;
/**

View File

@@ -13,6 +13,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
static const double kScale = 270.0;
static const double kAngle = 180.0;

View File

@@ -10,6 +10,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
static constexpr double kAccelerationTolerance = 0.1;
/**
* There's not much we can automatically test with the on-board accelerometer,

View File

@@ -11,6 +11,8 @@
#include "gtest/gtest.h"
using namespace frc;
static const std::array<double, 10> values = {
751.848, 766.366, 342.657, 234.252, 716.126,
132.344, 445.697, 22.727, 421.125, 799.913};

View File

@@ -14,6 +14,8 @@
#include "Victor.h"
#include "gtest/gtest.h"
using namespace frc;
static const double kMotorDelay = 2.5;
static const double kMaxPeriod = 2.0;

View File

@@ -14,6 +14,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
static const double kCounterTime = 0.001;
static const double kDelayTime = 0.1;

View File

@@ -12,6 +12,8 @@
#include "Encoder.h"
#include "gtest/gtest.h"
using namespace frc;
/**
* Tests that configuring inputs to be filtered succeeds.
*

View File

@@ -11,6 +11,8 @@
#include "Utility.h"
#include "gtest/gtest.h"
using namespace frc;
constexpr double TIMER_TOLERANCE = 0.2;
constexpr int64_t TIMER_RUNTIME = 1000000; // 1 second

View File

@@ -14,6 +14,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
static const double kDelayTime = 0.001;
class FakeEncoderTest : public testing::Test {

View File

@@ -17,6 +17,8 @@
#include "TestBench.h"
#include "gtest/gtest.h"
using namespace frc;
enum FilterNoiseTestType { TEST_SINGLE_POLE_IIR, TEST_MOVAVG };
std::ostream& operator<<(std::ostream& os, const FilterNoiseTestType& type) {

View File

@@ -17,6 +17,8 @@
#include "TestBench.h"
#include "gtest/gtest.h"
using namespace frc;
enum FilterOutputTestType { TEST_SINGLE_POLE_IIR, TEST_HIGH_PASS, TEST_MOVAVG };
std::ostream& operator<<(std::ostream& os, const FilterOutputTestType& type) {

View File

@@ -14,6 +14,8 @@
#include "Victor.h"
#include "gtest/gtest.h"
using namespace frc;
enum MotorEncoderTestType { TEST_VICTOR, TEST_JAGUAR, TEST_TALON };
std::ostream& operator<<(std::ostream& os, MotorEncoderTestType const& type) {

View File

@@ -13,6 +13,8 @@
#include "Victor.h"
#include "gtest/gtest.h"
using namespace frc;
enum MotorInvertingTestType { TEST_VICTOR, TEST_JAGUAR, TEST_TALON };
static const double motorSpeed = 0.15;
static const double delayTime = 0.5;

View File

@@ -11,6 +11,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
unsigned notifierCounter;
void notifierHandler(void*) { notifierCounter++; }

View File

@@ -15,6 +15,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
/* The PCM switches the compressor up to a couple seconds after the pressure
switch changes. */
static const double kCompressorDelayTime = 3.0;

View File

@@ -12,6 +12,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
class PIDToleranceTest : public testing::Test {
protected:
const double setpoint = 50.0;

View File

@@ -14,6 +14,8 @@
#include "Victor.h"
#include "gtest/gtest.h"
using namespace frc;
static const double kMotorTime = 0.25;
class PowerDistributionPanelTest : public testing::Test {

View File

@@ -14,6 +14,8 @@
#include "gtest/gtest.h"
#include "ntcore.h"
using namespace frc;
static const char* kFileName = "networktables.ini";
static const double kSaveTime = 1.2;

View File

@@ -12,6 +12,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
static const double kDelayTime = 0.01;
class RelayTest : public testing::Test {

View File

@@ -13,6 +13,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
class TestEnvironment : public testing::Environment {
bool m_alreadySetUp = false;

View File

@@ -14,6 +14,8 @@
#include "Timer.h"
#include "gtest/gtest.h"
using namespace frc;
static constexpr double kServoResetTime = 2.0;
static constexpr double kTestAngle = 90.0;

View File

@@ -10,6 +10,8 @@
#include "TestBench.h"
#include "gtest/gtest.h"
using namespace frc;
static const double kWaitTime = 0.5;
class TimerTest : public testing::Test {

View File

@@ -14,6 +14,8 @@
#include "command/MockCommand.h"
#include "gtest/gtest.h"
using namespace frc;
class CommandTest : public testing::Test {
protected:
void SetUp() override {

View File

@@ -7,6 +7,8 @@
#include "command/MockCommand.h"
using namespace frc;
MockCommand::MockCommand() {
m_initializeCount = 0;
m_executeCount = 0;