From fc9974c33f11a09a14b71e0b0cda719bc00d844b Mon Sep 17 00:00:00 2001 From: Hayden Parker Date: Fri, 1 Apr 2016 21:36:20 -0700 Subject: [PATCH] test stubs --- lib/common/keys_and_cert.go | 5 ++- lib/common/keys_and_cert_test.go | 63 ++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/lib/common/keys_and_cert.go b/lib/common/keys_and_cert.go index 02b9141..7e5ebc1 100644 --- a/lib/common/keys_and_cert.go +++ b/lib/common/keys_and_cert.go @@ -88,10 +88,13 @@ func (keys_and_cert KeysAndCert) PublicKey() (key crypto.PublicKey, err error) { } else { // Key Certificate is not present, return the KEYS_AND_CERT_PUBKEY_SIZE byte // PublicKey space as ElgPublicKey. No other Certificate - // types are currently in use + // types are currently in use. var elg_key crypto.ElgPublicKey copy(keys_and_cert[:KEYS_AND_CERT_PUBKEY_SIZE], elg_key[:]) key = elg_key + log.WithFields(log.Fields{ + "cert_type": cert_type, + }).Warn("unused certificate type observed") } } diff --git a/lib/common/keys_and_cert_test.go b/lib/common/keys_and_cert_test.go index 805d0c7..fa09229 100644 --- a/lib/common/keys_and_cert_test.go +++ b/lib/common/keys_and_cert_test.go @@ -1 +1,64 @@ package common + +import ( + //"github.com/stretchr/testify/assert" + "testing" +) + +func keysAndCertWithoutCertificate() { +} + +func keysAndCertWithKeyCertificate() { +} + +func TestCertificateWithMissingData(t *testing.T) { +} + +func TestCertificateWithValidData(t *testing.T) { +} + +func TestPublicKeyWithBadCertificate(t *testing.T) { +} + +func TestPublicKeyWithZeroLengthCertificate(t *testing.T) { +} + +func TestPublicKeyWithKeyCertificate(t *testing.T) { +} + +func TestPublicKeyWithOtherCertType(t *testing.T) { +} + +func TestSigningPublicKeyWithBadCertificate(t *testing.T) { +} + +func TestSigningPublicKeyWithZeroLengthCertificate(t *testing.T) { +} + +func TestSigningPublicKeyWithKeyCertificate(t *testing.T) { +} + +func TestSigningPublicKeyWithOtherCertType(t *testing.T) { +} + +func TestReadKeysAndCertWithMissingData(t *testing.T) { +} + +func TestReadKeysAndCertWithMissingCertData(t *testing.T) { +} + +func TestReadKeysAndCertWithValidDataWithCertificate(t *testing.T) { +} + +func TestReadKeysAndCertWithValidDataWithoutCertificate(t *testing.T) { +} + +func TestReadKeysAndCertWithValidDataWithCertificateAndRemainder(t *testing.T) { +} + +func TestReadKeysAndCertWithValidDataWithoutCertificateAndRemainder(t *testing.T) { +} + +//if assert.NotNil(err) { +// assert.Equal(err.Error(), "", "correct error message should be returned") +//}