Skip to content

Commit

Permalink
add test for multiple repeating groups in a message
Browse files Browse the repository at this point in the history
partly revert change in quickfixgo#368 due to breaking the unit test added in this PR
  • Loading branch information
albert committed Apr 10, 2024
1 parent 3bf2b87 commit de36465
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ func validateVisitGroupField(fieldDef *datadictionary.FieldDef, fieldStack []Tag
if childDefs[0].Required() {
return fieldStack, RequiredTagMissing(Tag(childDefs[0].Tag()))
}
fieldStack = fieldStack[1:]
}

childDefs = childDefs[1:]
Expand Down
12 changes: 12 additions & 0 deletions validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func TestValidate(t *testing.T) {
tcInvalidTagCheckDisabledFixT(),
tcInvalidTagCheckEnabled(),
tcInvalidTagCheckEnabledFixT(),
tcMultipleRepeatingGroupFields(),
}

msg := NewMessage()
Expand Down Expand Up @@ -923,6 +924,17 @@ func tcFloatValidationFixT() validateTest {
}
}

func tcMultipleRepeatingGroupFields() validateTest {
dict, _ := datadictionary.Parse("spec/FIX43.xml")
validator := NewValidator(defaultValidatorSettings, dict, nil)
return validateTest{
TestName: "Multiple repeating group fields in a message",
Validator: validator,
MessageBytes: []byte("8=FIX.4.39=17635=D34=249=TW52=20140329-22:38:4556=ISLD11=ID453=2448=PARTYID452=3523=SUBID448=PARTYID2452=378=179=ACCOUNT80=121=140=154=138=20055=INTC60=20140329-22:38:4510=178"),
DoNotExpectReject: true,
}
}

func TestValidateVisitField(t *testing.T) {
fieldType0 := datadictionary.NewFieldType("myfield", 11, "STRING")
fieldDef0 := &datadictionary.FieldDef{FieldType: fieldType0}
Expand Down

0 comments on commit de36465

Please sign in to comment.