diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /tests/gtests/bmesh | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'tests/gtests/bmesh')
-rw-r--r-- | tests/gtests/bmesh/CMakeLists.txt | 20 | ||||
-rw-r--r-- | tests/gtests/bmesh/bmesh_core_test.cc | 63 |
2 files changed, 42 insertions, 41 deletions
diff --git a/tests/gtests/bmesh/CMakeLists.txt b/tests/gtests/bmesh/CMakeLists.txt index 10484751ca3..4093ace9ff4 100644 --- a/tests/gtests/bmesh/CMakeLists.txt +++ b/tests/gtests/bmesh/CMakeLists.txt @@ -19,17 +19,17 @@ # ***** END GPL LICENSE BLOCK ***** set(INC - . - .. - ../../../source/blender/blenlib - ../../../source/blender/makesdna - ../../../source/blender/bmesh - ../../../intern/guardedalloc + . + .. + ../../../source/blender/blenlib + ../../../source/blender/makesdna + ../../../source/blender/bmesh + ../../../intern/guardedalloc ) set(LIB - bf_blenloader # Should not be needed but gives linking error without it. - bf_bmesh + bf_blenloader # Should not be needed but gives linking error without it. + bf_bmesh ) include_directories(${INC}) @@ -37,9 +37,9 @@ include_directories(${INC}) setup_libdirs() if(WITH_BUILDINFO) - set(_buildinfo_src "$<TARGET_OBJECTS:buildinfoobj>") + set(_buildinfo_src "$<TARGET_OBJECTS:buildinfoobj>") else() - set(_buildinfo_src "") + set(_buildinfo_src "") endif() BLENDER_SRC_GTEST(bmesh_core "bmesh_core_test.cc;${_buildinfo_src}" "${LIB}") unset(_buildinfo_src) diff --git a/tests/gtests/bmesh/bmesh_core_test.cc b/tests/gtests/bmesh/bmesh_core_test.cc index b2cb1a4e8a3..7531568af87 100644 --- a/tests/gtests/bmesh/bmesh_core_test.cc +++ b/tests/gtests/bmesh/bmesh_core_test.cc @@ -4,36 +4,37 @@ #include "bmesh.h" #include "BLI_math.h" -TEST(bmesh_core, BMVertCreate) { - BMesh *bm; - BMVert *bv1, *bv2, *bv3; - const float co1[3] = {1.0f, 2.0f, 0.0f}; +TEST(bmesh_core, BMVertCreate) +{ + BMesh *bm; + BMVert *bv1, *bv2, *bv3; + const float co1[3] = {1.0f, 2.0f, 0.0f}; - BMeshCreateParams bm_params; - bm_params.use_toolflags = true; - bm = BM_mesh_create(&bm_mesh_allocsize_default, &bm_params); - EXPECT_EQ(bm->totvert, 0); - /* make a custom layer so we can see if it is copied properly */ - BM_data_layer_add(bm, &bm->vdata, CD_PROP_FLT); - bv1 = BM_vert_create(bm, co1, NULL, BM_CREATE_NOP); - ASSERT_TRUE(bv1 != NULL); - EXPECT_EQ(bv1->co[0], 1.0f); - EXPECT_EQ(bv1->co[1], 2.0f); - EXPECT_EQ(bv1->co[2], 0.0f); - EXPECT_TRUE(is_zero_v3(bv1->no)); - EXPECT_EQ(bv1->head.htype, (char)BM_VERT); - EXPECT_EQ(bv1->head.hflag, 0); - EXPECT_EQ(bv1->head.api_flag, 0); - bv2 = BM_vert_create(bm, NULL, NULL, BM_CREATE_NOP); - ASSERT_TRUE(bv2 != NULL); - EXPECT_TRUE(is_zero_v3(bv2->co)); - /* create with example should copy custom data but not select flag */ - BM_vert_select_set(bm, bv2, true); - BM_elem_float_data_set(&bm->vdata, bv2, CD_PROP_FLT, 1.5f); - bv3 = BM_vert_create(bm, co1, bv2, BM_CREATE_NOP); - ASSERT_TRUE(bv3 != NULL); - EXPECT_FALSE(BM_elem_flag_test((BMElem *)bv3, BM_ELEM_SELECT)); - EXPECT_EQ(BM_elem_float_data_get(&bm->vdata, bv3, CD_PROP_FLT), 1.5f); - EXPECT_EQ(BM_mesh_elem_count(bm, BM_VERT), 3); - BM_mesh_free(bm); + BMeshCreateParams bm_params; + bm_params.use_toolflags = true; + bm = BM_mesh_create(&bm_mesh_allocsize_default, &bm_params); + EXPECT_EQ(bm->totvert, 0); + /* make a custom layer so we can see if it is copied properly */ + BM_data_layer_add(bm, &bm->vdata, CD_PROP_FLT); + bv1 = BM_vert_create(bm, co1, NULL, BM_CREATE_NOP); + ASSERT_TRUE(bv1 != NULL); + EXPECT_EQ(bv1->co[0], 1.0f); + EXPECT_EQ(bv1->co[1], 2.0f); + EXPECT_EQ(bv1->co[2], 0.0f); + EXPECT_TRUE(is_zero_v3(bv1->no)); + EXPECT_EQ(bv1->head.htype, (char)BM_VERT); + EXPECT_EQ(bv1->head.hflag, 0); + EXPECT_EQ(bv1->head.api_flag, 0); + bv2 = BM_vert_create(bm, NULL, NULL, BM_CREATE_NOP); + ASSERT_TRUE(bv2 != NULL); + EXPECT_TRUE(is_zero_v3(bv2->co)); + /* create with example should copy custom data but not select flag */ + BM_vert_select_set(bm, bv2, true); + BM_elem_float_data_set(&bm->vdata, bv2, CD_PROP_FLT, 1.5f); + bv3 = BM_vert_create(bm, co1, bv2, BM_CREATE_NOP); + ASSERT_TRUE(bv3 != NULL); + EXPECT_FALSE(BM_elem_flag_test((BMElem *)bv3, BM_ELEM_SELECT)); + EXPECT_EQ(BM_elem_float_data_get(&bm->vdata, bv3, CD_PROP_FLT), 1.5f); + EXPECT_EQ(BM_mesh_elem_count(bm, BM_VERT), 3); + BM_mesh_free(bm); } |