ResizeBuffer() public method

public ResizeBuffer ( int newSize ) : char[]
newSize int
return char[]
 public virtual void TestResize()
 {
     CharTermAttribute t = new CharTermAttribute();
     char[] content = "hello".ToCharArray();
     t.CopyBuffer(content, 0, content.Length);
     for (int i = 0; i < 2000; i++)
     {
         t.ResizeBuffer(i);
         Assert.IsTrue(i <= t.Buffer().Length);
         Assert.AreEqual("hello", t.ToString());
     }
 }
Exemplo n.º 2
0
        public virtual void TestResize()
        {
            CharTermAttribute t = new CharTermAttribute();

            char[] content = "hello".ToCharArray();
            t.CopyBuffer(content, 0, content.Length);
            for (int i = 0; i < 2000; i++)
            {
                t.ResizeBuffer(i);
                Assert.IsTrue(i <= t.Buffer().Length);
                Assert.AreEqual("hello", t.ToString());
            }
        }