feat: add test name to test vector meta (#214)

So we can more easily distinguish between test vectors.
This commit is contained in:
Alan Shaw 2020-08-07 15:36:00 +01:00 committed by GitHub
parent de62012a7f
commit be5bd41640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 0 deletions

View File

@ -91,6 +91,7 @@ func MessageTest_AccountActorCreation() error {
for _, tc := range testCases {
err := func() error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = tc.desc
existingAccountAddr, _ := td.NewAccountActor(tc.existingActorType, tc.existingActorBal)

View File

@ -20,6 +20,7 @@ func MessageTest_MessageApplicationEdgecases() error {
err := func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, _ := td.NewAccountActor(drivers.SECP, aliceBal)
@ -48,6 +49,7 @@ func MessageTest_MessageApplicationEdgecases() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, _ := td.NewAccountActor(drivers.SECP, aliceBal)
@ -84,6 +86,7 @@ func MessageTest_MessageApplicationEdgecases() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, _ := td.NewAccountActor(drivers.SECP, aliceBal)
preroot := td.GetStateRoot()
@ -130,6 +133,7 @@ func MessageTest_MessageApplicationEdgecases() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, _ := td.NewAccountActor(drivers.SECP, aliceBal)
@ -167,6 +171,7 @@ func MessageTest_MessageApplicationEdgecases() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
const pcTimeLock = abi_spec.ChainEpoch(10)
const pcLane = uint64(123)
@ -234,6 +239,7 @@ func MessageTest_MessageApplicationEdgecases() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, _ := td.NewAccountActor(drivers.SECP, aliceBal)
@ -264,6 +270,8 @@ func MessageTest_MessageApplicationEdgecases() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
td.Vector.Meta.Comment = "Note that this test is not a valid message, since it is using an unknown actor. However in the event that an invalid message isn't filtered by block validation we need to ensure behaviour is consistent across VM implementations."
alice, _ := td.NewAccountActor(drivers.SECP, aliceBal)

View File

@ -20,6 +20,7 @@ func MessageTest_Paych() error {
err := func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
// will create and send on payment channel
sender, senderID := td.NewAccountActor(drivers.SECP, initialBal)
@ -63,6 +64,7 @@ func MessageTest_Paych() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
//const pcTimeLock = abi_spec.ChainEpoch(1)
const pcTimeLock = abi_spec.ChainEpoch(0)
@ -133,6 +135,7 @@ func MessageTest_Paych() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
// create the payment channel
sender, _ := td.NewAccountActor(drivers.SECP, initialBal)

View File

@ -95,6 +95,7 @@ func MessageTest_ValueTransferSimple() error {
for _, tc := range testCases {
err := func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
// Create the to and from actors with balance in the state tree
_, _, err := td.State().CreateActor(builtin_spec.AccountActorCodeID, tc.sender, tc.senderBal, &account_spec.State{Address: tc.sender})
@ -154,6 +155,7 @@ func MessageTest_ValueTransferAdvance() error {
err := func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, _ := td.NewAccountActor(drivers.SECP, aliceInitialBalance)
transferAmnt := abi_spec.NewTokenAmount(10)
@ -183,6 +185,7 @@ func MessageTest_ValueTransferAdvance() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, aliceId := td.NewAccountActor(drivers.SECP, aliceInitialBalance)
transferAmnt := abi_spec.NewTokenAmount(10)
@ -213,6 +216,7 @@ func MessageTest_ValueTransferAdvance() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, aliceId := td.NewAccountActor(drivers.SECP, aliceInitialBalance)
transferAmnt := abi_spec.NewTokenAmount(10)
@ -243,6 +247,7 @@ func MessageTest_ValueTransferAdvance() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, aliceId := td.NewAccountActor(drivers.SECP, aliceInitialBalance)
transferAmnt := abi_spec.NewTokenAmount(10)
@ -273,6 +278,7 @@ func MessageTest_ValueTransferAdvance() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, _ := td.NewAccountActor(drivers.SECP, aliceInitialBalance)
receiver := td.Wallet().NewSECP256k1AccountAddress()
@ -303,6 +309,7 @@ func MessageTest_ValueTransferAdvance() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
alice, _ := td.NewAccountActor(drivers.SECP, aliceInitialBalance)
unknown := td.Wallet().NewSECP256k1AccountAddress()
@ -334,6 +341,7 @@ func MessageTest_ValueTransferAdvance() error {
err = func(testname string) error {
td := drivers.NewTestDriver()
td.Vector.Meta.Desc = testname
sender := td.Wallet().NewSECP256k1AccountAddress()
receiver := td.Wallet().NewSECP256k1AccountAddress()