예제 #1
0
        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);
        }
예제 #2
0
 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);
     }
 }