diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2013-12-04 20:12:39 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2013-12-05 12:27:39 +0400 |
commit | bcd4c7d14ee8bd0d4d5ebf2bcedce8bb8c8f177a (patch) | |
tree | dbd217ab3bf2ebe7709f594addfb79996582601b /Testing | |
parent | 354c93ae204a81c06c3807011fa69cfeac085295 (diff) |
Misc unit test fixes
* FontTests.cs: Added test for font weight rendering
* LabelTests.cs: Minor unit test issue
* Label.AlignCenterWrappedChangeText.png: Update test images
* TransformTests.cs: Use a bigger delta when comparing results,
required for Mac.
Diffstat (limited to 'Testing')
-rw-r--r-- | Testing/GtkTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png | bin | 2116 -> 2313 bytes | |||
-rw-r--r-- | Testing/MacTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png | bin | 5003 -> 5696 bytes | |||
-rw-r--r-- | Testing/Tests/FontTests.cs | 21 | ||||
-rw-r--r-- | Testing/Tests/LabelTests.cs | 1 | ||||
-rw-r--r-- | Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.png | bin | 2116 -> 2313 bytes | |||
-rw-r--r-- | Testing/Tests/TransformTests.cs | 2 |
6 files changed, 22 insertions, 2 deletions
diff --git a/Testing/GtkTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png b/Testing/GtkTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png Binary files differindex f1398bc9..08dfe2eb 100644 --- a/Testing/GtkTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png +++ b/Testing/GtkTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png diff --git a/Testing/MacTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png b/Testing/MacTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png Binary files differindex 7d2660e6..edea2d19 100644 --- a/Testing/MacTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png +++ b/Testing/MacTestRunner/ReferenceImages/Label.AlignCenterWrappedChangeText.png diff --git a/Testing/Tests/FontTests.cs b/Testing/Tests/FontTests.cs index be62198a..5c306348 100644 --- a/Testing/Tests/FontTests.cs +++ b/Testing/Tests/FontTests.cs @@ -31,7 +31,7 @@ using Xwt.Drawing; namespace Xwt { [TestFixture] - public class FontTests + public class FontTests: DrawingTestsBase { [Test] public void FromNameEmpty () @@ -228,6 +228,25 @@ namespace Xwt var f2 = Font.FromName ("Arial expanded Oblique Light 33"); Assert.IsTrue (f1.Equals (f2)); } + + [Test] + public void RenderWeight () + { + var font = "Avenir Next"; + + InitBlank (150, 200); + TextLayout la = new TextLayout (); + double y = 0; + + foreach (FontWeight w in Enum.GetValues (typeof(FontWeight))) { + la.Font = Font.FromName (font).WithSize (20).WithWeight (w); + la.Text = "Test " + w.ToString (); + context.DrawTextLayout (la, 0, y + 3); + y += la.GetSize ().Height; + } + + CheckImage ("FontTests.RenderWeight.png"); + } } } diff --git a/Testing/Tests/LabelTests.cs b/Testing/Tests/LabelTests.cs index abb168dd..601237b5 100644 --- a/Testing/Tests/LabelTests.cs +++ b/Testing/Tests/LabelTests.cs @@ -72,6 +72,7 @@ namespace Xwt la.TextAlignment = Alignment.Center; la.Wrap = WrapMode.Word; la.WidthRequest = 200; + la.BackgroundColor = Xwt.Drawing.Colors.LightGray; using (var win = new Window { Width = 200, Height = 100 }) { win.Content = la; diff --git a/Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.png b/Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.png Binary files differindex f1398bc9..08dfe2eb 100644 --- a/Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.png +++ b/Testing/Tests/ReferenceImages/Label.AlignCenterWrappedChangeText.png diff --git a/Testing/Tests/TransformTests.cs b/Testing/Tests/TransformTests.cs index 92c07c85..e4a7a94b 100644 --- a/Testing/Tests/TransformTests.cs +++ b/Testing/Tests/TransformTests.cs @@ -44,7 +44,7 @@ namespace Xwt // There is only a single context used in all tests, // so it MUST be Saved and Restored for each test. - const double DELTA = 0.000000001d; + const double DELTA = 0.000001d; ImageBuilder ib = null; Context context = null; |