GenerateKey(rsa => GetSecondMin(rsa.LegalKeySizes));
}
- [Fact(Skip = "Takes approximately 1600 seconds to execute")]
+ [ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
public static void GenerateMaxKey()
{
GenerateKey(rsa => GetMax(rsa.LegalKeySizes));
Assert.IsType<ArgumentNullException>(tie.InnerException);
}
- [Fact(Skip = "Useful to enable when collecting perf traces")]
- public void EnumerationPerformance()
- {
- var dictionary = Enumerable.Range(1, 1000).ToImmutableSortedDictionary(k => k, k => k);
-
- var timing = new TimeSpan[3];
- var sw = new Stopwatch();
- for (int j = 0; j < timing.Length; j++)
- {
- sw.Start();
- for (int i = 0; i < 10000; i++)
- {
- foreach (var entry in dictionary)
- {
- }
- }
-
- timing[j] = sw.Elapsed;
- sw.Reset();
- }
-
- string timingText = string.Join(Environment.NewLine, timing);
- Debug.WriteLine("Timing:{0}{1}", Environment.NewLine, timingText);
- }
-
- [Fact(Skip = "Useful to enable when collecting perf traces")]
- public void EnumerationPerformance_Empty()
- {
- var dictionary = ImmutableSortedDictionary<int, int>.Empty;
-
- var timing = new TimeSpan[3];
- var sw = new Stopwatch();
- for (int j = 0; j < timing.Length; j++)
- {
- sw.Start();
- for (int i = 0; i < 10000; i++)
- {
- foreach (var entry in dictionary)
- {
- }
- }
-
- timing[j] = sw.Elapsed;
- sw.Reset();
- }
-
- string timingText = string.Join(Environment.NewLine, timing);
- Debug.WriteLine("Timing_Empty:{0}{1}", Environment.NewLine, timingText);
- }
-
[Fact]
public void ValueRef()
{
{
public class CommandBuilderTests : IntegrationTestBase
{
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void QuoteIdentifier_UseConnection()
{
var commandBuilder = new OdbcCommandBuilder();
Assert.Throws<InvalidOperationException>(() => commandBuilder.UnquoteIdentifier("Test"));
}
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void QuoteIdentifier_CustomPrefixSuffix()
{
var commandBuilder = new OdbcCommandBuilder();
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Xunit;
+using Microsoft.DotNet.XUnitExtensions;
namespace System.Data.Odbc.Tests
{
public IntegrationTestBase()
{
connection = new OdbcConnection(ConnectionStrings.WorkingConnection);
- connection.Open();
+ try
+ {
+ connection.Open();
+ }
+ catch (OdbcException e) when (e.ErrorCode == unchecked((int)0x80131937)) // Data source name not found and no default driver specified
+ {
+ throw new SkipTestException(e.Message);
+ }
+ catch (DllNotFoundException e)
+ {
+ throw new SkipTestException(e.Message);
+ }
+
transaction = connection.BeginTransaction();
command = connection.CreateCommand();
command.Transaction = transaction;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using Microsoft.DotNet.XUnitExtensions;
using Xunit;
namespace System.Data.Odbc.Tests
{
public class ReaderTests : IntegrationTestBase
{
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void EmptyReader()
{
command.CommandText =
}
}
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void GetValues()
{
command.CommandText =
}
}
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void GetValueFailsWithBigIntWithBackwardsCompatibility()
{
command.CommandText =
}
}
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void GetDataTypeName()
{
command.CommandText =
}
}
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void GetFieldTypeIsNotSupportedInSqlite()
{
command.CommandText =
}
}
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void IsDbNullIsNotSupportedInSqlite()
{
command.CommandText =
}
}
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void InvalidRowIndex()
{
command.CommandText =
}
}
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void InvalidRowName()
{
command.CommandText =
{
public class SmokeTest : IntegrationTestBase
{
- [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")]
+ [ConditionalFact]
public void CreateInsertSelectTest()
{
command.CommandText =
using System.Security;
using System.Threading;
using Microsoft.DotNet.RemoteExecutor;
+using Microsoft.DotNet.XUnitExtensions;
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;
using Xunit;
Assert.Equal(workingDirectory ?? string.Empty, info.WorkingDirectory);
}
- [Fact(Skip = "Manual test")]
+ [Fact]
+ [OuterLoop("Opens a browser")]
+ [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097
[PlatformSpecific(TestPlatforms.Windows)]
public void StartInfo_WebPage()
{
using (var p = Process.Start(info))
{
Assert.NotNull(p);
+ p.WaitForInputIdle();
+ p.Kill();
}
}
Assert.Equal(source.Last().total, source.SelectMany((e, i) => i == 4 ? e.total : Enumerable.Empty<int?>()));
}
- [Fact(Skip = "Valid test but too intensive to enable even in OuterLoop")]
+ [ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
public void IndexOverflow()
{
var selected = new FastInfiniteEnumerator<int>().SelectMany((e, i) => Enumerable.Empty<int>());
Assert.Equal(expected, source.Select((e, i) => i == 5 ? e.name : null));
}
- [Fact(Skip = "Valid test but too intensive to enable even in OuterLoop")]
+ [ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
public void Overflow()
{
var selected = new FastInfiniteEnumerator<int>().Select((e, i) => e);
Assert.Equal(expected, source.SkipWhile((element, index) => index < source.Length - 1));
}
- [Fact(Skip = "Valid test but too intensive to enable even in OuterLoop")]
+ [ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
public void IndexSkipWhileOverflowBeyondIntMaxValueElements()
{
var skipped = new FastInfiniteEnumerator<int>().SkipWhile((e, i) => true);
Assert.Equal(expected, source.RunOnce().TakeWhile((element, index) => index < source.Length - 1));
}
- [Fact(Skip = "Valid test but too intensive to enable even in OuterLoop")]
+ [ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
public void IndexTakeWhileOverflowBeyondIntMaxValueElements()
{
var taken = new FastInfiniteEnumerator<int>().TakeWhile((e, i) => true);
Assert.Equal(1, source.CopyToTouched);
}
- [Fact(Skip = "Valid test but too intensive to enable even in OuterLoop")]
+ [ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
public void ToArray_FailOnExtremelyLargeCollection()
{
var largeSeq = new FastInfiniteEnumerator<byte>();
Assert.Equal(source.Skip(source.Length - 1), source.Where((e, i) => i == source.Length - 1));
}
- [Fact(Skip = "Valid test but too intensive to enable even in OuterLoop")]
+ [ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
public void IndexOverflows()
{
var infiniteWhere = new FastInfiniteEnumerator<int>().Where((e, i) => true);
Assert.Throws<BadImageFormatException>(() => new PEReader(new MemoryStream(), PEStreamOptions.PrefetchMetadata | PEStreamOptions.PrefetchEntireImage));
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/17088")]
+ [Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/17088")]
public void SubStream()
{
}
[OuterLoop]
- [Theory(Skip = "Can cause improbable memory allocations leading to interminable paging")]
+ [ConditionalTheory(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
[MemberData(nameof(FuzzInputs_MemberData))]
public void Deserialize_FuzzInput(object obj, Random rand)
{
return expr;
}
- [Fact(Skip = "Not yet implemented in compiler. Final behavior may differ.")]
- [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605", TestPlatforms.Any)]
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605")]
public static void SimpleExpression()
{
int notVal = 0;
Assert.Equal("notVal", IntParamMethod(notVal));
}
- [Fact(Skip = "Not yet implemented in compiler. Final behavior may differ.")]
- [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605", TestPlatforms.Any)]
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605")]
public static void ComplexExpression()
{
int x = 5;
IntParamMethod(Math.Min(x + 20, x * x)));
}
- [Fact(Skip = "Not yet implemented in compiler. Final behavior may differ.")]
- [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605", TestPlatforms.Any)]
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605")]
public static void SurroundingWhitespaceHandling()
{
int notVal = 0;
Assert.Equal("notVal", IntParamMethod(notVal));
}
- [Fact(Skip = "Not yet implemented in compiler. Final behavior may differ.")]
- [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605", TestPlatforms.Any)]
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605")]
public static void InternalWhitespaceHandling()
{
int notVal = 0;
notVal + 20)));
}
- [Fact(Skip = "Not yet implemented in compiler. Final behavior may differ.")]
- [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605", TestPlatforms.Any)]
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605")]
public static void InternalCommentHandling()
{
int notVal = 0;
));
}
- [Fact(Skip = "Not yet implemented in compiler. Final behavior may differ.")]
- [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605", TestPlatforms.Any)]
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605")]
public static void OptionalParameterHandling()
{
string suppliedVal = "supplied value";
return expr;
}
- [Fact(Skip = "Not yet implemented in compiler. Final behavior may differ.")]
- [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605", TestPlatforms.Any)]
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605")]
public static void ExtensionMethodThisParameterHandling()
{
int notVal = 0;
return expr;
}
- [Fact(Skip = "Not yet implemented in compiler. Final behavior may differ.")]
- [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605", TestPlatforms.Any)]
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/roslyn/issues/19605")]
public static void InstanceMethodThisHandling()
{
var instance = new InstanceTest();
}
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20486")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/34786", TestPlatforms.AnyUnix)]
+ [Fact]
public void LoadXml()
{
const string pValue = "oDZlcdJA1Kf6UeNEIZqm4KDqA6zpX7CmEtAGWi9pgnBhWOUDVEfhswfsvTLR5BCbKfE6KoHvt5Hh8D1RcAko//iZkLZ+gds9y/5Oxape8tu3TUi1BnNPWu8ieXjMtdnpyudKFsCymssJked1rBeRePG23HTVwOV1DpopjRkjBEU=";
Assert.Equal(result, el.OuterXml);
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void GetXmlWithSetProperty()
{
XmlDocument doc = new XmlDocument();
Assert.Null(aa2);
}
- [Fact(Skip = "SignedXmlTest.DigestValue_CRLF")]
+ [Fact]
public void AddObject_Null()
{
SignedXml sx = new SignedXml();
- Assert.Throws<ArgumentNullException>(() => sx.AddObject(null));
+ sx.AddObject(null);
}
[Fact]
Assert.Throws<CryptographicException>(() => signedXml.ComputeSignature());
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void DataReferenceToNonDataObject()
{
XmlDocument doc = new XmlDocument();
return sw.ToString();
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void GetIdElement_Null()
{
SignedXml sign = new SignedXml();
}
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void VerifyHMAC_ZeroLength()
{
string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
CheckErratum(sign, new HMACSHA1(Encoding.ASCII.GetBytes("secret")), "4");
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void VerifyHMAC_SmallerThanMinimumLength()
{
// 72 is a multiple of 8 but smaller than the minimum of 80 bits
CheckErratum(sign, new HMACSHA1(Encoding.ASCII.GetBytes("secret")), "72");
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void VerifyHMAC_MinimumLength()
{
// 80 bits is the minimum (and the half-size of HMACSHA1)
Assert.True(sign.CheckSignature(new HMACSHA1(Encoding.ASCII.GetBytes("secret"))));
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void VerifyHMAC_SmallerHalfLength()
{
// 80bits is smaller than the half-size of HMACSHA256
CheckErratum(sign, new HMACSHA256(Encoding.ASCII.GetBytes("secret")), "80");
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void VerifyHMAC_HalfLength()
{
// 128 is the half-size of HMACSHA256
Assert.True(sign.CheckSignature(new HMACSHA1(Encoding.ASCII.GetBytes("secret"))));
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void VerifyHMAC_HMACOutputLength_Signature_Mismatch()
{
string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
Assert.Throws<CryptographicException>(() => sign.CheckSignature(new HMACSHA1(Encoding.ASCII.GetBytes("no clue"))));
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
public void VerifyHMAC_HMACOutputLength_Invalid()
{
string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
Assert.Equal(xml, output);
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20487")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20487")]
+ [Fact]
public void PrefixlessNamespaceOutput()
{
XmlDocument doc = new XmlDocument();
Assert.Equal(c14xml3, output);
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
// see LoadInputAsXmlNodeList2 description
public void LoadInputAsXmlNodeList()
{
Assert.Equal("<Test></Test>", output);
}
- [Fact(Skip = "https://github.com/dotnet/runtime/issues/20429")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/20429")]
+ [Fact]
// MS has a bug that those namespace declaration nodes in
// the node-set are written to output. Related spec section is:
// http://www.w3.org/TR/2001/REC-xml-c14n-20010315#ProcessingModel