From 7c324f058ce9b05340f1a94718f253c43c2401ca Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Thu, 27 Apr 2017 09:15:08 -0700 Subject: [PATCH] Fix C# MeasureFunc test Summary: Closes https://github.com/facebook/yoga/pull/533 Reviewed By: emilsjolander Differential Revision: D4962771 Pulled By: splhack fbshipit-source-id: 96919da73f0f35c027097259fa189b5658fb11b7 --- csharp/tests/Facebook.Yoga/YogaNodeTest.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/csharp/tests/Facebook.Yoga/YogaNodeTest.cs b/csharp/tests/Facebook.Yoga/YogaNodeTest.cs index 9c604d0d..3151ef24 100644 --- a/csharp/tests/Facebook.Yoga/YogaNodeTest.cs +++ b/csharp/tests/Facebook.Yoga/YogaNodeTest.cs @@ -164,6 +164,14 @@ namespace Facebook.Yoga return MeasureOutput.Make(123.4f, 81.7f); }); node.CalculateLayout(); + Assert.AreEqual(123.0f, node.LayoutWidth); + Assert.AreEqual(82.0f, node.LayoutHeight); + + node = new YogaNode(new YogaConfig{PointScaleFactor = 0}); + node.SetMeasureFunction((_, width, widthMode, height, heightMode) => { + return MeasureOutput.Make(123.4f, 81.7f); + }); + node.CalculateLayout(); Assert.AreEqual(123.4f, node.LayoutWidth); Assert.AreEqual(81.7f, node.LayoutHeight); }