git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git]
/
Tools
/
NetTest_Runner
/
test_arp.c
diff --git
a/Tools/NetTest_Runner/test_arp.c
b/Tools/NetTest_Runner/test_arp.c
index
e97e2c3
..
9c6f044
100644
(file)
--- a/
Tools/NetTest_Runner/test_arp.c
+++ b/
Tools/NetTest_Runner/test_arp.c
@@
-6,25
+6,26
@@
#include "stack.h"
#include "arp.h"
#include "stack.h"
#include "arp.h"
+static const int ERX_TIMEOUT = 1000; // Expect RX timeout (timeout=failure)
+static const int NRX_TIMEOUT = 250; // Not expect RX timeout (timeout=success)
+
bool Test_ARP_Basic(void)
{
bool Test_ARP_Basic(void)
{
- TEST_SETNAME(__func__);
- size_t rxlen;
- char rxbuf[MTU];
+ TEST_HEADER;
// Request test machine's IP
ARP_SendRequest(0, BLOB(TEST_IP));
// Request test machine's IP
ARP_SendRequest(0, BLOB(TEST_IP));
- TEST_ASSERT
( rxlen = Net_Receive(0, sizeof(rxbuf), rxbuf, 1000)
);
+ TEST_ASSERT
_rx(
);
TEST_ASSERT( ARP_Pkt_IsResponse(rxlen, rxbuf, BLOB(TEST_IP), BLOB(TEST_MAC)) );
// Request host machine's IP
TEST_ASSERT( ARP_Pkt_IsResponse(rxlen, rxbuf, BLOB(TEST_IP), BLOB(TEST_MAC)) );
// Request host machine's IP
- ARP_SendRequest(0,
HOST_IP_STR
);
- TEST_ASSERT
( Net_Receive(0, sizeof(rxbuf), rxbuf, 1000) == 0
);
+ ARP_SendRequest(0,
BLOB(HOST_IP)
);
+ TEST_ASSERT
_no_rx(
);
#if 0
// Ask test machine to request our IP
Stack_SendCommand("arprequest "HOST_IP_STR);
#if 0
// Ask test machine to request our IP
Stack_SendCommand("arprequest "HOST_IP_STR);
- TEST_ASSERT
( rxlen = Net_Receive(0, sizeof(rxbuf), rxbuf, 1000)
);
+ TEST_ASSERT
_rx(
);
TEST_ASSERT( ARP_Pkt_IsRequest(rxlen, rxbuf, HOST_IP) );
// Respond
TEST_ASSERT( ARP_Pkt_IsRequest(rxlen, rxbuf, HOST_IP) );
// Respond
@@
-32,7
+33,7
@@
bool Test_ARP_Basic(void)
// Ask test machine to request our IP again (expecting nothing)
Stack_SendCommand("arprequest "HOST_IP_STR);
// Ask test machine to request our IP again (expecting nothing)
Stack_SendCommand("arprequest "HOST_IP_STR);
- TEST_ASSERT
( !Net_Receive(0, sizeof(rxbuf), rxbuf, 1000)
);
+ TEST_ASSERT
_no_rx(
);
#endif
return true;
#endif
return true;
UCC
git Repository :: git.ucc.asn.au