Skip to content

Commit

Permalink
Exclude attoparsec internal library from test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sigrdrifa committed Dec 18, 2023
1 parent 9dfdcd1 commit eac11b3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
allow-newer: all
tests: True
packages: .
package audiocate
coverage: True
library-coverage: True
package attoparsec
coverage: False
library-coverage: False
package *
coverage: False
library-coverage: False
2 changes: 1 addition & 1 deletion lib/Stego/Encode/LSB.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- | Module for encoding into Audio samples using
-- - the Least Significant Bit (LSB) approach. Payloads are embedded
-- - into the 16th LSB of each 16-bit sample provided.
-- - into the 16th LSB of each 16-bit sample in the frame provided.
module Stego.Encode.LSB
( encodeFrame
) where
Expand Down
4 changes: 2 additions & 2 deletions test/EncodeStreamCmdSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ spec =
result <- interpretCmd encodeCmd False
result `shouldBe` CmdSuccess
let decodeCmd = DecodeStream "test-secret" 5 outputFile
decode_result <- interpretCmd decodeCmd False
decode_result `shouldBe` CmdSuccess
decodeResult <- interpretCmd decodeCmd False
decodeResult `shouldBe` CmdSuccess
8 changes: 4 additions & 4 deletions test/RealTimeSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec =
let inputFile = "test/corpus/sample1.wav"
let outputFile = "test/output/sample1_rt_out.wav"
let secret = "21ø!2312422mmsfiuetest#@@1@sasf//"
let encodeCmd = Encode secret 2 inputFile outputFile
let encodeCmd = Encode secret 5 inputFile outputFile
result <- interpretCmd encodeCmd True
case result of
EncodeCmdSuccess res -> do
Expand All @@ -27,7 +27,7 @@ spec =
_ -> True `shouldBe` False -- fail the test

-- first pass at decode within time frame
let decodeCmd = Decode secret 2 outputFile
let decodeCmd = Decode secret 5 outputFile
result <- interpretCmd decodeCmd True
case result of
DecodeCmdSuccess res -> do
Expand All @@ -39,10 +39,10 @@ spec =
_ -> True `shouldBe` False -- fail the test

-- wait long enough for the time window to close
threadDelay 5000000
threadDelay 7000000
-- This is after the time window has closed, so we should have no verified
-- chunks in the decode
let decodeCmd = Decode secret 2 outputFile
let decodeCmd = Decode secret 5 outputFile
result <- interpretCmd decodeCmd True
case result of
DecodeCmdSuccess res -> do
Expand Down

0 comments on commit eac11b3

Please sign in to comment.