Files
yoga/tests/CSSLayoutTestUtils/CSSLayoutTestUtils.h
Emil Sjolander ca72b2b796 Use const where possible
Summary: Use const where possible. This does not use const for all variables as that would require too much refactoring for one diff. It does however use const where currently possible as well as does some small refactoring to enable const usage in more locations. Striving for 100% const usage leads to code with is easier to reason about as a reference will always reference the same value. The compiler will also assist if you accidentally override a reference.

Reviewed By: IanChilds

Differential Revision: D3741999

fbshipit-source-id: 1ba7da5784c3047f2d4c03746890192f724aa65e
2016-08-22 07:07:41 -07:00

48 lines
1.3 KiB
C

/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifndef __CSS_LAYOUT_TEST_UTILS_H
#define __CSS_LAYOUT_TEST_UTILS_H
#include <math.h>
#include <stdio.h>
#include <string.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif
#include <CSSLayout/CSSLayout-internal.h>
#include <CSSLayout/CSSMacros.h>
#include <CSSLayout/CSSNodeList.h>
#define SMALL_WIDTH 35
#define SMALL_HEIGHT 18
#define BIG_WIDTH 172
#define BIG_HEIGHT 36
#define SMALL_TEXT "small"
#define LONG_TEXT "loooooooooong with space"
#define MEASURE_WITH_RATIO_2 "measureWithRatio2"
#define MEASURE_WITH_MATCH_PARENT "measureWithMatchParent"
CSS_EXTERN_C_BEGIN
bool test(const CSSNodeRef style, const CSSNodeRef expected_layout);
CSSSize measure(void *context,
float availableWidth,
CSSMeasureMode widthMode,
float availableHeight,
CSSMeasureMode heightMode);
void init_css_node_children(const CSSNodeRef node, const uint32_t childCount);
CSSNodeRef new_test_css_node();
CSS_EXTERN_C_END
#endif