public void MakeSeg_WithTestStringAndPaduakFont_ReturnsNonNullSegment() { using (var font = new PaduakDisposableFont()) { IntPtr str = Marshal.StringToCoTaskMemAnsi("hello world"); IntPtr error = new IntPtr(0); int numCodePoints = Graphite2Api.CountUnicodeCharacters(Encform.Utf8, str, IntPtr.Zero, ref error); IntPtr seg = Graphite2Api.MakeSeg(font.Font, font.Face, 0, IntPtr.Zero, Encform.Utf8, str, numCodePoints, 0); Assert.AreNotEqual(IntPtr.Zero, seg); Graphite2Api.SegDestroy(seg); Marshal.FreeCoTaskMem(str); } }
public void Dispose() { Graphite2Api.SegDestroy(Seg); Marshal.FreeCoTaskMem(_testData); _font.Dispose(); }
public void SegDestroy_NULL_DoesNotThrowException() { Graphite2Api.SegDestroy(IntPtr.Zero); }