Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Prog2
/
szorgalmi_feladatok
/
cipher
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
1c50e735
authored
Apr 01, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zoli' into 'master'
fix CipherQueue test See merge request
!2
parents
ac9b8884
1abaf880
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
test.cpp
+17
-2
No files found.
test.cpp
View file @
1c50e735
...
@@ -110,9 +110,9 @@ int main() {
...
@@ -110,9 +110,9 @@ int main() {
}
END
}
END
#endif
#endif
//CipherQueue tesztek
//CipherQueue tesztek
CipherQueue
queue
;
//kell majd a következőhöz is
#if ELKESZULT > 8
#if ELKESZULT > 8
TEST
(
Cipher_Queue
:
caesar
+
mycipher
,
_meg
tobb
szorgalmit
prog2bol
)
{
TEST
(
Cipher_Queue
:
caesar
+
mycipher
,
_meg
tobb
szorgalmit
prog2bol
)
{
CipherQueue
queue
;
const
CaesarCipher
caesar
(
6
);
const
CaesarCipher
caesar
(
6
);
const
MyCipher
myCipher
(
"abc"
,
-
2
);
const
MyCipher
myCipher
(
"abc"
,
-
2
);
queue
.
add
(
caesar
.
clone
());
queue
.
add
(
caesar
.
clone
());
...
@@ -123,8 +123,22 @@ int main() {
...
@@ -123,8 +123,22 @@ int main() {
EXPECT_STREQ
(
"meg tobb szorgalmit progkettobol"
,
str2
.
c_str
());
EXPECT_STREQ
(
"meg tobb szorgalmit progkettobol"
,
str2
.
c_str
());
}
END
}
END
#endif
#endif
CipherQueue
queue
;
//kell majd a következőkhöz is
#if ELKESZULT > 9
#if ELKESZULT > 9
TEST
(
Cipher_Queue
:
inner
queue
,
_pointert
mindenhova
)
{
TEST
(
Cipher_Queue
:
inner
queue
,
_pointert
mindenhova_alfa
)
{
CipherQueue
inner
;
inner
.
add
(
new
MyCipher
(
"queue"
));
inner
.
add
(
new
CaesarCipher
(
10
));
queue
.
add
(
inner
.
clone
());
queue
.
add
(
queue
.
clone
());
//ennek sem kellene gondot okoznia
std
::
string
str1
=
queue
.
encode
(
"pointert mindenhova"
);
EXPECT_STREQ
(
"pyobdolj gcrdmrlcfs"
,
str1
.
c_str
());
std
::
string
str2
=
queue
.
decode
(
str1
);
EXPECT_STREQ
(
"pointert mindenhova"
,
str2
.
c_str
());
}
END
#endif
#if ELKESZULT > 9
TEST
(
Cipher_Queue
:
inner
queue
,
_pointert
mindenhova_beta
)
{
std
::
srand
(
std
::
time
(
nullptr
));
std
::
srand
(
std
::
time
(
nullptr
));
CipherQueue
inner
;
CipherQueue
inner
;
inner
.
add
(
new
MyCipher
(
"queue"
));
inner
.
add
(
new
MyCipher
(
"queue"
));
...
@@ -164,3 +178,4 @@ int main() {
...
@@ -164,3 +178,4 @@ int main() {
GTEND
(
std
::
cerr
);
GTEND
(
std
::
cerr
);
return
0
;
return
0
;
}
}
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