Skip to content

Commit

Permalink
Fix for AVR memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
davetcc committed Dec 12, 2022
1 parent a7e203d commit 12c36bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/testing/SimpleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace SimpleTest {
void UnitTestExecutor::setFailed(PGM_TYPE file, int line, const char *reason) {
testStatus = FAILED;
failureReason.withFileAndLine(file, line);
failureReason.withReason(reason);
}

void UnitTestExecutor::init(const char *name, bool ignored) {
Expand Down
19 changes: 0 additions & 19 deletions src/testing/SimpleTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,12 @@ namespace SimpleTest {
private:
PGM_TYPE file;
int line = 0;
char reason[FAIL_REASON_SIZE];
public:
FailureInfo() {}
void withFileAndLine(PGM_TYPE f, int l) {
file = f;
line = l;
}
void withReason(const char* r) {
strncpy(reason, r, sizeof reason);
reason[sizeof(reason)-1] = 0;
}

void copyFileToBuffer(char* sz, int len) const {
strncpy_P(sz, (char*)file, len);
sz[len-1] = 0;
}

void copyReasonToBuffer(char* sz, int len) const {
strncpy(sz, reason, len);
sz[len-1] = 0;
}

int getLine() const {
return line;
}
};

class UnitTestExecutor {
Expand Down

0 comments on commit 12c36bf

Please sign in to comment.