2007-08-01 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / class / System.Drawing / Test / System.Drawing / GDIPlusTest.cs
index a942269f765bad85cd4a1e0644115cafa98a18a0..7e70beb9b9c84889fc0191f17b5c4d2e85f3d6a8 100644 (file)
@@ -106,6 +106,23 @@ namespace MonoTests.System.Drawing {
                        Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteFontFamily (font_family), "second");
                }
 
+               [Test]
+               public void CloneFontFamily ()
+               {
+                       IntPtr font_family = IntPtr.Zero;
+                       Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCloneFontFamily (IntPtr.Zero, out font_family), "GdipCloneFontFamily(null)");
+
+                       GDIPlus.GdipCreateFontFamilyFromName ("Arial", IntPtr.Zero, out font_family);
+                       if (font_family != IntPtr.Zero) {
+                               IntPtr clone;
+                               Assert.AreEqual (Status.Ok, GDIPlus.GdipCloneFontFamily (font_family, out clone), "GdipCloneFontFamily(arial)");
+                               Assert.IsTrue (clone != IntPtr.Zero, "clone");
+                               Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteFontFamily (font_family), "GdipDeleteFontFamily(arial)");
+                               Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteFontFamily (clone), "GdipDeleteFontFamily(clone)");
+                       } else
+                               Assert.Ignore ("Arial isn't available on this platform");
+               }
+
                // Font
                [Test]
                public void CreateFont ()