public void TagToStr_PassFeatEncodedAsId_ReturnsPtrToFeatString() { IntPtr ptr = Marshal.StringToCoTaskMemAnsi(" "); Graphite2Api.TagToStr(1181049204, ptr); var str = Marshal.PtrToStringAnsi(ptr); Assert.AreEqual("Feat", str); Marshal.FreeCoTaskMem(ptr); }
public void FrefId_FirstPaduakFeature_ReturnsExpectedId() { using (var feature = new PaduakFeatureVal()) { UInt32 id = Graphite2Api.FrefId(feature.FeatureRef); Assert.AreEqual(1801744244, id); IntPtr ptr = Marshal.StringToCoTaskMemAnsi(" "); Graphite2Api.TagToStr(id, ptr); var str = Marshal.PtrToStringAnsi(ptr); Assert.AreEqual("kdot", str); Marshal.FreeCoTaskMem(ptr); } }