Git Product home page Git Product logo

Comments (4)

gbirchmeier avatar gbirchmeier commented on July 21, 2024

This test, when added to DataDictionaryTests.cs, confirms the issue.

    [Test]
    public void Issue37()
    {
        QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary("../../../spec/fix/FIX44.xml");

        QuickFix.DataDictionary.DDMap aq = dd.Messages["AQ"];

        // 263=SuscriptionRequestType
        Assert.True(aq.ReqFields.Contains(263)); // this is ok
        Assert.False(aq.Fields[263].Required);   // this fails
    }

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Severity is not-so-bad. No internal QF code looks at the Required property. Users can instead look to see if fields are included in ReqFields.

Rough code cause: Multiple messages use SubscriptionRequiredType field. It appears that when processing, each message type reuses the same instance of the DDField object.

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Improved version of test. Test needed to be more comprehensive since it seems to rely on the order in which messages are processed.

    [Test]
    public void Issue37()
    {
        QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary("../../../spec/fix/FIX44.xml");

        System.Collections.Generic.Dictionary<string, bool> check263 = new Dictionary<string, bool>();
        string[] reqYes = { "V", "e", "g" };
        string[] reqNo = { "AH", "a", "c", "w", "x", "z", "AD", "AQ", "AE", "AR", "AN", "AP", "BB" };

        foreach (string s in reqYes)
        {
            Assert.True(dd.Messages[s].ReqFields.Contains(263), "expected true for '" + s + "'");
            Assert.True(dd.Messages[s].Fields[263].Required, "expected true for '" + s + "'");
        }

        foreach (string s in reqNo)
        {
            Assert.False(dd.Messages[s].ReqFields.Contains(263), "expected false for '" + s + "'");
            Assert.False(dd.Messages[s].Fields[263].Required, "expected false for '" + s + "'");
        }
    }

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

On further analysis, I think that DDField.Required is not an appropriate property for DDField.

This DDField class is supposed to describe the qualities of a QF field. Whether the field is required or not is not a quality of the field, but of the message that contains it. DDMap is the class that defines a message, and it does have DDMap.ReqFields already.

DDField.Required will be deprecated.

from quickfixn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.