Add tests to cover 95.3% of constrainteq.cpp branches. · sg-dev1/solvespace_python@e462387 · GitHub
Skip to content

Commit e462387

Browse files
committed
Add tests to cover 95.3% of constrainteq.cpp branches.
1 parent 4b49442 commit e462387

141 files changed

Lines changed: 20990 additions & 161 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/constrainteq.cpp

Lines changed: 2 additions & 2 deletions

src/drawconstraint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ void Constraint::DoLineWithArrows(Canvas *canvas, Canvas::hStroke hcs,
227227
if(!onlyOneExt) {
228228
DoLine(canvas, hcs, b, be.Plus(out.WithMagnitude(10*pixels)));
229229
} else {
230-
Vector prj = be;
231-
DoProjectedPoint(canvas, hcs, &prj);
230+
// Vector prj = be;
231+
// DoProjectedPoint(canvas, hcs, &prj);
232232
}
233233

234234
int within = DoLineTrimmedAgainstBox(canvas, hcs, ref, ae, be);

test/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ add_custom_target(solvespace-test ALL
6565
# coverage reports
6666

6767
if(ENABLE_COVERAGE)
68-
set(LCOV_FLAGS -q --rc lcov_branch_coverage=1 --rc lcov_excl_line=ssassert)
69-
set(LCOV_FLAGS ${LCOV_FLAGS} --gcov-tool ${GCOV})
68+
set(LCOV_FLAGS -q --gcov-tool ${GCOV})
69+
set(LCOV_FLAGS ${LCOV_FLAGS} --rc lcov_branch_coverage=1)
70+
set(LCOV_FLAGS ${LCOV_FLAGS} --rc "lcov_excl_line=(ssassert|switch)")
71+
set(LCOV_FLAGS ${LCOV_FLAGS} --rc "lcov_excl_br_line=BRANCH_ALWAYS_TAKEN")
7072
set(LCOV_COLLECT -c -b ${CMAKE_SOURCE_DIR}/src -d ${CMAKE_BINARY_DIR}/src --no-external)
7173

7274
add_custom_command(
4.73 KB
Loading
Lines changed: 355 additions & 0 deletions

0 commit comments

Comments
 (0)