51 lines
740 B
C++
51 lines
740 B
C++
#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
|