unit: Fix broken SNEP read unit test
In "crash-1" loop, the snep_data was added to the slist, but not removed
because of a specific exit condition. This fix swaps the test condition
and the action on slist, in order to add the fragment only when the length
test passed.
diff --git a/unit/test-snep-read.c b/unit/test-snep-read.c
index 9ce2c1c..cb02054 100644
--- a/unit/test-snep-read.c
+++ b/unit/test-snep-read.c
@@ -101,11 +101,11 @@
if (stored_recd)
TEST_SNEP_LOG("\tdummy_req_put already stored record\n");
- test_fragments = g_slist_append(test_fragments, snep_data);
-
if (snep_data->nfc_data_length > snep_data->nfc_data_current_length)
return TRUE;
+ test_fragments = g_slist_append(test_fragments, snep_data);
+
nfc_data_length = 0;
nfc_data = g_try_malloc0(snep_data->nfc_data_length);
g_assert(nfc_data != NULL);