rlc: Create a basic test that mark/is is talking about the same
This commit is contained in:
parent
6b5660c19f
commit
9525567d77
|
@ -44,10 +44,11 @@ struct gprs_rlc {
|
|||
};
|
||||
|
||||
struct gprs_rlc_v_b {
|
||||
bool is_unacked(int index) const;
|
||||
bool is_nacked(int index) const;
|
||||
bool is_acked(int index) const;
|
||||
bool is_unacked(int index) const;
|
||||
bool is_resend(int index) const;
|
||||
bool is_invalid(int index) const;
|
||||
|
||||
char state(int index) const;
|
||||
|
||||
|
@ -136,6 +137,11 @@ inline bool gprs_rlc_v_b::is_resend(int index) const
|
|||
return is_state(index, 'X');
|
||||
}
|
||||
|
||||
inline bool gprs_rlc_v_b::is_invalid(int index) const
|
||||
{
|
||||
return is_state(index, 'I');
|
||||
}
|
||||
|
||||
inline void gprs_rlc_v_b::mark_resend(int index)
|
||||
{
|
||||
return mark(index, 'X');
|
||||
|
|
|
@ -89,11 +89,38 @@ static void test_rlc()
|
|||
}
|
||||
}
|
||||
|
||||
static void test_rlc_v_b()
|
||||
{
|
||||
{
|
||||
gprs_rlc_v_b vb;
|
||||
vb.reset();
|
||||
|
||||
for (size_t i = 0; i < RLC_MAX_SNS/2; ++i)
|
||||
OSMO_ASSERT(vb.is_invalid(i));
|
||||
|
||||
vb.mark_unacked(23);
|
||||
OSMO_ASSERT(vb.is_unacked(23));
|
||||
|
||||
vb.mark_nacked(23);
|
||||
OSMO_ASSERT(vb.is_nacked(23));
|
||||
|
||||
vb.mark_acked(23);
|
||||
OSMO_ASSERT(vb.is_acked(23));
|
||||
|
||||
vb.mark_resend(23);
|
||||
OSMO_ASSERT(vb.is_resend(23));
|
||||
|
||||
vb.mark_invalid(23);
|
||||
OSMO_ASSERT(vb.is_invalid(23));
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
printf("Making some basic type testing.\n");
|
||||
test_llc();
|
||||
test_rlc();
|
||||
test_rlc_v_b();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue