Exemplo n.º 1
0
        public void NullCursorType()
        {
            var c = ClangService.GetNullCursor();

            Assert.AreEqual(-1, c.ArgumentCount, "ArgumentCount");
            Assert.AreEqual(AvailabilityKind.Available, c.AvailabilityKind, "AvailabilityKind");

            var t = c.CursorType;

            Assert.IsNull(t, "IsNull");

            /*
             * Assert.AreEqual (-1, t.AlignOf, "AlignOf");
             * Assert.AreEqual (-1, t.ArgumentTypeCount, "ArgumentTypeCount");
             * var tt = t.ArrayElementType;
             * Assert.IsNotNull (tt, "ArrayElementType");
             * Assert.AreEqual (-1, t.ArraySize, "ArraySize");
             * tt = t.CanonicalType;
             * Assert.IsNotNull (tt, "CanonicalType");
             * tt = t.ClassType;
             * Assert.IsNotNull (tt, "ClassType");
             * Assert.AreEqual (-1, t.ElementCount, "ElementCount");
             * tt = t.ElementType;
             * Assert.IsNotNull (tt, "ElementType");
             * Assert.AreEqual (CallingConvention.Invalid, t.FunctionTypeCallingConvention, "FunctionTypeCallingConvention");
             * Assert.AreEqual (false, t.IsConstQualifiedType, "IsConstQualifiedType");
             * Assert.AreEqual (false, t.IsFunctionTypeVariadic, "IsFunctionTypeVariadic");
             * Assert.AreEqual (false, t.IsPODType, "IsPODType");
             * Assert.AreEqual (false, t.IsRestrictQualifiedType, "IsRestrictQualifiedType");
             * Assert.AreEqual (false, t.IsVolatileQualifiedType, "IsVolatileQualifiedType");
             * Assert.AreEqual (TypeKind.Invalid, t.Kind, "Kind");
             * tt = t.PointeeType;
             * Assert.IsNotNull (tt, "PointeeType");
             * Assert.AreEqual (RefQualifierKind.None, t.RefQualifier, "RefQualifier");
             * tt = t.ResultType;
             * Assert.IsNotNull (tt, "ResultType");
             * Assert.AreEqual (-1, t.SizeOf, "SizeOf");
             * Assert.AreEqual (string.Empty, t.Spelling, "Spelling");
             * // not in libclang 3.5
             * // Assert.AreEqual (-1, t.TemplateArgumentCount, "TemplateArgumentCount");
             * var cc = t.TypeDeclaration;
             * Assert.IsNotNull (cc, "TypeDeclaration");
             */
        }
Exemplo n.º 2
0
        public void NullCursor()
        {
            var c = ClangService.GetNullCursor();

            Assert.AreEqual(-1, c.ArgumentCount, "ArgumentCount");
            Assert.AreEqual(AvailabilityKind.Available, c.AvailabilityKind, "AvailabilityKind");

            var t = c.CursorType;

            Assert.IsNull(t, "CursorType");

            Assert.AreEqual(CXXAccessSpecifier.Invalid, c.CxxAccessSpecifier, "CxxAccessSpecifier");
            Assert.AreEqual(string.Empty, c.DeclObjCTypeEncoding, "DeclObjCTypeEncoding");
            Assert.AreEqual(18446744073709551615m, c.EnumConstantDeclUnsignedValue, "EnumConstantDeclUnsignedValue");
            Assert.AreEqual(-9223372036854775808m, c.EnumConstantDeclValue, "EnumConstantDeclValue");

            t = c.EnumDeclIntegerType;
            Assert.IsNull(t, "EnumDeclIntegerType");

            Assert.AreEqual(-1, c.FieldDeclBitWidth, "FieldDeclBitWidth");
            Assert.AreEqual(null, c.IncludedFile, "IncludedFile");
            Assert.AreEqual(false, c.IsBitField, "IsBitField");
            Assert.AreEqual(false, c.IsVirtualBase, "IsVirtualBase");
            Assert.AreEqual(CursorKind.FirstInvalid, c.Kind, "Kind");
            Assert.AreEqual(LanguageKind.Invalid, c.Language, "Language");

            var cc = c.LexicalParent;

            Assert.IsNotNull(cc, "LexicalParent");

            Assert.AreEqual(LinkageKind.Invalid, c.Linkage, "Linkage");
            Assert.AreEqual(0, c.OverloadedDeclarationCount, "OverloadedDeclarationCount");
            t = c.ResultType;
            Assert.IsNull(t, "ResultType");

            cc = c.SemanticParent;
            Assert.IsNotNull(cc, "SemanticParent");

            Assert.IsNull(c.TranslationUnit, "TranslationUnit");
            t = c.TypeDefDeclUnderlyingType;
            Assert.IsNull(t, "TypeDefDeclUnderlyingType");
        }