public void CopyTo() { const int size = 10; var source = Enumerable.Range(0, size).Select(j => new StdVector <Rectangle>(Enumerable.Range(0, size).Select(i => new Rectangle(i, i, i, i)))); var vector = new StdVector <StdVector <Rectangle> >(source); Assert.AreEqual(vector.Size, size); var ret = new StdVector <Rectangle> [15]; vector.CopyTo(ret, 5); for (var j = 0; j < size; j++) { var tmp = ret[j + 5].ToArray(); for (var i = 0; i < size; i++) { Assert.AreEqual(tmp[i].Left, i); Assert.AreEqual(tmp[i].Top, i); Assert.AreEqual(tmp[i].Right, i); Assert.AreEqual(tmp[i].Bottom, i); } } this.DisposeAndCheckDisposedState(vector); foreach (var s in source) { s.Dispose(); } }
public void CopyTo() { const int size = 10; var source = Enumerable.Range(0, size).Select(j => new StdVector <MModRect>(Enumerable.Range(0, size).Select(i => new MModRect { Ignore = true, DetectionConfidence = i }))); var vector = new StdVector <StdVector <MModRect> >(source); Assert.AreEqual(vector.Size, size); var ret = new StdVector <MModRect> [15]; vector.CopyTo(ret, 5); for (var j = 0; j < size; j++) { var tmp = ret[j + 5].ToArray(); for (var i = 0; i < size; i++) { Assert.AreEqual(tmp[i].DetectionConfidence, i); Assert.AreEqual(tmp[i].Ignore, true); } } this.DisposeAndCheckDisposedState(vector); }
public void CopyTo() { const int size = 10; var source = Enumerable.Range(0, size).ToArray(); var vector = new StdVector <int>(source); Assert.Equal(vector.Size, size); var ret = new int[15]; vector.CopyTo(ret, 5); for (var i = 0; i < size; i++) { Assert.Equal(ret[i + 5], i); } this.DisposeAndCheckDisposedState(vector); }
public void CopyTo() { const int size = 10; var source = Enumerable.Range(0, size).Select(i => new StdString(i.ToString())); var vector = new StdVector <StdString>(source); Assert.Equal(vector.Size, size); var ret = new StdString[15]; vector.CopyTo(ret, 5); for (var i = 0; i < size; i++) { Assert.Equal(ret[i + 5].ToString(), i.ToString()); } this.DisposeAndCheckDisposedState(vector); }
public void CopyTo() { const int size = 10; var source = Enumerable.Range(0, size).Select(i => new Matrix <ushort>(i, i)); var vector = new StdVector <Matrix <ushort> >(source); Assert.Equal(vector.Size, size); var ret = new Matrix <ushort> [15]; vector.CopyTo(ret, 5); for (var i = 0; i < size; i++) { Assert.Equal(ret[i + 5].Rows, i); Assert.Equal(ret[i + 5].Columns, i); } this.DisposeAndCheckDisposedState(vector); }
public void CopyTo() { const int size = 10; var source = Enumerable.Range(0, size).Select(i => new Point(i, i)); var vector = new StdVector <Point>(source); Assert.AreEqual(vector.Size, size); var ret = new Point[15]; vector.CopyTo(ret, 5); for (var i = 0; i < size; i++) { Assert.AreEqual(ret[i + 5].X, i); Assert.AreEqual(ret[i + 5].Y, i); } this.DisposeAndCheckDisposedState(vector); }
public void CopyTo() { const int size = 10; var source = Enumerable.Range(0, size).Select(i => new ChipDetails(new DRectangle(i, i, i, i), (uint)i)); var vector = new StdVector <ChipDetails>(source); Assert.Equal(vector.Size, size); var ret = new ChipDetails[15]; vector.CopyTo(ret, 5); for (var i = 0; i < size; i++) { Assert.Equal(ret[i + 5].Rect.Left, i); Assert.Equal(ret[i + 5].Rect.Top, i); Assert.Equal(ret[i + 5].Rect.Right, i); Assert.Equal(ret[i + 5].Rect.Bottom, i); } this.DisposeAndCheckDisposedState(vector); }
public void CopyTo() { const int size = 10; var source = Enumerable.Range(0, size).Select(i => new MModRect { Ignore = true, DetectionConfidence = i }); var vector = new StdVector <MModRect>(source); Assert.Equal(vector.Size, size); var ret = new MModRect[15]; vector.CopyTo(ret, 5); for (var i = 0; i < size; i++) { Assert.Equal(ret[i + 5].DetectionConfidence, i); Assert.Equal(ret[i + 5].Ignore, true); } this.DisposeAndCheckDisposedState(vector); }