net: tests: Fix net_buf_unref() tests for fragment chains
The net_buf_unref() API will unref all associated fragments, so it's wrong to assume that no fragment destroy callbacks would be called when the head buf is unreffed. Instead the right expectation is that all fragments get unrefed as well. Change-Id: I00530e4c1cfa5dddbfcbeab9609347873010ff4d Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
fcb54aa96b
commit
ee0412a7d1
1 changed files with 0 additions and 21 deletions
|
@ -309,13 +309,6 @@ static void net_buf_test_4(void)
|
|||
|
||||
net_buf_unref(buf);
|
||||
|
||||
assert_equal(frag_destroy_called, 0,
|
||||
"Incorrect frag destroy callback count");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(frags_pool); i++) {
|
||||
net_buf_unref(frags[i]);
|
||||
}
|
||||
|
||||
assert_equal(frag_destroy_called, ARRAY_SIZE(frags_pool),
|
||||
"Incorrect frag destroy callback count");
|
||||
}
|
||||
|
@ -356,13 +349,6 @@ static void net_buf_test_big_buf(void)
|
|||
net_buf_frag_add(buf, frag);
|
||||
net_buf_unref(buf);
|
||||
|
||||
assert_equal(frag_destroy_called, 0,
|
||||
"Incorrect frag destroy callback count");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(big_pool); i++) {
|
||||
net_buf_unref(big_frags[i]);
|
||||
}
|
||||
|
||||
assert_equal(frag_destroy_called, ARRAY_SIZE(big_pool),
|
||||
"Incorrect frag destroy callback count");
|
||||
}
|
||||
|
@ -416,13 +402,6 @@ static void net_buf_test_multi_frags(void)
|
|||
|
||||
net_buf_unref(buf);
|
||||
|
||||
assert_equal(frag_destroy_called, 0,
|
||||
"Incorrect big frag destroy callback count");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(frags_pool); i++) {
|
||||
net_buf_unref(frags[i]);
|
||||
}
|
||||
|
||||
assert_equal(frag_destroy_called, ARRAY_SIZE(frags_pool),
|
||||
"Incorrect big frag destroy callback count");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue