scsl/test/test_fixtures.h

51 lines
740 B
C
Raw Normal View History

2023-10-15 01:38:01 +00:00
#ifndef SCSL_TESTFIXTURES_H
#define SCSL_TESTFIXTURES_H
2023-10-06 03:13:46 +00:00
#include <string.h>
#include <scsl/TLV.h>
2023-10-06 03:13:46 +00:00
#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
2023-10-15 01:38:01 +00:00
namespace scsl {
2023-10-06 06:08:35 +00:00
static bool
2023-10-06 06:17:09 +00:00
cmpRecord(TLV::Record &a, TLV::Record &b)
2023-10-06 06:08:35 +00:00
{
if (a.Tag != b.Tag) {
2023-10-06 06:08:35 +00:00
return false;
}
if (a.Len != b.Len) {
return false;
}
if (memcmp(a.Val, b.Val, a.Len) != 0) {
return false;
}
return true;
}
2023-10-15 01:38:01 +00:00
} // namespace scsl
2023-10-15 01:38:01 +00:00
#endif // SCSL_TESTFIXTURES_H