Fixes and cleanup

This commit is contained in:
Ken Van Hoeylandt 2026-01-23 23:51:09 +01:00
parent be06daa46d
commit 44c6f565ac
4 changed files with 2 additions and 45 deletions

View File

@ -4,6 +4,8 @@
extern "C" {
#endif
#include <stdbool.h>
struct Device;
struct DeviceType;

View File

@ -5,8 +5,6 @@
#include <Tactility/Device.h>
#include "Tactility/Log.h"
TEST_CASE("device_construct and device_destruct should set and unset the correct fields") {
Device device = { 0 };

View File

@ -1,5 +1,4 @@
#include "doctest.h"
#include <cstring>
#include <Tactility/Driver.h>
TEST_CASE("driver_construct and driver_destruct should set and unset the correct fields") {

View File

@ -1,42 +0,0 @@
#pragma once
#include "doctest.h"
#include <unistd.h>
#include <Tactility/file/File.h>
/**
* A class for creating test files that can automatically clean themselves up.
*/
class TestFile {
const char* path;
bool autoClean;
public:
TestFile(const char* path, bool autoClean = true) : path(path), autoClean(autoClean) {
if (autoClean && exists()) {
remove();
}
}
~TestFile() {
if (autoClean && exists()) {
remove();
}
}
const char* getPath() const { return path; }
void writeData(const char* data) const {
CHECK_EQ(tt::file::writeString(path, data), true);
}
bool exists() const {
return access(path, F_OK) == 0;
}
void remove() const {
::remove(path);
}
};