-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use Windows-specific calls if not on Windows
- don't use Win32-specific interop calls to determine the DPI if not on Windows - possible fix for #427 - add a barebones unit test for this - note that even the Windows code isn't correct as soon as you have multiple screens - on macOS, causes 20 instead of 5 unit tests to pass
- Loading branch information
1 parent
dcd30e6
commit 88026af
Showing
2 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Svg.UnitTests | ||
{ | ||
/// <summary> | ||
/// Test that basic graphics operations work. Currently only supported | ||
/// on Windows, macOS, and Linux. | ||
/// </summary> | ||
[TestClass] | ||
public class DpiTest | ||
{ | ||
/// <summary> | ||
/// We should get a valid dpi (probably 72, 96 or similar). | ||
/// </summary> | ||
[TestMethod] | ||
public void TestDpiAboveZero() | ||
{ | ||
Assert.IsTrue(SvgDocument.PointsPerInch > 0); | ||
} | ||
} | ||
} |