YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Compare Packets cs348 unit5new

Get Embed Code
1 Language

Showing Revision 1 created 04/11/2013 by Cogi-Admin.

  1. Here is my solution. I defined a local variable called pkt_diffs, then I used
  2. deepcomparephysical and pass in the expected and the received packet. We've
  3. talked about deepcomparephysical earlier. It, basically, ensures that the
  4. value of all the physical fields of two objects passed in are the same. If it,
  5. if they are not the same, it returns a list of string with all the details of
  6. their differences. Down here we have the data check and we basically check that
  7. the pkt_diff list is empty. If this is the case, we're okay. If it isn't, we
  8. fall into the error branch. Here we have our string, which I've listed up here.
  9. And in addition, I'm using an optional code block. So, for the check that
  10. action, you can add on the else branch, an optional code block, and execute any
  11. procedural code in here. I've basically enhanced my arrow message and I'm also
  12. printing all the differences. So, if this check fails in addition to the arrow
  13. string written here, you also get all the differences printed on the screen and
  14. in the log file.