Skip to content

Commit

Permalink
Added selftest to apps.test.synth.
Browse files Browse the repository at this point in the history
  • Loading branch information
aequabit committed Jan 19, 2016
1 parent ceb8696 commit c603530
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/apps/test/synth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ function selftest ()
config.app(c, "synth", Synth, { size = 128,
src = "11:11:11:11:11:11",
dst = "22:22:22:22:22:22" })
config.app(c, "writer", pcap.PcapWriter, "apps/test/synth.pcap")
config.app(c, "writer", pcap.PcapWriter, "apps/test/synth.pcap.output")
config.link(c, "synth.output->writer.input")
engine.configure(c)
engine.main( {duration = 0.1,
engine.main( {duration = 0.00000001, -- hack: one breath.
report = { showlinks = true } } )

if io.open("apps/test/synth.pcap"):read('*a') ~=
io.open("apps/test/synth.pcap.output"):read('*a')
then
error("synth.pcap and synth.pcap.output differ.")
end
end
Binary file added src/apps/test/synth.pcap
Binary file not shown.

0 comments on commit c603530

Please sign in to comment.