fix access violation on vprintf
This commit is contained in:
@@ -212,7 +212,7 @@ namespace Facebook.Yoga
|
||||
parent.Insert(0, child0);
|
||||
parent.Insert(0, child1);
|
||||
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]
|
||||
|
@@ -592,7 +592,7 @@ static void YGIndent(const uint32_t n) {
|
||||
|
||||
static void YGPrintNumberIfNotZero(const char *str, const YGValue number) {
|
||||
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) {
|
||||
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" : "%");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user