Restructure project, start importing sc3 code.

This commit is contained in:
2023-10-18 23:44:05 -07:00
parent 3122ed6ac7
commit 5f3dc6e9f6
46 changed files with 2300 additions and 66 deletions

50
test/test_fixtures.h Normal file
View File

@@ -0,0 +1,50 @@
#ifndef SCSL_TESTFIXTURES_H
#define SCSL_TESTFIXTURES_H
#include <string.h>
#include <scsl/TLV.h>
#define ARENA_SIZE 128
#define ARENA_FILE "arena_test.bin"
/* strlen=13 */
#define TEST_STR1 "Hello, world"
#define TEST_STRLEN1 13
#define TEST_STR2 "Bye, world!!"
#define TEST_STRLEN2 13
#define TEST_STR3 "Hello, arena"
#define TEST_STRLEN3 13
/* strlen 35 */
#define TEST_STR4 "How is a raven like a writing desk?"
#define TEST_STRLEN4 35
namespace scsl {
static bool
cmpRecord(TLV::Record &a, TLV::Record &b)
{
if (a.Tag != b.Tag) {
return false;
}
if (a.Len != b.Len) {
return false;
}
if (memcmp(a.Val, b.Val, a.Len) != 0) {
return false;
}
return true;
}
} // namespace scsl
#endif // SCSL_TESTFIXTURES_H