18 arb_assert((!source && source_len == 0) || (source && source_len == strlen(source)));
21 int Size = range.
size();
23 if (Size) memmove(dest, source+
start(), Size);
29 int Size = range.
size();
30 char *dup = ARB_alloc<char>(Size+1);
47 inline bool exactly_one_of(
bool b1,
bool b2,
bool b3) {
return (b1+b2+b3) == 1; }
48 inline bool wellDefined(
PosRange range) {
54 void TEST_PosRange() {
96 for (
int pos = -3; pos<12; ++pos) {
103 TEST_EXPECT(correlated(seven2nine.contains(pos), pos >= 7 && pos <= 9));
129 void TEST_ExplicitRange() {
150 void TEST_range_copying() {
152 const char *source =
"0123456789";
153 const size_t source_len = strlen(source);
171 strcpy(dest, source);
175 strcpy(dest, source);
184 void TEST_range_intersection() {
232 void TEST_range_containment() {
static PosRange from(int pos)
PosRange intersection(PosRange r1, PosRange r2)
const char * GBS_global_string(const char *templat,...)
static PosRange prior(int pos)
#define TEST_PUBLISH(testfunction)
#define TEST_EXPECT(cond)
bool contains(int pos) const
#define TEST_REJECT(cond)
static PosRange after(int pos)
bool is_unlimited() const
static PosRange till(int pos)
char * dup_corresponding_part(const char *source, size_t source_len) const
#define TEST_EXPECT_EQUAL(expr, want)
void copy_corresponding_part(char *dest, const char *source, size_t source_len) const