Rename ::kaleidoscope::testing::Simulator to SimHarness.

Signed-off-by: Eric Paniagua <epaniagua@google.com>
epan/testing/readable
Eric Paniagua 4 years ago
parent a89c95cc58
commit dba2d77a97

@ -1,4 +1,4 @@
/* kailedoscope::sim - Simulator for Unit Testing Kaleidoscope
/* kailedoscope::sim - Harness for Unit Testing Kaleidoscope
* Copyright (C) 2020 Eric Paniagua <epaniagua@google.com>
*
* 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 <iostream>
@ -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);

@ -1,5 +1,5 @@
/* kailedoscope::sim - Simulator for Unit Testing Kaleidoscope
* Copyright (C) 2020 epan <epaniagua@google.com>
* Copyright (C) 2020 Eric Paniagua <epaniagua@google.com>
*
* 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);

@ -18,7 +18,7 @@
#include <cstddef>
#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<State> 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_;

Loading…
Cancel
Save