Skip to content

Commit

Permalink
Start adding tests (don't pass yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Feb 17, 2025
1 parent e4caa0d commit b7568a1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions wpiutil/src/test/native/cpp/telemetry/TelemetryTableTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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 "wpi/telemetry/TelemetryTable.h" // NOLINT(build/include_order)

#include <gtest/gtest.h>

namespace telemetrytest {
struct TestStructADL {
double x = 0;
double y = 0;
};

void Log(wpi::TelemetryTable& table, const TestStructADL& value) {
table.Log("x", value.x);
table.Log("y", value.y);
}
} // namespace telemetrytest

TEST(TelemetryTableTest, LogADL) {
wpi::TelemetryTable& table = wpi::TelemetryRegistry::GetTable("/");
telemetrytest::TestStructADL val;
table.Log("testadl", val);
}

0 comments on commit b7568a1

Please sign in to comment.