Permalink
Browse files

fixing test data.

  • Loading branch information...
1 parent 81b076a commit 9478a73bcc40116158a4eca526336571b92c82d9 @kazu-yamamoto committed Aug 12, 2010
Showing with 48 additions and 10 deletions.
  1. +1 −1 data/gpg1.res
  2. +1 −1 data/gpg2.res
  3. +3 −3 data/pub.res
  4. +2 −2 data/pub1.res
  5. +1 −1 data/sig.res
  6. +1 −1 data/sig1.res
  7. BIN data/{sig4 → sig3}
  8. +1 −1 data/sig3.res
  9. +38 −0 data/test.hs
View
@@ -10,4 +10,4 @@ Old: Signature Packet(tag 2)(70 bytes)
Hash left 2 bytes - 84 a8
DSA r(160 bits) - ...
DSA s(160 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
View
@@ -22,4 +22,4 @@ Old: Signature Packet(tag 2)(70 bytes)
Hash left 2 bytes - 0a 7d
DSA r(160 bits) - ...
DSA s(159 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
View
@@ -24,7 +24,7 @@ Old: Signature Packet(tag 2)(75 bytes)
Hash left 2 bytes - 7e 87
DSA r(160 bits) - ...
DSA s(154 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
Old: User ID Packet(tag 13)(20 bytes)
User ID - robby@dd.iij4u.or.jp
Old: Signature Packet(tag 2)(75 bytes)
@@ -43,7 +43,7 @@ Old: Signature Packet(tag 2)(75 bytes)
Hash left 2 bytes - ba ef
DSA r(160 bits) - ...
DSA s(160 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
Old: Public Subkey Packet(tag 14)(525 bytes)
Ver 4 - new
Public key creation time - Thu Nov 26 22:49:00 JST 1998
@@ -62,4 +62,4 @@ Old: Signature Packet(tag 2)(63 bytes)
Hash left 2 bytes - e8 41
DSA r(160 bits) - ...
DSA s(160 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
View
@@ -33,7 +33,7 @@ Old: Signature Packet(tag 2)(87 bytes)
Hash left 2 bytes - e2 cb
DSA r(158 bits) - ...
DSA s(158 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
Old: Public Subkey Packet(tag 14)(269 bytes)
Ver 4 - new
Public key creation time - Sun Oct 11 23:29:23 JST 1998
@@ -53,4 +53,4 @@ Old: Signature Packet(tag 2)(70 bytes)
Hash left 2 bytes - 42 66
DSA r(160 bits) - ...
DSA s(160 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
View
@@ -9,7 +9,7 @@ Old: Signature Packet(tag 2)(63 bytes)
Hash left 2 bytes - 27 ae
DSA r(159 bits) - ...
DSA s(159 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
Old: Literal Data Packet(tag 11)(45 bytes)
Format - binary
Filename - hoge
View
@@ -18,4 +18,4 @@ New: Signature Packet(tag 2)(63 bytes)
Hash left 2 bytes - 8f 82
DSA r(160 bits) - ...
DSA s(157 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
File renamed without changes.
View
@@ -18,4 +18,4 @@ New: Signature Packet(tag 2)(63 bytes)
Hash left 2 bytes - 51 81
DSA r(158 bits) - ...
DSA s(160 bits) - ...
- -> hash(160 bits)
+ -> hash(DSA q bits)
View
@@ -0,0 +1,38 @@
+module Test where
+
+import Data.List
+import System.Directory
+import System.FilePath
+import System.Process
+import Test.Framework (defaultMain, testGroup, Test)
+import Test.Framework.Providers.HUnit
+import Test.HUnit hiding (Test)
+
+tests :: [Test]
+tests = [
+ testGroup "res" [
+ testCase "data" test_data
+ ]
+ ]
+
+----------------------------------------------------------------
+
+test_data :: Assertion
+test_data = do
+ files <- getDirectoryContents "."
+ let dsts = filter (".res" `isSuffixOf`) files
+ srcs = map dropExtension dsts
+ ts = zip srcs dsts
+ mapM_ compareThem ts
+ where
+ compareThem (src,dst) = do
+ putStrLn src
+ ss <- readProcess "../pgpdump" [src] ""
+ ds <- readFile dst
+ ss @?= ds
+
+----------------------------------------------------------------
+
+main :: Assertion
+main = defaultMain tests
+

0 comments on commit 9478a73

Please sign in to comment.