mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fixes indexed classed handle resource (#899)
Nothing in WPILib uses it, so it was not tested
This commit is contained in:
committed by
Peter Johnson
parent
738a1c015c
commit
c00848c060
28
hal/src/test/native/cpp/handles/HandleTests.cpp
Normal file
28
hal/src/test/native/cpp/handles/HandleTests.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. 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 "HAL/HAL.h"
|
||||
#include "HAL/handles/IndexedClassedHandleResource.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#define HAL_TestHandle HAL_Handle
|
||||
|
||||
namespace {
|
||||
class MyTestClass {};
|
||||
} // namespace
|
||||
|
||||
namespace hal {
|
||||
TEST(HandleTests, ClassedHandleTest) {
|
||||
hal::IndexedClassedHandleResource<HAL_TestHandle, MyTestClass, 8,
|
||||
HAL_HandleEnum::Vendor>
|
||||
testClass;
|
||||
int32_t status = 0;
|
||||
testClass.Allocate(0, std::make_unique<MyTestClass>(), &status);
|
||||
EXPECT_EQ(0, status);
|
||||
}
|
||||
|
||||
} // namespace hal
|
||||
Reference in New Issue
Block a user