chore(style): fix style nits

This commit is contained in:
fallenoak 2025-09-03 22:15:59 -05:00
parent 473a2cb044
commit 5121638c27
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
13 changed files with 88 additions and 86 deletions

View file

@ -5,7 +5,6 @@
#include <numeric>
#include <vector>
TEST_CASE("SMemAlloc", "[memory]") {
SECTION("allocates memory") {
void* ptr = SMemAlloc(16, __FILE__, __LINE__);

View file

@ -1,7 +1,6 @@
#include "RegionTest.hpp"
#include <cfloat>
TEST_CASE("SRgnClear", "[region]") {
RgnDataTest region;

View file

@ -1,50 +1,50 @@
#include "storm/Region.hpp"
#include "test/Test.hpp"
#include <sstream>
// Fixture for repetitive handling of Rgn objects.
struct RgnDataTest {
HSRGN rgn = nullptr;
RgnDataTest() {
SRgnCreate(&rgn, 0);
}
~RgnDataTest() {
SRgnDelete(rgn);
rgn = nullptr;
}
HSRGN* operator &() { return &rgn; }
operator HSRGN() const { return rgn; }
HSRGN operator->() const { return rgn; }
};
// Helpers for comparing RECTF structs
std::ostream& operator <<(std::ostream& os, RECTF const& value) {
os << "{ " << value.left << ", " << value.bottom << ", " << value.right << ", " << value.top << " }";
return os;
}
template <class T>
class RECTMatcher : public Catch::MatcherBase<T> {
private:
T cmp;
public:
RECTMatcher(T arg) : cmp(arg) {}
bool match(T const& in) const override {
return cmp.left == in.left && cmp.bottom == in.bottom && cmp.right == in.right && cmp.top == in.top;
}
std::string describe() const override {
std::ostringstream ss;
ss << "equals " << cmp;
return ss.str();
}
};
RECTMatcher<RECTF> MatchesRect(RECTF arg) {
return { arg };
}
#include "storm/Region.hpp"
#include "test/Test.hpp"
#include <sstream>
// Fixture for repetitive handling of Rgn objects.
struct RgnDataTest {
HSRGN rgn = nullptr;
RgnDataTest() {
SRgnCreate(&rgn, 0);
}
~RgnDataTest() {
SRgnDelete(rgn);
rgn = nullptr;
}
HSRGN* operator &() { return &rgn; }
operator HSRGN() const { return rgn; }
HSRGN operator->() const { return rgn; }
};
// Helpers for comparing RECTF structs
std::ostream& operator <<(std::ostream& os, RECTF const& value) {
os << "{ " << value.left << ", " << value.bottom << ", " << value.right << ", " << value.top << " }";
return os;
}
template <class T>
class RECTMatcher : public Catch::MatcherBase<T> {
private:
T cmp;
public:
RECTMatcher(T arg) : cmp(arg) {}
bool match(T const& in) const override {
return cmp.left == in.left && cmp.bottom == in.bottom && cmp.right == in.right && cmp.top == in.top;
}
std::string describe() const override {
std::ostringstream ss;
ss << "equals " << cmp;
return ss.str();
}
};
RECTMatcher<RECTF> MatchesRect(RECTF arg) {
return { arg };
}

View file

@ -2,11 +2,9 @@
#include "storm/Memory.hpp"
#include "test/Test.hpp"
#include <cfloat>
#include <cstdarg>
#include <type_traits>
TEST_CASE("SStrChr const", "[string]") {
const char* string = "foobar";

View file

@ -2,7 +2,5 @@
#include "test/Test.hpp"
#include "storm/Big.hpp"
BigDataTest::BigDataTest() { SBigNew(&num); }
BigDataTest::~BigDataTest() { SBigDel(num); }