Example #1
0
        public void TestConstructTypeName_MultipleModifiers()
        {
            string   testSrcML = "<type><name>STATUS</name><type:modifier>*</type:modifier><type:modifier>&amp;</type:modifier></type>";
            XElement xml       = XElement.Parse(string.Format(srcMLFormat, testSrcML), LoadOptions.PreserveWhitespace);

            bool isPrimitive;

            Assert.AreEqual("STATUS*&", ContextBuilder.ConstructTypeName(xml.Element(SRC.Type), out isPrimitive));
            Assert.AreEqual(false, isPrimitive);
        }
Example #2
0
        public void TestConstructTypeName_Reference()
        {
            string   testSrcML = "<type><name>int</name><type:modifier>&amp;</type:modifier></type>";
            XElement xml       = XElement.Parse(string.Format(srcMLFormat, testSrcML), LoadOptions.PreserveWhitespace);

            bool isPrimitive;

            Assert.AreEqual("int&", ContextBuilder.ConstructTypeName(xml.Element(SRC.Type), out isPrimitive));
            Assert.AreEqual(true, isPrimitive);
        }
Example #3
0
        public void TestConstructTypeName_PointerConstPointerToConstObj()
        {
            string   testSrcML = "<type><name>Foo</name> <name>const</name><type:modifier>*</type:modifier> <name>const</name><type:modifier>*</type:modifier></type>";
            XElement xml       = XElement.Parse(string.Format(srcMLFormat, testSrcML), LoadOptions.PreserveWhitespace);

            bool isPrimitive;

            Assert.AreEqual("Foo**", ContextBuilder.ConstructTypeName(xml.Element(SRC.Type), out isPrimitive));
            Assert.AreEqual(false, isPrimitive);
        }
Example #4
0
        public void TestConstructTypeName_ModifierOnNonPrimitive()
        {
            string   testSrcML = "<type><name>unsigned</name> <name>BAR</name></type>";
            XElement xml       = XElement.Parse(string.Format(srcMLFormat, testSrcML), LoadOptions.PreserveWhitespace);

            bool isPrimitive;

            Assert.AreEqual("BAR", ContextBuilder.ConstructTypeName(xml.Element(SRC.Type), out isPrimitive));
            Assert.AreEqual(false, isPrimitive);
        }
Example #5
0
        public void TestConstructTypeName_MultiplePrimitiveWrongCase()
        {
            string   testSrcML = "<type><name>static</name> <name>Unsigned</name> <name>char</name></type>";
            XElement xml       = XElement.Parse(string.Format(srcMLFormat, testSrcML), LoadOptions.PreserveWhitespace);

            bool isPrimitive;

            Assert.AreEqual("char", ContextBuilder.ConstructTypeName(xml.Element(SRC.Type), out isPrimitive));
            Assert.AreEqual(true, isPrimitive);
        }
Example #6
0
        public void TestConstructTypeName_Namespace()
        {
            string   testSrcML = "<type><name><name>std</name><op:operator>::</op:operator><name>string</name></name></type>";
            XElement xml       = XElement.Parse(string.Format(srcMLFormat, testSrcML), LoadOptions.PreserveWhitespace);

            bool isPrimitive;

            Assert.AreEqual("string", ContextBuilder.ConstructTypeName(xml.Element(SRC.Type), out isPrimitive));
            Assert.AreEqual(false, isPrimitive);
        }