Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Feb 1, 2024
1 parent 696ced8 commit 81a3e55
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions comid/integregisters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ func prepareRegister(iType string) (*IntegReg, error) {

return reg, nil
}

func TestIntegRegister_AddDigest_OK(t *testing.T) {
_, err := prepareRegister("uint")
require.NoError(t, err)
}

func TestIntegRegister_AddDigest_NOK(t *testing.T) {
expectedErr := `unexpected type for index: bool`
var k bool
reg, err := prepareRegister("uint")
require.NoError(t, err)
err = reg.AddDigest(k, swid.HashEntry{})
assert.EqualError(t, err, expectedErr)
}

func TestIntegRegister_UInt_MarshalCBOR_OK(t *testing.T) {
reg, err := prepareRegister("uint")
require.NoError(t, err)
Expand Down

0 comments on commit 81a3e55

Please sign in to comment.