Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Guile DNS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hugo Hörnquist
Guile DNS
Commits
5a1ac78f
Commit
5a1ac78f
authored
3 years ago
by
Hugo Hörnquist
Browse files
Options
Downloads
Patches
Plain Diff
Add test for encoding and decoding all types.
parent
f29283f3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+2
-1
2 additions, 1 deletion
Makefile
tests/types-round-trip.scm
+49
-0
49 additions, 0 deletions
tests/types-round-trip.scm
with
51 additions
and
1 deletion
Makefile
+
2
−
1
View file @
5a1ac78f
...
...
@@ -5,7 +5,8 @@ tests = state.scm \
bv.scm
\
label.scm
\
enum.scm
\
object.scm
object.scm
\
types-round-trip.scm
sources
=
dns.scm
\
$(
shell find dns
-type
f
-name
\*
.scm
)
...
...
This diff is collapsed.
Click to expand it.
tests/types-round-trip.scm
0 → 100644
+
49
−
0
View file @
5a1ac78f
(
use-modules
(
srfi
srfi-64
)
(
srfi
srfi-71
)
(
srfi
srfi-88
)
(
rnrs
bytevectors
)
(
dns
types
header
)
(
dns
types
message
)
(
dns
types
question
)
(
dns
types
rr
))
(
test-begin
"Encode-decode round trip for all types"
)
(
define
header
(
make-dns-header
qdcount:
1
ancount:
1
))
(
define
question
(
make-dns-question
name:
"www.lysator.liu.se"
type:
#xABCD
))
(
define
rr
(
make-dns-rr-data
name:
"www.lysator.liu.se"
type:
'A
ttl:
300
rdata:
"10.20.30.40"
))
(
define
message
(
make-dns-message
header:
header
questions:
(
list
question
)
answers:
(
list
rr
)))
(
let
((
_
bv
ptr
((
dns-header->bytes
header
)
(
make-bytevector
0
)
0
)))
(
let
((
header*
_
((
bytes->dns-header
bv
)
0
)))
(
test-equal
"Header surrive round-trip"
header
header*
)))
(
let
((
_
bv
ptr
((
dns-question->bytes
question
)
(
make-bytevector
0
)
0
)))
(
let
((
question*
_
((
bytes->dns-question
bv
)
0
)))
(
test-equal
"Question surrive round-trip"
question
question*
)))
(
let
((
_
bv
ptr
((
rr-data->bytes
rr
)
(
make-bytevector
0
)
0
)))
(
let
((
rr*
_
((
bytes->rr-data
bv
)
0
)))
(
test-equal
"RR surrive round-trip"
rr
rr*
)))
(
let
((
_
bv
ptr
((
dns-message->bytes
message
)
(
make-bytevector
0
)
0
)))
(
let
((
message*
_
((
bytes->dns-message
bv
)
0
)))
(
test-equal
"DNS message surrive round-trip"
message
message*
)))
(
test-end
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment