fix access violation on vprintf

This commit is contained in:
Lukas Woehrl
2016-12-19 23:47:56 +01:00
parent d1d0618d4c
commit 08eb9ff8f7
2 changed files with 3 additions and 3 deletions

View File

@@ -212,7 +212,7 @@ namespace Facebook.Yoga
parent.Insert(0, child0); parent.Insert(0, child0);
parent.Insert(0, child1); parent.Insert(0, child1);
parent.CalculateLayout(); parent.CalculateLayout();
Assert.AreEqual(parent.Print(), "{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100, height: 120, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35, height: 45, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30, height: 40, },\n]},\n"); Assert.AreEqual(parent.Print(), "{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100px, height: 120px, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35px, height: 45px, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30px, height: 40px, },\n]},\n");
} }
[Test] [Test]

View File

@@ -592,7 +592,7 @@ static void YGIndent(const uint32_t n) {
static void YGPrintNumberIfNotZero(const char *str, const YGValue number) { static void YGPrintNumberIfNotZero(const char *str, const YGValue number) {
if (!YGFloatsEqual(number.value, 0)) { if (!YGFloatsEqual(number.value, 0)) {
YGLog(YGLogLevelDebug, "%s: %g%s, ", str, number, number.unit == YGUnitPixel ? "px" : "%"); YGLog(YGLogLevelDebug, "%s: %g%s, ", str, number.value, number.unit == YGUnitPixel ? "px" : "%");
} }
} }
@@ -604,7 +604,7 @@ static void YGPrintNumberIfNotUndefinedf(const char *str, const float number) {
static void YGPrintNumberIfNotUndefined(const char *str, const YGValue number) { static void YGPrintNumberIfNotUndefined(const char *str, const YGValue number) {
if (number.isDefined) { if (number.isDefined) {
YGLog(YGLogLevelDebug, "%s: %g%s, ", str, number, number.unit == YGUnitPixel ? "px" : "%"); YGLog(YGLogLevelDebug, "%s: %g%s, ", str, number.value, number.unit == YGUnitPixel ? "px" : "%");
} }
} }