Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Prog2
/
labor_peldak
/
lab_05
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
77924e6f
authored
3 years ago
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nullptr teszt külön
parent
5a9cb967
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
string5_test.cpp
+5
-1
No files found.
string5_test.cpp
View file @
77924e6f
...
...
@@ -112,7 +112,9 @@ int main() {
const
String
c
=
a
;
String
d
=
c
;
// konstansból is megy?
EXPECT_STREQ
(
hello
,
d
.
c_str
())
<<
"Baj van a masolo konstruktorral"
<<
endl
;
}
ENDM
TEST
(
Elkeszult5
,
ctor_nullptr
)
{
String
d0
;
String
ures
=
d0
;
// üres sztringet is le tudja másolni?
EXPECT_EQ
((
size_t
)
0
,
ures
.
size
())
<<
"Baj van a string hosszaval"
<<
endl
;
...
...
@@ -150,9 +152,11 @@ int main() {
c
=
d
;
// konstansból is megy?
EXPECT_EQ
(
c
.
size
(),
c
.
size
())
<<
"Ertekedas konstansbol: nem jo a hossz!"
<<
endl
;
EXPECT_STREQ
(
d
.
c_str
(),
c
.
c_str
())
<<
"Ertekadas konstansbol nem sikerult!"
<<
endl
;
}
ENDM
TEST
(
Elkeszult6
,
opAssign_nullptr
)
{
String
d0
;
c
=
d0
;
// üres sztringet is le tudja másolni?
String
c
=
d0
;
// üres sztringet is le tudja másolni?
EXPECT_EQ
((
size_t
)
0
,
c
.
size
())
<<
"Baj van a string hosszaval"
<<
endl
;
/// Ellenőrizzük, hogy üres sztringet ("") kaptunk-e vissza?
EXPECT_STREQ
(
""
,
c
.
c_str
())
<<
"Nem ures sztring jott letre"
<<
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