Changeset e73dbc1 in mainline for uspace/srv/net/tcp/test/main.c
- Timestamp:
- 2017-08-31T23:23:55Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ddbf81
- Parents:
- 94c5bc1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/test/main.c
r94c5bc1 re73dbc1 27 27 */ 28 28 29 #include <mem.h> 29 30 #include <pcut/pcut.h> 31 32 #include "main.h" 33 #include "../segment.h" 34 #include "../tcp_type.h" 35 36 /** Verify that two segments have the same content */ 37 void test_seg_same(tcp_segment_t *a, tcp_segment_t *b) 38 { 39 PCUT_ASSERT_INT_EQUALS(a->ctrl, b->ctrl); 40 PCUT_ASSERT_INT_EQUALS(a->seq, b->seq); 41 PCUT_ASSERT_INT_EQUALS(a->ack, b->ack); 42 PCUT_ASSERT_INT_EQUALS(a->len, b->len); 43 PCUT_ASSERT_INT_EQUALS(a->wnd, b->wnd); 44 PCUT_ASSERT_INT_EQUALS(a->up, b->up); 45 PCUT_ASSERT_INT_EQUALS(tcp_segment_text_size(a), 46 tcp_segment_text_size(b)); 47 if (tcp_segment_text_size(a) != 0) 48 PCUT_ASSERT_NOT_NULL(a->data); 49 if (tcp_segment_text_size(b) != 0) 50 PCUT_ASSERT_NOT_NULL(b->data); 51 if (tcp_segment_text_size(a) != 0) { 52 PCUT_ASSERT_INT_EQUALS(0, memcmp(a->data, b->data, 53 tcp_segment_text_size(a))); 54 } 55 } 30 56 31 57 PCUT_INIT 32 58 33 59 PCUT_IMPORT(pdu); 60 PCUT_IMPORT(segment); 61 PCUT_IMPORT(seq_no); 34 62 35 63 PCUT_MAIN()
Note:
See TracChangeset
for help on using the changeset viewer.