Skip to content

Commit

Permalink
Adding more test
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Oct 1, 2024
1 parent 5411f40 commit b4eff3f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
15 changes: 15 additions & 0 deletions comid/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ var (

//go:embed testcases/comid-3.cbor
testComid3 []byte

//go:embed testcases/comid-4.cbor
testComid4 []byte
)

// TO DO Check and Regenerate the .cbor again for the below CBOR dumps
Expand Down Expand Up @@ -462,3 +465,15 @@ func Example_decode_CBOR_5() {

// Output: OK
}

func Example_decode_CBOR_6() {
comid := Comid{}
err := comid.FromCBOR(testComid4)
if err != nil {
fmt.Printf("FAIL: %v", err)
} else {
fmt.Println("OK")
}

// Output: OK
}
Binary file added comid/testcases/comid-4.cbor
Binary file not shown.
51 changes: 51 additions & 0 deletions comid/testcases/src/comid-4.diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/ concise-mid-tag / {
/ comid.tag-identity / 1 : {
/ comid.tag-id / 0 : h'3f06af63a93c11e4979700505690773f'
},
/ comid.entity / 2 : [ {
/ comid.entity-name / 0 : "ACME Inc.",
/ comid.reg-id / 1 : 32("https://acme.example"),
/ comid.role / 2 : [ 0 ] / tag-creator /
} ],
/ comid.triples / 4 : {
/ comid.reference-triples / 0 : [ [
/ environment-map / {
/ comid.class / 0 : {
/ comid.class-id / 0 :
/ tagged-uuid-type / 37(
h'67b28b6c34cc40a19117ab5b05911e37'
),
/ comid.vendor / 1 : "ACME Inc.",
/ comid.model / 2 : "ACME RoadRunner",
/ comid.layer / 3 : 1
}
},
[
/ measurement-map A / {
/ comid.mval / 1 : {
/ comid.ver / 0 : {
/ comid.version / 0 : "1.0.0",
/ comid.version-scheme / 1 : 16384 / semver /
},
/ comid.digests / 2 : [ [
/ hash-alg-id / 1, / sha256 /
/ hash-value / h'44aa336af4cb14a879432e53dd6571c7fa9bccafb75f488259262d6ea3a4d91b'
] ]
}
},
/ measurement-map B / {
/ comid.mval / 1 : {
/ comid.ver / 0 : {
/ comid.version / 0 : "2.0.0",
/ comid.version-scheme / 1 : 16384 / semver /
},
/ comid.digests / 2 : [ [
/ hash-alg-id / 1, / sha256 /
/ hash-value / h'FFaa336af4cb14a879432e53dd6571c7fa9bccafb75f488259262d6ea3a4d91b'
] ]
}
}
]
] ]
}
}

0 comments on commit b4eff3f

Please sign in to comment.