Files
allwpilib/wpilibc/src/test/native/cpp/PS4ControllerTest.cpp
Starlight220 031962608b [wpilib] Add PS4Controller, remove Hand from GenericHID/XboxController (#3345)
- GenericHID is now concrete, and has only getRawAxis/Button(int) functionality
- getXxx() has been moved into Joystick as that's the only place where it makes sense
- Hand (and therefore getXxx(Hand)) has been removed, replaced by specific getLeft/RightXxx() methods in XboxController and the new PS4Controller class
- C++ ::Button:: and ::Axis:: enums have been converted to identically-namespaced static constexpr ints
2021-08-14 10:00:46 -07:00

38 lines
1.1 KiB
C++

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "frc/PS4Controller.h" // NOLINT(build/include_order)
#include "JoystickTestMacros.h"
#include "frc/simulation/PS4ControllerSim.h"
#include "gtest/gtest.h"
using namespace frc;
BUTTON_TEST(PS4Controller, SquareButton)
BUTTON_TEST(PS4Controller, CrossButton)
BUTTON_TEST(PS4Controller, CircleButton)
BUTTON_TEST(PS4Controller, TriangleButton)
BUTTON_TEST(PS4Controller, L1Button)
BUTTON_TEST(PS4Controller, R1Button)
BUTTON_TEST(PS4Controller, L2Button)
BUTTON_TEST(PS4Controller, R2Button)
BUTTON_TEST(PS4Controller, ShareButton)
BUTTON_TEST(PS4Controller, OptionsButton)
BUTTON_TEST(PS4Controller, L3Button)
BUTTON_TEST(PS4Controller, R3Button)
BUTTON_TEST(PS4Controller, PSButton)
BUTTON_TEST(PS4Controller, Touchpad)
AXIS_TEST(PS4Controller, LeftX)
AXIS_TEST(PS4Controller, RightX)
AXIS_TEST(PS4Controller, LeftY)
AXIS_TEST(PS4Controller, RightY)
AXIS_TEST(PS4Controller, L2Axis)
AXIS_TEST(PS4Controller, R2Axis)