Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pierre Fernbach
curves
Commits
1fd24d45
Commit
1fd24d45
authored
May 04, 2020
by
Pierre Fernbach
Browse files
[Tests] add tests highlighting issue #25
parent
6f2af443
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/Main.cpp
View file @
1fd24d45
...
...
@@ -490,6 +490,36 @@ void cubicConversionTest(bool& error) {
curve_abc_t
*
bc_der
=
bc0
.
compute_derivate_ptr
(
1
);
polynomial_t
pol_test
=
polynomial_from_curve
<
polynomial_t
>
(
*
bc_der
);
CompareCurves
<
curve_abc_t
,
polynomial_t
>
(
*
bc_der
,
pol_test
,
errMsg1
,
error
);
// check that an error is correctly raised when degree > 3:
point3_t
a
(
1
,
2
,
3
);
point3_t
b
(
2
,
3
,
4
);
point3_t
c
(
3
,
4
,
5
);
point3_t
d
(
3
,
6
,
7
);
point3_t
e
(
3
,
6
,
7
);
t_pointX_t
vec
;
vec
.
push_back
(
a
);
vec
.
push_back
(
b
);
vec
.
push_back
(
c
);
vec
.
push_back
(
d
);
vec
.
push_back
(
e
);
polynomial_t
pol_4
(
vec
.
begin
(),
vec
.
end
(),
0
,
1
);
if
(
pol_4
.
degree
()
!=
4
){
std
::
cout
<<
"In test CubicConversionTest - Error in the creatin of the polynomial"
<<
std
::
endl
;
error
=
true
;
}
try
{
cubic_hermite_spline_t
chs3
=
hermite_from_curve
<
cubic_hermite_spline_t
>
(
pol_4
);
std
::
cout
<<
"In test CubicConversionTest - Cannot convert to hermite from degree > 3, should raise an error"
<<
std
::
endl
;
error
=
true
;
}
catch
(
std
::
invalid_argument
e
)
{
}
try
{
bezier_t
b3
=
bezier_from_curve
<
bezier_t
>
(
pol_4
);
std
::
cout
<<
"In test CubicConversionTest - Cannot convert to bezier from degree > 3, should raise an error"
<<
std
::
endl
;
error
=
true
;
}
catch
(
std
::
invalid_argument
e
)
{
}
}
/*Exact Cubic Function tests*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment