aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-21 21:42:20 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-21 21:42:20 +0100
commitc6382ddd6eb5b7afde5a5a479b64265f078309bc (patch)
tree9492b6741b6a668a66a5ee04a0690ed3d6f97adb
parent6058220d2a05bada0a656809f9011fc86a1e22a5 (diff)
rlc: Add a simple test for the RLC data structure for the init
-rw-r--r--src/tbf.h2
-rw-r--r--tests/types/TypesTest.cpp15
2 files changed, 16 insertions, 1 deletions
diff --git a/src/tbf.h b/src/tbf.h
index e95ed20..0eacec5 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -90,7 +90,7 @@ struct gprs_rlc_data {
/* block history */
uint8_t block[RLC_MAX_LEN];
- /* block len of history */
+ /* block len of history */
uint8_t len;
};
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 235ba97..727f148 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -75,10 +75,25 @@ static void test_llc(void)
}
}
+static void test_rlc()
+{
+ {
+ struct gprs_rlc_data rlc = { 0, };
+ memset(rlc.block, 0x23, RLC_MAX_LEN);
+ uint8_t *p = rlc.prepare(20);
+ OSMO_ASSERT(p == rlc.block);
+ for (int i = 0; i < 20; ++i)
+ OSMO_ASSERT(p[i] == 0x2B);
+ for (int i = 20; i < RLC_MAX_LEN; ++i)
+ OSMO_ASSERT(p[i] == 0x0);
+ }
+}
+
int main(int argc, char **argv)
{
printf("Making some basic type testing.\n");
test_llc();
+ test_rlc();
return EXIT_SUCCESS;
}