Ejemplo n.º 1
0
        // Verify that source.Fetch(min, lim) produces the specified string
        private void VerifyFetch(TextSource source, int min, int lim, string expected)
        {
            string got;

            using (ArrayPtr ptr = new ArrayPtr((lim - min) * 2 + 2))
            {
                source.Fetch(min, lim, ptr.IntPtr);
                got = MarshalEx.NativeToString(ptr, lim - min, true);
            }
            Assert.AreEqual(expected, got, "fetch from " + min + " to " + lim);
        }
Ejemplo n.º 2
0
		// Verify that source.Fetch(min, lim) produces the specified string
		private void VerifyFetch(TextSource source, int min, int lim, string expected)
		{
			string got;
			using (ArrayPtr ptr = new ArrayPtr((lim - min) * 2 + 2))
			{
				source.Fetch(min, lim, ptr.IntPtr);
				got = MarshalEx.NativeToString(ptr, lim - min, true);
			}
			Assert.AreEqual(expected, got, "fetch from " + min + " to " + lim);
		}