Exemplo n.º 1
0
        public void Utf8MarshalTest(string text)
        {
            IntPtr pointer = MarshalString.StringToUtf8(text);
            string marshalled;

            try
            {
                marshalled = MarshalString.Utf8ToString(pointer);
            }
            finally
            {
                if (pointer != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(pointer);
                }
            }
            Assert.Equal(text, marshalled);
        }
Exemplo n.º 2
0
 public void ErrorTest(string result, CurlCode code)
 {
     Assert.Equal(result, MarshalString.Utf8ToString(CurlNative.EasyStrError(code)));
 }