public void FrefValue_FirstPaduakFeatureSettingOne_ReturnsOne() { using (var feature = new PaduakFeatureVal()) { UInt16 val = Graphite2Api.FrefValue(feature.FeatureRef, 1); Assert.AreEqual(1, val); } }
public void FrefNValues_FirstPaduakFeature_ReturnsTwo() { using (var feature = new PaduakFeatureVal()) { int numval = Graphite2Api.FrefNValues(feature.FeatureRef); Assert.AreEqual(2, numval); } }
public void FrefValueLabel_FirstPaduakFeature_ReturnsFalseString() { using (var feature = new PaduakFeatureVal()) { uint length; ushort lang = (ushort)Graphite2Api.StrToTag("en"); IntPtr labelPtr = Graphite2Api.FrefValueLabel(feature.FeatureRef, 0, ref lang, Encform.Utf8, out length); Assert.AreEqual("False", Marshal.PtrToStringAnsi(labelPtr)); Assert.AreEqual(5, length); Graphite2Api.LabelDestroy(labelPtr); } }
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); } }
public void FrefFeatureValue_FirstPaduakFeature_ReturnsZero() { using (var feature = new PaduakFeatureVal()) { uint lang = Graphite2Api.StrToTag("en"); IntPtr gr_feature_val = Graphite2Api.FaceFeaturevalForLang(feature.Face, lang); UInt16 val = Graphite2Api.FrefFeatureValue(feature.FeatureRef, gr_feature_val); Assert.AreEqual(0, val); Graphite2Api.FeatureValDestroy(gr_feature_val); } }
public void FrefLabel_FirstPaduakFeature_ReturnsExpectedString() { using (var feature = new PaduakFeatureVal()) { ushort lang = (ushort)Graphite2Api.StrToTag("en"); UInt32 length; IntPtr labelPtr = Graphite2Api.FrefLabel(feature.FeatureRef, ref lang, Encform.Utf8, out length); string label = Marshal.PtrToStringAnsi(labelPtr); Assert.AreEqual("Khamti style dots", label); Graphite2Api.LabelDestroy(labelPtr); } }