Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Prog2
/
labor_peldak
/
lab_08
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5e4881e2
authored
6 years ago
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feledekeny hallgatok
parent
76267916
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
halmaz/halmaz_teszt.cpp
+12
-12
No files found.
halmaz/halmaz_teszt.cpp
View file @
5e4881e2
...
@@ -3,9 +3,10 @@
...
@@ -3,9 +3,10 @@
*
*
*/
*/
#ifndef
J
PORTA
#ifndef
C
PORTA
#define ELKESZULT
5
#define ELKESZULT
0
#endif
#endif
/**
/**
* ELKESZULT == 0 estén az Ön által készített Set sablon létezését teszteli.
* ELKESZULT == 0 estén az Ön által készített Set sablon létezését teszteli.
* ELKESZULT == 1 esetén a Set működését teszteli néhány alaptípussal.
* ELKESZULT == 1 esetén a Set működését teszteli néhány alaptípussal.
...
@@ -27,6 +28,9 @@
...
@@ -27,6 +28,9 @@
#include "point.h"
#include "point.h"
#include "myset.hpp"
#include "myset.hpp"
#ifndef ELKESZULT
#define ELKESZULT 2 // ha nem definiálta a myset.hpp-ben JPORTA-ra történő feltöltéskor akkor legyen 2
#endif
/// Tagfüggvények létezését tesztelő sablonok generálása nem fontos megértenie
/// Tagfüggvények létezését tesztelő sablonok generálása nem fontos megértenie
CREATE_Has_
(
size
)
CREATE_Has_
(
size
)
...
@@ -102,7 +106,7 @@ int main() {
...
@@ -102,7 +106,7 @@ int main() {
EXPECT_TRUE
(
s0
.
isElement
(
Integer
(
1
)));
EXPECT_TRUE
(
s0
.
isElement
(
Integer
(
1
)));
EXPECT_FALSE
(
s0
.
isElement
(
Integer
(
120
)));
EXPECT_FALSE
(
s0
.
isElement
(
Integer
(
120
)));
}
ENDM
}
ENDM
#endif // ELKESZULT > 1
#endif // ELKESZULT >
=
1
#if (ELKESZULT >= 2 && ELKESZULT < 4) || ELKESZULT == 5
#if (ELKESZULT >= 2 && ELKESZULT < 4) || ELKESZULT == 5
/// insert és isElement tesztelése Point-ra, amikor mindkét koordináta számít az összehasonlításban
/// insert és isElement tesztelése Point-ra, amikor mindkét koordináta számít az összehasonlításban
...
@@ -113,7 +117,7 @@ int main() {
...
@@ -113,7 +117,7 @@ int main() {
EXPECT_FALSE
(
s0
.
isElement
(
Point
(
1
)));
EXPECT_FALSE
(
s0
.
isElement
(
Point
(
1
)));
EXPECT_FALSE
(
s0
.
isElement
(
Point
(
100
)));
EXPECT_FALSE
(
s0
.
isElement
(
Point
(
100
)));
}
ENDM
}
ENDM
#endif //
ELKESZULT >= 2
#endif //
(ELKESZULT >= 2 && ELKESZULT < 4) || ELKESZULT == 5
#if ELKESZULT >= 3
#if ELKESZULT >= 3
/// equal függvény tesztelése int-re
/// equal függvény tesztelése int-re
...
@@ -122,7 +126,7 @@ int main() {
...
@@ -122,7 +126,7 @@ int main() {
EXPECT_TRUE
(
equal
(
a
,
b
));
EXPECT_TRUE
(
equal
(
a
,
b
));
EXPECT_FALSE
(
equal
(
a
,
2
));
EXPECT_FALSE
(
equal
(
a
,
2
));
}
ENDM
}
ENDM
#endif // ELKESZULT >=3
&& ELKESZULT < 4
#endif // ELKESZULT >=3
#if ELKESZULT == 3
#if ELKESZULT == 3
...
@@ -130,13 +134,11 @@ int main() {
...
@@ -130,13 +134,11 @@ int main() {
TEST
(
Point
,
equal
)
{
TEST
(
Point
,
equal
)
{
Point
a
,
b
,
c
(
0
,
1
),
d
(
1
,
1
),
e
(
1
,
0
);
Point
a
,
b
,
c
(
0
,
1
),
d
(
1
,
1
),
e
(
1
,
0
);
EXPECT_TRUE
(
equal
(
a
,
b
));
EXPECT_TRUE
(
equal
(
a
,
b
));
EXPECT_FALSE
(
equal
(
a
,
c
));
TEST
(
Point
,
Xequal
)
{
EXPECT_FALSE
(
equal
(
a
,
c
));
Point
a
,
b
,
c
(
0
,
1
),
d
(
1
,
1
),
e
(
1
,
0
);
EXPECT_TRUE
(
equal
(
a
,
b
));
EXPECT_TRUE
(
equal
(
a
,
c
));
EXPECT_FALSE
(
equal
(
a
,
d
));
EXPECT_FALSE
(
equal
(
a
,
d
));
EXPECT_FALSE
(
equal
(
a
,
e
));
EXPECT_FALSE
(
equal
(
a
,
e
));
}
ENDM
}
ENDM
#endif // ELKESZULT == 3
#endif // ELKESZULT == 3
#if ELKESZULT == 4
#if ELKESZULT == 4
...
@@ -148,9 +150,7 @@ int main() {
...
@@ -148,9 +150,7 @@ int main() {
EXPECT_FALSE
(
equal
(
a
,
d
));
EXPECT_FALSE
(
equal
(
a
,
d
));
EXPECT_FALSE
(
equal
(
a
,
e
));
EXPECT_FALSE
(
equal
(
a
,
e
));
}
ENDM
}
ENDM
#endif // ELKESZULT == 4
#if ELKESZULT == 4
/// insert és isElement tesztelése Point-ra, amikor csak az x koordináta számít az összehasonlításban
/// insert és isElement tesztelése Point-ra, amikor csak az x koordináta számít az összehasonlításban
TEST
(
Point
,
insert
)
{
TEST
(
Point
,
insert
)
{
Set
<
Point
>
s0
;
Set
<
Point
>
s0
;
...
@@ -177,7 +177,7 @@ int main() {
...
@@ -177,7 +177,7 @@ int main() {
EXPECT_TRUE
(
s0
.
isElement
(
Point
(
1
,
8
)));
EXPECT_TRUE
(
s0
.
isElement
(
Point
(
1
,
8
)));
EXPECT_FALSE
(
s0
.
isElement
(
Point
(
100
)));
EXPECT_FALSE
(
s0
.
isElement
(
Point
(
100
)));
}
ENDM
}
ENDM
#endif // ELKESZULT ==
4
#endif // ELKESZULT ==
5
/// Itt a vége
/// Itt a vége
std
::
cout
<<
"ELKESZULT = "
<<
ELKESZULT
<<
std
::
endl
;
std
::
cout
<<
"ELKESZULT = "
<<
ELKESZULT
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
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