Skip to content

Commit

Permalink
Add more tests to Instance ID and ISVProdID
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Jan 27, 2025
1 parent a8bb6ca commit 7206483
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions comid/tdx-profile/teeinstanceid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,12 @@ func TestInstanceID_MarshalCBOR_Bytes(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, expected, actual)
}

func TestInstanceID_JSON(t *testing.T) {
inst := TeeInstanceID{TestByteInstance}
ji, err := inst.MarshalJSON()
assert.Nil(t, err)
i := &TeeInstanceID{}
err = i.UnmarshalJSON(ji)
assert.Nil(t, err)
}
9 changes: 9 additions & 0 deletions comid/tdx-profile/teeisvproid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,12 @@ func TestIsvProdID_MarshalCBOR_Bytes(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, expected, actual)
}

func TestIsvProdID_JSON(t *testing.T) {
isv := TeeIsvProdID{TestBytesISVProdID}
jisv, err := isv.MarshalJSON()
assert.Nil(t, err)
i := &TeeIsvProdID{}
err = i.UnmarshalJSON(jisv)
assert.Nil(t, err)
}

0 comments on commit 7206483

Please sign in to comment.