From be67015ab5565abcfbf2a2b114dc2025ed331f7e Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Fri, 5 Apr 2013 19:33:08 +0200 Subject: [PATCH] Tests: weaker timeouts --- .../MatrixStructureTheory.Access.cs | 52 +++++++++---------- .../MatrixStructureTheory.Reform.cs | 20 +++---- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.Access.cs b/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.Access.cs index 4ed903cc..7264e1e4 100644 --- a/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.Access.cs +++ b/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.Access.cs @@ -6,7 +6,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { partial class MatrixStructureTheory { - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetFieldsByIndex(Matrix matrix) { Assert.That(() => matrix[0, 0], Throws.Nothing); @@ -18,7 +18,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix[0, matrix.ColumnCount], Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetRow(Matrix matrix) { // First Row @@ -42,7 +42,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.Row(matrix.RowCount), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetRowIntoResult(Matrix matrix) { var row = CreateVectorZero(matrix.ColumnCount); @@ -58,7 +58,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.Row(matrix.RowCount, row), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetRowWithRange(Matrix matrix) { // First Row, Columns 0..1 @@ -93,7 +93,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.Row(0, 0, matrix.ColumnCount + 1), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetRowWithRangeIntoResult(Matrix matrix) { var row = CreateVectorZero(matrix.ColumnCount - 1); @@ -110,7 +110,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.Row(0, 0, matrix.ColumnCount, row), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetColumn(Matrix matrix) { // First Column @@ -134,7 +134,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.Column(matrix.ColumnCount), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetColumnIntoResult(Matrix matrix) { var col = CreateVectorZero(matrix.RowCount); @@ -150,7 +150,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.Column(matrix.ColumnCount, col), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetColumnWithRange(Matrix matrix) { // First Column, Rows 0..1 @@ -185,7 +185,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.Column(0, 0, matrix.RowCount + 1), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetColumnWithRangeIntoResult(Matrix matrix) { var col = CreateVectorZero(matrix.RowCount - 1); @@ -202,7 +202,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.Column(0, 0, matrix.RowCount, col), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanSetRow(Matrix matrix) { // First Row @@ -237,7 +237,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.SetRow(0, CreateVectorZero(matrix.ColumnCount + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanSetRowArray(Matrix matrix) { // First Row @@ -270,7 +270,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.SetRow(0, new T[matrix.ColumnCount + 1]), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanSetColumn(Matrix matrix) { // First Column @@ -305,7 +305,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.SetColumn(0, CreateVectorZero(matrix.RowCount + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanSetColumnArray(Matrix matrix) { // First Column @@ -338,7 +338,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.SetColumn(0, new T[matrix.RowCount + 1]), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetUpperTriangle(Matrix matrix) { var upper = matrix.UpperTriangle(); @@ -351,7 +351,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests } } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetUpperTriangleIntoResult(Matrix matrix) { var dense = CreateDenseZero(matrix.RowCount, matrix.ColumnCount); @@ -379,7 +379,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.UpperTriangle(CreateDenseZero(matrix.RowCount, matrix.ColumnCount + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetLowerTriangle(Matrix matrix) { var upper = matrix.LowerTriangle(); @@ -392,7 +392,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests } } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetLowerTriangleIntoResult(Matrix matrix) { var dense = CreateDenseZero(matrix.RowCount, matrix.ColumnCount); @@ -420,7 +420,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.LowerTriangle(CreateDenseZero(matrix.RowCount, matrix.ColumnCount + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetStrictlyUpperTriangle(Matrix matrix) { var upper = matrix.StrictlyUpperTriangle(); @@ -433,7 +433,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests } } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetStrictlyUpperTriangleIntoResult(Matrix matrix) { var dense = CreateDenseZero(matrix.RowCount, matrix.ColumnCount); @@ -461,7 +461,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.StrictlyUpperTriangle(CreateDenseZero(matrix.RowCount, matrix.ColumnCount + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetStrictlyLowerTriangle(Matrix matrix) { var upper = matrix.StrictlyLowerTriangle(); @@ -474,7 +474,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests } } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetStrictlyLowerTriangleIntoResult(Matrix matrix) { var dense = CreateDenseZero(matrix.RowCount, matrix.ColumnCount); @@ -502,7 +502,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.StrictlyLowerTriangle(CreateDenseZero(matrix.RowCount, matrix.ColumnCount + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetDiagonal(Matrix matrix) { var diag = matrix.Diagonal(); @@ -513,7 +513,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests } } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanSetDiagonal(Matrix matrix) { var m = matrix.Clone(); @@ -533,7 +533,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.SetDiagonal(CreateVectorZero(Math.Min(matrix.RowCount, matrix.ColumnCount) + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanSetDiagonalArray(Matrix matrix) { var m = matrix.Clone(); @@ -552,7 +552,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.SetDiagonal(new T[Math.Min(matrix.RowCount, matrix.ColumnCount) + 1]), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanGetSubmatrix(Matrix matrix) { // Top Left Corner 2x2 @@ -594,7 +594,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.SubMatrix(0, 1, 0, 0), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanSetSubmatrix(Matrix matrix) { // Top Left Corner 2x2 diff --git a/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.Reform.cs b/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.Reform.cs index ade63a1d..3c6b7039 100644 --- a/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.Reform.cs +++ b/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.Reform.cs @@ -7,7 +7,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { partial class MatrixStructureTheory { - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanPermuteRows(Matrix matrix) { var m = matrix.Clone(); @@ -36,7 +36,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests } } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanPermuteColumns(Matrix matrix) { var m = matrix.Clone(); @@ -65,7 +65,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests } } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanInsertRow(Matrix matrix) { var row = CreateVectorRandom(matrix.ColumnCount, 0); @@ -101,7 +101,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.InsertRow(0, CreateVectorZero(matrix.ColumnCount + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanInsertColumn(Matrix matrix) { var column = CreateVectorRandom(matrix.RowCount, 0); @@ -137,7 +137,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => matrix.InsertColumn(0, CreateVectorZero(matrix.RowCount + 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanAppend(Matrix left, Matrix right) { // IF @@ -159,7 +159,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => left.Append(default(Matrix)), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanAppendIntoResult(Matrix left, Matrix right) { // IF @@ -186,7 +186,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => left.Append(right, CreateDenseZero(left.RowCount, left.ColumnCount + right.ColumnCount - 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanStack(Matrix top, Matrix bottom) { // IF @@ -208,7 +208,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => top.Stack(default(Matrix)), Throws.InstanceOf()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanStackIntoResult(Matrix top, Matrix bottom) { // IF @@ -235,7 +235,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => top.Stack(bottom, CreateDenseZero(top.RowCount + bottom.RowCount, top.ColumnCount - 1)), Throws.ArgumentException); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanDiagonalStack(Matrix left, Matrix right) { var result = left.DiagonalStack(right); @@ -261,7 +261,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(() => left.DiagonalStack(default(Matrix)), Throws.InstanceOf(), "{0}+{1}->{2}", left.GetType(), right.GetType(), result.GetType()); } - [Theory, Timeout(200)] + [Theory, Timeout(500)] public void CanDiagonalStackIntoResult(Matrix left, Matrix right) { var result = CreateDenseZero(left.RowCount + right.RowCount, left.ColumnCount + right.ColumnCount);