Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
fefc815d
Commit
fefc815d
authored
Jan 22, 2016
by
BRAMAS Berenger
Browse files
add utest quicksort
parent
e98870ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
UTests/utestQuicksort.cpp
View file @
fefc815d
...
...
@@ -98,12 +98,34 @@ class TestQuickSort : public FUTester<TestQuickSort> {
delete
[]
array
;
}
void
verySmallParts
(){
{
long
long
values
[
2
]
=
{
0
,
1
};
FQuickSort
<
long
long
,
long
>::
QsSequential
(
values
,
2
);
uassert
(
values
[
0
]
==
0
);
uassert
(
values
[
1
]
==
1
);
}
{
long
long
values
[
2
]
=
{
1
,
0
};
FQuickSort
<
long
long
,
long
>::
QsSequential
(
values
,
2
);
uassert
(
values
[
0
]
==
0
);
uassert
(
values
[
1
]
==
1
);
}
{
long
long
values
[
2
]
=
{
0
,
0
};
FQuickSort
<
long
long
,
long
>::
QsSequential
(
values
,
2
);
uassert
(
values
[
0
]
==
0
);
uassert
(
values
[
1
]
==
0
);
}
}
// set test
void
SetTests
(){
AddTest
(
&
TestQuickSort
::
manyThreads
,
"Many threads"
);
AddTest
(
&
TestQuickSort
::
bigSize
,
"Big sort"
);
AddTest
(
&
TestQuickSort
::
reversed
,
"Reversed"
);
AddTest
(
&
TestQuickSort
::
alreadySorted
,
"Already Sorted"
);
AddTest
(
&
TestQuickSort
::
verySmallParts
,
"Small Parts"
);
}
};
...
...
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