mirror of
https://github.com/libp2p/go-openssl.git
synced 2025-04-02 15:00:12 +08:00
Make test confom to new requirement enforced in go 1.10 https://tip.golang.org/doc/go1.10#test. With out this change tests will always fails with go 1.10+.
This commit is contained in:
parent
e863d83e40
commit
666cd1440a
@ -77,7 +77,7 @@ func TestMarshal(t *testing.T) {
|
|||||||
}
|
}
|
||||||
tls_der := x509.MarshalPKCS1PrivateKey(tls_key)
|
tls_der := x509.MarshalPKCS1PrivateKey(tls_key)
|
||||||
if !bytes.Equal(der, tls_der) {
|
if !bytes.Equal(der, tls_der) {
|
||||||
t.Fatal("invalid private key der bytes: %s\n v.s. %s\n",
|
t.Fatalf("invalid private key der bytes: %s\n v.s. %s\n",
|
||||||
hex.Dump(der), hex.Dump(tls_der))
|
hex.Dump(der), hex.Dump(tls_der))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ func TestMarshalEC(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if !bytes.Equal(der, tls_der) {
|
if !bytes.Equal(der, tls_der) {
|
||||||
t.Fatal("invalid private key der bytes: %s\n v.s. %s\n",
|
t.Fatalf("invalid private key der bytes: %s\n v.s. %s\n",
|
||||||
hex.Dump(der), hex.Dump(tls_der))
|
hex.Dump(der), hex.Dump(tls_der))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ func TestSHA1(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if expected != got {
|
if expected != got {
|
||||||
t.Fatal("exp:%x got:%x", expected, got)
|
t.Fatalf("exp:%x got:%x", expected, got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ func TestSHA1Writer(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if got != exp {
|
if got != exp {
|
||||||
t.Fatal("exp:%x got:%x", exp, got)
|
t.Fatalf("exp:%x got:%x", exp, got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ func TestSHA256(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if expected != got {
|
if expected != got {
|
||||||
t.Fatal("exp:%x got:%x", expected, got)
|
t.Fatalf("exp:%x got:%x", expected, got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ func TestSHA256Writer(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if got != exp {
|
if got != exp {
|
||||||
t.Fatal("exp:%x got:%x", exp, got)
|
t.Fatalf("exp:%x got:%x", exp, got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user