Specify format folders more granularly

Summary: We don't want to format files in lib/ for example. For some reason java/jni and tests/CSSLayoutTestUtils folders were previously ignored. This change formats those folders as well.

Reviewed By: lucasr

Differential Revision: D3715203

fbshipit-source-id: 37bcbd36bcf8535cfca73d6a806ab0f1d097dde7
This commit is contained in:
Emil Sjolander
2016-08-15 09:15:09 -07:00
committed by Facebook Github Bot 6
parent 53ff4f59ca
commit 48e5304276
4 changed files with 79 additions and 42 deletions

View File

@@ -46,8 +46,12 @@ static bool are_layout_equal(CSSNode *a, CSSNode *b) {
return true;
}
CSSSize measure(void *context, float width, CSSMeasureMode widthMode, float height, CSSMeasureMode heightMode) {
const char *text = (const char *)context;
CSSSize measure(void *context,
float width,
CSSMeasureMode widthMode,
float height,
CSSMeasureMode heightMode) {
const char *text = (const char *) context;
CSSSize result;
if (strcmp(text, SMALL_TEXT) == 0) {
if (widthMode == CSSMeasureModeUndefined) {
@@ -105,7 +109,7 @@ CSSSize measure(void *context, float width, CSSMeasureMode widthMode, float heig
}
bool test(CSSNode *style, CSSNode *expected_layout) {
CSSNodeCalculateLayout(style, CSSUndefined, CSSUndefined, (CSSDirection)-1);
CSSNodeCalculateLayout(style, CSSUndefined, CSSUndefined, (CSSDirection) -1);
return are_layout_equal(style, expected_layout);
}

View File

@@ -10,16 +10,16 @@
#ifndef __CSS_LAYOUT_TEST_UTILS_H
#define __CSS_LAYOUT_TEST_UTILS_H
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif
#include <CSSLayout/CSSMacros.h>
#include <CSSLayout/CSSLayout-internal.h>
#include <CSSLayout/CSSMacros.h>
#include <CSSLayout/CSSNodeList.h>
#define SMALL_WIDTH 35
@@ -34,7 +34,11 @@
CSS_EXTERN_C_BEGIN
bool test(CSSNode *style, CSSNode *expected_layout);
CSSSize measure(void *context, float width, CSSMeasureMode widthMode, float height, CSSMeasureMode heightMode);
CSSSize measure(void *context,
float width,
CSSMeasureMode widthMode,
float height,
CSSMeasureMode heightMode);
void init_css_node_children(CSSNode *node, int childCount);
CSSNode *new_test_css_node(void);