mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
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:
@@ -13,6 +13,8 @@
|
||||
#include "Timer.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
static const double kDelayTime = 0.01;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "Encoder.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
/**
|
||||
* Tests that configuring inputs to be filtered succeeds.
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "Timer.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
unsigned notifierCounter;
|
||||
|
||||
void notifierHandler(void*) { notifierCounter++; }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "Timer.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
class TestEnvironment : public testing::Environment {
|
||||
bool m_alreadySetUp = false;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "command/MockCommand.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
class CommandTest : public testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "command/MockCommand.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
MockCommand::MockCommand() {
|
||||
m_initializeCount = 0;
|
||||
m_executeCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user