You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
7
external/cecil/rocks/Test/.gitignore
vendored
7
external/cecil/rocks/Test/.gitignore
vendored
@@ -1,7 +0,0 @@
|
||||
bin
|
||||
obj
|
||||
*.suo
|
||||
*.user
|
||||
*.pidb
|
||||
*.userprefs
|
||||
*.xml
|
||||
@@ -1,73 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">net_4_0_Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Mono.Cecil.Rocks.Tests</RootNamespace>
|
||||
<AssemblyName>Mono.Cecil.Rocks.Tests</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_3_5_Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\net_3_5_Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NET_3_5</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_3_5_Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\net_3_5_Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NET_3_5</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_4_0_Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\net_4_0_Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NET_3_5;NET_4_0</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_4_0_Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\net_4_0_Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NET_3_5;NET_4_0</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="nunit.core">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Test\libs\nunit-2.6.2\nunit.core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.core.interfaces">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Test\libs\nunit-2.6.2\nunit.core.interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Test\libs\nunit-2.6.2\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Mono.Cecil.csproj">
|
||||
<Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>
|
||||
@@ -83,24 +20,11 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Mono.Cecil.Tests\Addin.cs" />
|
||||
<Compile Include="Mono.Cecil.Tests\MethodDefinitionRocksTests.cs" />
|
||||
<Compile Include="Mono.Cecil.Tests\ModuleDefinitionRocksTests.cs" />
|
||||
<Compile Include="Mono.Cecil.Tests\SecurityDeclarationRocksTests.cs" />
|
||||
<Compile Include="Mono.Cecil.Tests\TypeDefinitionRocksTests.cs" />
|
||||
<Compile Include="Mono.Cecil.Tests\TypeReferenceRocksTests.cs" />
|
||||
<Content Include="Resources\cs\Types.cs" />
|
||||
<Compile Include="Mono.Cecil.Tests\*.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\assemblies\decsec-att.dll" />
|
||||
<Content Include="Resources\assemblies\decsec-xml.dll" />
|
||||
<None Include="Resources\**\*" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<Import Project="..\..\Mono.Cecil.Tests.props" />
|
||||
<Import Project="$(MSBuildCSharpTargets)" />
|
||||
</Project>
|
||||
@@ -1,8 +0,0 @@
|
||||
using NUnit.Core.Extensibility;
|
||||
|
||||
namespace Mono.Cecil.Tests {
|
||||
|
||||
[NUnitAddin]
|
||||
public class CecilRocksAddin : CecilTestAddin {
|
||||
}
|
||||
}
|
||||
264
external/cecil/rocks/Test/Mono.Cecil.Tests/DocCommentIdTests.cs
vendored
Normal file
264
external/cecil/rocks/Test/Mono.Cecil.Tests/DocCommentIdTests.cs
vendored
Normal file
@@ -0,0 +1,264 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using Mono.Cecil.Rocks;
|
||||
|
||||
namespace N
|
||||
{
|
||||
/// <summary>
|
||||
/// ID string generated is "T:N.X".
|
||||
/// </summary>
|
||||
public class X
|
||||
{
|
||||
/// <summary>
|
||||
/// ID string generated is "M:N.X.#ctor".
|
||||
/// </summary>
|
||||
public X() { }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "M:N.X.#ctor(System.Int32)".
|
||||
/// </summary>
|
||||
/// <param name="i">Describe parameter.</param>
|
||||
public X(int i) { }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "F:N.X.q".
|
||||
/// </summary>
|
||||
public string q;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "F:N.X.PI".
|
||||
/// </summary>
|
||||
public const double PI = 3.14;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "M:N.X.f".
|
||||
/// </summary>
|
||||
public int f() { return 1; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "M:N.X.bb(System.String,System.Int32@)".
|
||||
/// </summary>
|
||||
public int bb(string s, ref int y) { return 1; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "M:N.X.gg(System.Int16[],System.Int32[0:,0:])".
|
||||
/// </summary>
|
||||
public int gg(short[] array1, int[,] array) { return 0; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "M:N.X.op_Addition(N.X,N.X)".
|
||||
/// </summary>
|
||||
public static X operator +(X x, X xx) { return x; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "P:N.X.prop".
|
||||
/// </summary>
|
||||
public int prop { get { return 1; } set { } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "E:N.X.d".
|
||||
/// </summary>
|
||||
#pragma warning disable 67
|
||||
public event D d;
|
||||
#pragma warning restore 67
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "P:N.X.Item(System.String)".
|
||||
/// </summary>
|
||||
public int this[string s] { get { return 1; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "T:N.X.Nested".
|
||||
/// </summary>
|
||||
public class Nested { }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "T:N.X.D".
|
||||
/// </summary>
|
||||
public delegate void D(int i);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID string generated is "M:N.X.op_Explicit(N.X)~System.Int32".
|
||||
/// </summary>
|
||||
public static explicit operator int(X x) { return 1; }
|
||||
|
||||
public static void Linq (IEnumerable<string> enumerable, Func<string> selector)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Mono.Cecil.Tests {
|
||||
|
||||
[TestFixture]
|
||||
public class DocCommentIdTests {
|
||||
|
||||
[Test]
|
||||
public void TypeDef ()
|
||||
{
|
||||
AssertDocumentID ("T:N.X", GetTestType ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ParameterlessCtor ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var ctor = type.GetConstructors ().Single (m => m.Parameters.Count == 0);
|
||||
|
||||
AssertDocumentID ("M:N.X.#ctor", ctor);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CtorWithParameters ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var ctor = type.GetConstructors ().Single (m => m.Parameters.Count == 1);
|
||||
|
||||
AssertDocumentID ("M:N.X.#ctor(System.Int32)", ctor);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Field ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var field = type.Fields.Single (m => m.Name == "q");
|
||||
|
||||
AssertDocumentID ("F:N.X.q", field);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConstField ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var field = type.Fields.Single (m => m.Name == "PI");
|
||||
|
||||
AssertDocumentID ("F:N.X.PI", field);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ParameterlessMethod ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var method = type.Methods.Single (m => m.Name == "f");
|
||||
|
||||
AssertDocumentID ("M:N.X.f", method);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MethodWithByRefParameters ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var method = type.Methods.Single (m => m.Name == "bb");
|
||||
|
||||
AssertDocumentID ("M:N.X.bb(System.String,System.Int32@)", method);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MethodWithArrayParameters ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var method = type.Methods.Single (m => m.Name == "gg");
|
||||
|
||||
AssertDocumentID ("M:N.X.gg(System.Int16[],System.Int32[0:,0:])", method);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void OpAddition ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var op = type.Methods.Single (m => m.Name == "op_Addition");
|
||||
|
||||
AssertDocumentID ("M:N.X.op_Addition(N.X,N.X)", op);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void OpExplicit ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var op = type.Methods.Single (m => m.Name == "op_Explicit");
|
||||
|
||||
AssertDocumentID ("M:N.X.op_Explicit(N.X)~System.Int32", op);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Property ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var property = type.Properties.Single (p => p.Name == "prop");
|
||||
|
||||
AssertDocumentID ("P:N.X.prop", property);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Indexer ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var indexer = type.Properties.Single (p => p.Name == "Item");
|
||||
|
||||
AssertDocumentID ("P:N.X.Item(System.String)", indexer);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Event ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var @event = type.Events.Single (e => e.Name == "d");
|
||||
|
||||
AssertDocumentID ("E:N.X.d", @event);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Delegate ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var @delegate = type.NestedTypes.Single (t => t.Name == "D");
|
||||
|
||||
AssertDocumentID ("T:N.X.D", @delegate);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void NestedType ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var nestedType = type.NestedTypes.Single (t => t.Name == "Nested");
|
||||
|
||||
AssertDocumentID ("T:N.X.Nested", nestedType);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Linq ()
|
||||
{
|
||||
var type = GetTestType ();
|
||||
var method = type.GetMethod ("Linq");
|
||||
|
||||
AssertDocumentID ("M:N.X.Linq(System.Collections.Generic.IEnumerable{System.String},System.Func{System.String})", method);
|
||||
}
|
||||
|
||||
TypeDefinition GetTestType ()
|
||||
{
|
||||
return typeof (N.X).ToDefinition ();
|
||||
}
|
||||
|
||||
static void AssertDocumentID (string docId, IMemberDefinition member)
|
||||
{
|
||||
Assert.AreEqual (docId, DocCommentId.GetDocCommentId (member));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,18 +11,27 @@ namespace Mono.Cecil.Tests {
|
||||
|
||||
abstract class Foo {
|
||||
public abstract void DoFoo ();
|
||||
public abstract void DoBar ();
|
||||
}
|
||||
|
||||
class Bar : Foo {
|
||||
public override void DoFoo ()
|
||||
{
|
||||
}
|
||||
|
||||
public override void DoBar ()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class Baz : Bar {
|
||||
public override void DoFoo ()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual new void DoBar ()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -38,6 +47,10 @@ namespace Mono.Cecil.Tests {
|
||||
Assert.AreEqual ("Foo", @base.DeclaringType.Name);
|
||||
|
||||
Assert.AreEqual (@base, @base.GetBaseMethod ());
|
||||
|
||||
var new_dobar = baz.GetMethod ("DoBar");
|
||||
@base = new_dobar.GetBaseMethod();
|
||||
Assert.AreEqual("Baz", @base.DeclaringType.Name);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -9,10 +9,11 @@ namespace Mono.Cecil.Tests {
|
||||
[TestFixture]
|
||||
public class ModuleDefinitionRocksTests : BaseTestFixture {
|
||||
|
||||
[TestCSharp ("Types.cs")]
|
||||
public void GetAllTypesTest (ModuleDefinition module)
|
||||
[Test]
|
||||
public void GetAllTypesTest ()
|
||||
{
|
||||
var sequence = new [] {
|
||||
TestCSharp ("Types.cs", module => {
|
||||
var sequence = new [] {
|
||||
module.GetType ("<Module>"),
|
||||
module.GetType ("Foo"),
|
||||
module.GetType ("Foo/Bar"),
|
||||
@@ -21,7 +22,8 @@ namespace Mono.Cecil.Tests {
|
||||
module.GetType ("Pan"),
|
||||
};
|
||||
|
||||
Assert.IsTrue (sequence.SequenceEqual (module.GetAllTypes ()));
|
||||
Assert.IsTrue (sequence.SequenceEqual (module.GetAllTypes ()));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,50 +9,54 @@ namespace Mono.Cecil.Tests {
|
||||
[TestFixture]
|
||||
public class SecurityDeclarationRocksTests : BaseTestFixture {
|
||||
|
||||
[TestModule ("decsec-xml.dll")]
|
||||
public void ToPermissionSetFromPermissionSetAttribute (ModuleDefinition module)
|
||||
[Test]
|
||||
public void ToPermissionSetFromPermissionSetAttribute ()
|
||||
{
|
||||
var type = module.GetType ("SubLibrary");
|
||||
TestModule ("decsec-xml.dll", module => {
|
||||
var type = module.GetType ("SubLibrary");
|
||||
|
||||
Assert.IsTrue (type.HasSecurityDeclarations);
|
||||
Assert.AreEqual (1, type.SecurityDeclarations.Count);
|
||||
Assert.IsTrue (type.HasSecurityDeclarations);
|
||||
Assert.AreEqual (1, type.SecurityDeclarations.Count);
|
||||
|
||||
var declaration = type.SecurityDeclarations [0];
|
||||
var declaration = type.SecurityDeclarations [0];
|
||||
|
||||
var permission_set = declaration.ToPermissionSet ();
|
||||
var permission_set = declaration.ToPermissionSet ();
|
||||
|
||||
Assert.IsNotNull (permission_set);
|
||||
Assert.IsNotNull (permission_set);
|
||||
|
||||
string permission_set_value = "<PermissionSet class=\"System.Security.PermissionSe"
|
||||
string permission_set_value = "<PermissionSet class=\"System.Security.PermissionSe"
|
||||
+ "t\"\r\nversion=\"1\">\r\n<IPermission class=\"{0}\"\r\nversion=\"1\"\r\nFla"
|
||||
+ "gs=\"UnmanagedCode\"/>\r\n</PermissionSet>\r\n";
|
||||
|
||||
permission_set_value = string.Format (permission_set_value, typeof (SecurityPermission).AssemblyQualifiedName);
|
||||
permission_set_value = string.Format (permission_set_value, typeof (SecurityPermission).AssemblyQualifiedName);
|
||||
|
||||
Assert.AreEqual (Normalize (permission_set_value), Normalize (permission_set.ToXml ().ToString ()));
|
||||
Assert.AreEqual (Normalize (permission_set_value), Normalize (permission_set.ToXml ().ToString ()));
|
||||
});
|
||||
}
|
||||
|
||||
[TestModule ("decsec-att.dll")]
|
||||
public void ToPermissionSetFromSecurityAttribute (ModuleDefinition module)
|
||||
[Test]
|
||||
public void ToPermissionSetFromSecurityAttribute ()
|
||||
{
|
||||
var type = module.GetType ("SubLibrary");
|
||||
TestModule ("decsec-att.dll", module => {
|
||||
var type = module.GetType ("SubLibrary");
|
||||
|
||||
Assert.IsTrue (type.HasSecurityDeclarations);
|
||||
Assert.AreEqual (1, type.SecurityDeclarations.Count);
|
||||
Assert.IsTrue (type.HasSecurityDeclarations);
|
||||
Assert.AreEqual (1, type.SecurityDeclarations.Count);
|
||||
|
||||
var declaration = type.SecurityDeclarations [0];
|
||||
var declaration = type.SecurityDeclarations [0];
|
||||
|
||||
var permission_set = declaration.ToPermissionSet ();
|
||||
var permission_set = declaration.ToPermissionSet ();
|
||||
|
||||
Assert.IsNotNull (permission_set);
|
||||
Assert.IsNotNull (permission_set);
|
||||
|
||||
string permission_set_value = "<PermissionSet class=\"System.Security.PermissionSe"
|
||||
string permission_set_value = "<PermissionSet class=\"System.Security.PermissionSe"
|
||||
+ "t\"\r\nversion=\"1\">\r\n<IPermission class=\"{0}\"\r\nversion=\"1\"\r\nFla"
|
||||
+ "gs=\"UnmanagedCode\"/>\r\n</PermissionSet>\r\n";
|
||||
|
||||
permission_set_value = string.Format (permission_set_value, typeof (SecurityPermission).AssemblyQualifiedName);
|
||||
permission_set_value = string.Format (permission_set_value, typeof (SecurityPermission).AssemblyQualifiedName);
|
||||
|
||||
Assert.AreEqual (Normalize (permission_set_value), Normalize (permission_set.ToXml ().ToString ()));
|
||||
Assert.AreEqual (Normalize (permission_set_value), Normalize (permission_set.ToXml ().ToString ()));
|
||||
});
|
||||
}
|
||||
|
||||
static string Normalize (string s)
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Mono.Cecil.Tests {
|
||||
|
||||
static TypeReference GetTypeReference (Type type)
|
||||
{
|
||||
return ModuleDefinition.ReadModule (typeof (TypeReferenceRocksTests).Module.FullyQualifiedName).Import (type);
|
||||
return ModuleDefinition.ReadModule (typeof (TypeReferenceRocksTests).Module.FullyQualifiedName).ImportReference (type);
|
||||
}
|
||||
}
|
||||
}
|
||||
0
external/cecil/rocks/Test/Resources/cs/Types.cs
vendored
Executable file → Normal file
0
external/cecil/rocks/Test/Resources/cs/Types.cs
vendored
Executable file → Normal file
Reference in New Issue
Block a user