orb: consistently use unsigned int for queue_size

This commit is contained in:
Beat Küng
2016-05-27 09:40:42 +02:00
committed by Lorenz Meier
parent 392c32d316
commit 43d734ef43
5 changed files with 15 additions and 15 deletions
@@ -587,7 +587,7 @@ int uORBTest::UnitTest::test_queue()
}
const int queue_size = 11;
const unsigned int queue_size = 11;
t.val = 0;
ptopic = orb_advertise_queue(ORB_ID(orb_test_medium_queue), &t, queue_size);
@@ -635,12 +635,12 @@ int uORBTest::UnitTest::test_queue()
test_note(" Testing to write some elements...");
for (int i = 0; i < queue_size - 2; ++i) {
for (unsigned int i = 0; i < queue_size - 2; ++i) {
t.val = i;
orb_publish(ORB_ID(orb_test_medium_queue), ptopic, &t);
}
for (int i = 0; i < queue_size - 2; ++i) {
for (unsigned int i = 0; i < queue_size - 2; ++i) {
CHECK_UPDATED(i);
CHECK_COPY(u.val, i);
}
@@ -650,12 +650,12 @@ int uORBTest::UnitTest::test_queue()
test_note(" Testing overflow...");
int overflow_by = 3;
for (int i = 0; i < queue_size + overflow_by; ++i) {
for (unsigned int i = 0; i < queue_size + overflow_by; ++i) {
t.val = i;
orb_publish(ORB_ID(orb_test_medium_queue), ptopic, &t);
}
for (int i = 0; i < queue_size; ++i) {
for (unsigned int i = 0; i < queue_size; ++i) {
CHECK_UPDATED(i);
CHECK_COPY(u.val, i + overflow_by);
}
@@ -664,7 +664,7 @@ int uORBTest::UnitTest::test_queue()
test_note(" Testing underflow...");
for (int i = 0; i < queue_size; ++i) {
for (unsigned int i = 0; i < queue_size; ++i) {
CHECK_NOT_UPDATED(i);
CHECK_COPY(u.val, queue_size + overflow_by - 1);
}
@@ -694,7 +694,7 @@ int uORBTest::UnitTest::pub_test_queue_main()
{
struct orb_test_medium t;
orb_advert_t ptopic;
const int queue_size = 50;
const unsigned int queue_size = 50;
t.val = 0;
if ((ptopic = orb_advertise_queue(ORB_ID(orb_test_medium_queue_poll), &t, queue_size)) == nullptr) {