private void AssertCopyOf(int[] expected, int[] array, int newLength) { var copy = Arrays4.CopyOf(array, newLength); Assert.AreNotSame(array, copy); ArrayAssert.AreEqual(expected, copy); }
public bool ContainsTheSame(Db4objects.Db4o.Internal.ByteArrayBuffer other) { if (other != null) { return(Arrays4.Equals(_buffer, other._buffer)); } return(false); }
public bool ContainsTheSame(ByteArrayBuffer other) { if (other != null) { return(Arrays4.Equals(_buffer, other._buffer)); } return(false); }
public static void ContainsByEquality(object[] array, object[] expected) { for (int i = 0; i < expected.Length; i++) { if (-1 == Arrays4.IndexOfEquals(array, expected[i])) { Assert.Fail("Expecting contains '" + expected[i] + "'."); } } }
public virtual void TestContainsInstanceOf() { object[] array = new object[] { "foo", 42 }; Assert.IsTrue(Arrays4.ContainsInstanceOf(array, typeof(string))); Assert.IsTrue(Arrays4.ContainsInstanceOf(array, typeof(int))); Assert.IsTrue(Arrays4.ContainsInstanceOf(array, typeof(object))); Assert.IsFalse(Arrays4.ContainsInstanceOf(array, typeof(float))); Assert.IsFalse(Arrays4.ContainsInstanceOf(new object[0], typeof(object))); Assert.IsFalse(Arrays4.ContainsInstanceOf(new object[1], typeof(object))); Assert.IsFalse(Arrays4.ContainsInstanceOf(null, typeof(object))); }
private static ITest[] Tests(IntByRef counter, int numTests, int[] failingIndices ) { var tests = new ITest[numTests]; for (var i = 0; i < numTests; i++) { tests[i] = new CountingTest(counter, i + 1, Arrays4.IndexOf (failingIndices, i) >= 0); } return(tests); }
public override bool Equals(object obj) { if (this == obj) { return(true); } if (!(obj is Db4objects.Drs.Foundation.Signature)) { return(false); } Db4objects.Drs.Foundation.Signature other = (Db4objects.Drs.Foundation.Signature) obj; return(Arrays4.Equals(bytes, other.bytes)); }
/// <summary>comparison by signature.</summary> /// <remarks>comparison by signature.</remarks> public override bool Equals(object obj) { if (obj == this) { return(true); } if (obj == null || this.GetType() != obj.GetType()) { return(false); } Db4objects.Db4o.Ext.Db4oDatabase other = (Db4objects.Db4o.Ext.Db4oDatabase)obj; if (null == other.i_signature || null == this.i_signature) { return(false); } return(Arrays4.Equals(other.i_signature, this.i_signature)); }
private void ImplicitlyAndJoinsOnSameField() { object[] nodes = _nodes.ToArray(); for (int i = 0; i < nodes.Length; i++) { object node = nodes[i]; if (node is OrIndexedLeaf) { OrIndexedLeaf current = (OrIndexedLeaf)node; OrIndexedLeaf other = FindJoinOnSameFieldAtSameLevel(current); if (null != other) { nodes[Arrays4.IndexOfIdentity(nodes, other)] = null; CollectImplicitAnd(current.GetConstraint(), current, other); } } } }
protected HardObjectReference GetHardObjectReferenceById(Transaction transaction, int parentId, byte[] signature) { HardObjectReference hardRef = transaction.Container().GetHardObjectReferenceById( transaction, parentId); if (hardRef._reference == null) { return(null); } VirtualAttributes vad = hardRef._reference.VirtualAttributes(transaction, false); if (!Arrays4.Equals(signature, vad.i_database.i_signature)) { return(null); } return(hardRef); }
public virtual void ConcurrentTimestamps(IList concurrentTimestamps) { _concurrentTimestamps = Arrays4.ToLongArray(concurrentTimestamps); }
private static ITest[] Tests(IntByRef counter, int numTests, int[] failingIndices ) { ITest[] tests = new ITest[numTests]; for (int i = 0; i < numTests; i++) { tests[i] = new OpaqueTestSuiteTestCase.CountingTest(counter, i + 1, Arrays4.IndexOf (failingIndices, i) >= 0); } return(tests); }