Beispiel #1
0
        public void NamedEnumTest10()
        {
            const string typeName       = "EnumType1";
            const bool   baseTypeSigned = false;
            const ushort baseTypeSize   = 5;

            var integerProperties = new CtfPropertyBag();

            integerProperties.AddValue("size", baseTypeSize.ToString());
            integerProperties.AddValue("signed", baseTypeSigned.ToString());

            var mappings = new List <EnumeratorTestValue>
            {
                new EnumeratorTestValue
                {
                    Name       = "enum",
                    AddComma   = true,
                    StartValue = 2
                },
                new EnumeratorTestValue
                {
                    Name           = "trace",
                    StartValue     = 3,
                    ValueSpecified = false
                },
            };

            NamedEnumTest(typeName, baseTypeSigned, baseTypeSize, mappings);
        }
Beispiel #2
0
        public void NamedEnumTest2()
        {
            const string typeName       = "EnumType1";
            const bool   baseTypeSigned = false;
            const ushort baseTypeSize   = 5;

            var integerProperties = new CtfPropertyBag();

            integerProperties.AddValue("size", baseTypeSize.ToString());
            integerProperties.AddValue("signed", baseTypeSigned.ToString());

            var mappings = new List <EnumeratorTestValue>
            {
                new EnumeratorTestValue
                {
                    Name       = "identifier_one",
                    StartValue = 5,
                    AddComma   = true
                },
                new EnumeratorTestValue
                {
                    Name       = "identifier_two",
                    StartValue = 6
                },
            };

            NamedEnumTest(typeName, baseTypeSigned, baseTypeSize, mappings);
        }
Beispiel #3
0
        public void NamedEnumTest12()
        {
            const string typeName       = "EnumType1";
            const bool   baseTypeSigned = true;
            const ushort baseTypeSize   = 5;

            var integerProperties = new CtfPropertyBag();

            integerProperties.AddValue("size", baseTypeSize.ToString());
            integerProperties.AddValue("signed", baseTypeSigned.ToString());

            var mappings = new List <EnumeratorTestValue>
            {
                new EnumeratorTestValue
                {
                    Name               = "\"this is the first enum value\"",
                    StartValue         = 2,
                    StartValueIsSigned = false,
                    AddComma           = true
                },
                new EnumeratorTestValue
                {
                    Name           = "\"this is the second enum value\"",
                    StartValue     = 3,
                    AddComma       = true,
                    ValueSpecified = false
                },
                new EnumeratorTestValue
                {
                    Name           = "\"this is the third enum value\"",
                    StartValue     = 4,
                    AddComma       = true,
                    ValueSpecified = false,
                },
                new EnumeratorTestValue
                {
                    Name             = "\"this is the final enum value\"",
                    StartValue       = 12,
                    EndValue         = 15,
                    Range            = true,
                    EndValueIsSigned = false,
                    AddComma         = true
                },
            };

            NamedEnumTest(typeName, baseTypeSigned, baseTypeSize, mappings);
        }
Beispiel #4
0
        public void NamedEnumTest11()
        {
            const string typeName       = "EnumType1";
            const bool   baseTypeSigned = false;
            const ushort baseTypeSize   = 5;

            var integerProperties = new CtfPropertyBag();

            integerProperties.AddValue("size", baseTypeSize.ToString());
            integerProperties.AddValue("signed", baseTypeSigned.ToString());

            var mappings = new List <EnumeratorTestValue>
            {
                new EnumeratorTestValue
                {
                    Name       = "\"this is an enum value\"",
                    StartValue = 2
                },
            };

            NamedEnumTest(typeName, baseTypeSigned, baseTypeSize, mappings);
        }