From dba2d77a97f7af75a7f1ac8028bc61cac58a7598 Mon Sep 17 00:00:00 2001 From: Eric Paniagua Date: Fri, 4 Sep 2020 19:07:54 -0700 Subject: [PATCH] Rename ::kaleidoscope::testing::Simulator to SimHarness. Signed-off-by: Eric Paniagua --- testing/common/{Simulator.cpp => SimHarness.cpp} | 12 ++++++------ testing/common/{Simulator.h => SimHarness.h} | 4 ++-- testing/common/VirtualDeviceTest.h | 7 ++----- 3 files changed, 10 insertions(+), 13 deletions(-) rename testing/common/{Simulator.cpp => SimHarness.cpp} (81%) rename testing/common/{Simulator.h => SimHarness.h} (92%) diff --git a/testing/common/Simulator.cpp b/testing/common/SimHarness.cpp similarity index 81% rename from testing/common/Simulator.cpp rename to testing/common/SimHarness.cpp index 265e4e3c..4b8f5d73 100644 --- a/testing/common/Simulator.cpp +++ b/testing/common/SimHarness.cpp @@ -1,4 +1,4 @@ -/* kailedoscope::sim - Simulator for Unit Testing Kaleidoscope +/* kailedoscope::sim - Harness for Unit Testing Kaleidoscope * Copyright (C) 2020 Eric Paniagua * * This program is free software: you can redistribute it and/or modify it under @@ -15,7 +15,7 @@ */ #include "Kaleidoscope.h" -#include "testing/common/Simulator.h" +#include "testing/common/SimHarness.h" #include "testing/common/fix-macros.h" #include @@ -23,21 +23,21 @@ namespace kaleidoscope { namespace testing { -void Simulator::RunCycle() { +void SimHarness::RunCycle() { Kaleidoscope.loop(); } -void Simulator::RunCycles(size_t n) { +void SimHarness::RunCycles(size_t n) { for (size_t i = 0; i < n; ++i) RunCycle(); } -void Simulator::Press(uint8_t row, uint8_t col) { +void SimHarness::Press(uint8_t row, uint8_t col) { Kaleidoscope.device().keyScanner().setKeystate( KeyAddr{row, col}, kaleidoscope::Device::Props::KeyScanner::KeyState::Pressed); } -void Simulator::Release(uint8_t row, uint8_t col) { +void SimHarness::Release(uint8_t row, uint8_t col) { Kaleidoscope.device().keyScanner().setKeystate( KeyAddr{row, col}, kaleidoscope::Device::Props::KeyScanner::KeyState::NotPressed); diff --git a/testing/common/Simulator.h b/testing/common/SimHarness.h similarity index 92% rename from testing/common/Simulator.h rename to testing/common/SimHarness.h index 5604faea..06217eff 100644 --- a/testing/common/Simulator.h +++ b/testing/common/SimHarness.h @@ -1,5 +1,5 @@ /* kailedoscope::sim - Simulator for Unit Testing Kaleidoscope - * Copyright (C) 2020 epan + * Copyright (C) 2020 Eric Paniagua * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software @@ -22,7 +22,7 @@ namespace kaleidoscope { namespace testing { -class Simulator { +class SimHarness { public: void RunCycle(); void RunCycles(size_t n); diff --git a/testing/common/VirtualDeviceTest.h b/testing/common/VirtualDeviceTest.h index 747e00c5..171ab7cb 100644 --- a/testing/common/VirtualDeviceTest.h +++ b/testing/common/VirtualDeviceTest.h @@ -18,7 +18,7 @@ #include -#include "testing/common/Simulator.h" +#include "testing/common/SimHarness.h" #include "testing/common/State.h" // Out of order because `fix-macros.h` clears the preprocessor environment for @@ -33,10 +33,7 @@ class VirtualDeviceTest : public ::testing::Test { protected: std::unique_ptr RunCycle(); - // DO NOT REMOVE: This namespace qualification is required. Otherwise the - // linker decides this symbol is really ::kaleidoscope::simulator::Simulator. - // No idea why. - ::kaleidoscope::testing::Simulator sim_; + SimHarness sim_; private: State state_;