diff options
| author | Lars Ingebrigtsen | 2019-06-15 16:10:28 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-06-15 16:10:28 +0200 |
| commit | fcb3821ad506675bce264e53f50a06905adaa8e8 (patch) | |
| tree | f93bec8c35b65cee2c64979731b885c2c114c90a /test | |
| parent | f03343747e380174400ac0529030dc4d35bea715 (diff) | |
| download | emacs-fcb3821ad506675bce264e53f50a06905adaa8e8.tar.gz emacs-fcb3821ad506675bce264e53f50a06905adaa8e8.zip | |
Also test unpacking
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/bindat-tests.el | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bindat-tests.el b/test/lisp/emacs-lisp/bindat-tests.el index 854fd5b62d5..f6af810083a 100644 --- a/test/lisp/emacs-lisp/bindat-tests.el +++ b/test/lisp/emacs-lisp/bindat-tests.el | |||
| @@ -70,4 +70,30 @@ | |||
| 70 | 2 3 5 0 ?A ?B ?C ?D ?E ?F 0 0 1 2 3 4 5 0 0 0 | 70 | 2 3 5 0 ?A ?B ?C ?D ?E ?F 0 0 1 2 3 4 5 0 0 0 |
| 71 | 1 4 7 0 ?B ?C ?D ?E ?F ?G 0 0 6 7 8 9 10 11 12 0 ]))) | 71 | 1 4 7 0 ?B ?C ?D ?E ?F ?G 0 0 6 7 8 9 10 11 12 0 ]))) |
| 72 | 72 | ||
| 73 | (ert-deftest bindat-test-unpack () | ||
| 74 | (should (equal | ||
| 75 | (bindat-unpack packet-bindat-spec | ||
| 76 | (bindat-pack packet-bindat-spec struct-bindat)) | ||
| 77 | '((item | ||
| 78 | ((data . | ||
| 79 | [1 2 3 4 5]) | ||
| 80 | (id . "ABCDEF") | ||
| 81 | (length . 5) | ||
| 82 | (opcode . 3) | ||
| 83 | (type . 2)) | ||
| 84 | ((data . | ||
| 85 | [6 7 8 9 10 11 12]) | ||
| 86 | (id . "BCDEFG") | ||
| 87 | (length . 7) | ||
| 88 | (opcode . 4) | ||
| 89 | (type . 1))) | ||
| 90 | (items . 2) | ||
| 91 | (header | ||
| 92 | (src-port . 5408) | ||
| 93 | (dest-port . 284) | ||
| 94 | (src-ip . | ||
| 95 | [192 168 1 101]) | ||
| 96 | (dest-ip . | ||
| 97 | [192 168 1 100])))))) | ||
| 98 | |||
| 73 | ;;; bindat-tests.el ends here | 99 | ;;; bindat-tests.el ends here |