FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SFML/test/Network/Ftp.test.cpp at master · criptych/SFML · GitHub
criptych
/
SFML
Public
forked from
SFML/SFML
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
SFML
/
test
/
Network
/
Ftp.test.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
102 lines (90 loc) · 3.92 KB
Breadcrumbs
SFML
/
test
/
Network
/
Ftp.test.cpp
Copy path
File metadata and controls
102 lines (90 loc) · 3.92 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
include
<
SFML/Network/Ftp.hpp
>
#
include
<
catch2/catch_test_macros.hpp
>
#
include
<
type_traits
>
TEST_CASE
(
"
[Network] sf::Ftp
"
)
{
SECTION
(
"
Type traits
"
)
{
static_assert
(!std::is_copy_constructible_v<sf::Ftp>);
static_assert
(!std::is_copy_assignable_v<sf::Ftp>);
static_assert
(!std::is_nothrow_move_constructible_v<sf::Ftp>);
static_assert
(!std::is_nothrow_move_assignable_v<sf::Ftp>);
}
SECTION
(
"
Response
"
)
{
SECTION
(
"
Type traits
"
)
{
static_assert
(std::is_copy_constructible_v<sf::Ftp::Response>);
static_assert
(std::is_copy_assignable_v<sf::Ftp::Response>);
static_assert
(std::is_nothrow_move_constructible_v<sf::Ftp::Response>);
static_assert
(std::is_nothrow_move_assignable_v<sf::Ftp::Response>);
}
SECTION
(
"
Construction
"
)
{
SECTION
(
"
Default constructor
"
)
{
const
sf::Ftp::Response response;
CHECK
(!response.
isOk
());
CHECK
(response.
getStatus
() == sf::Ftp::Response::Status::InvalidResponse);
CHECK
(response.
getMessage
().
empty
());
}
SECTION
(
"
Status constructor
"
)
{
const
sf::Ftp::Response
response
(sf::Ftp::Response::Status::InvalidFile);
CHECK
(!response.
isOk
());
CHECK
(response.
getStatus
() == sf::Ftp::Response::Status::InvalidFile);
CHECK
(response.
getMessage
().
empty
());
}
SECTION
(
"
Status and message constructor
"
)
{
const
sf::Ftp::Response
response
(sf::Ftp::Response::Status::Ok,
"
Ok
"
);
CHECK
(response.
isOk
());
CHECK
(response.
getStatus
() == sf::Ftp::Response::Status::Ok);
CHECK
(response.
getMessage
() ==
"
Ok
"
);
}
}
SECTION
(
"
isOk()
"
)
{
CHECK
(
sf::Ftp::Response
(sf::Ftp::Response::Status::RestartMarkerReply).
isOk
());
CHECK
(
sf::Ftp::Response
(sf::Ftp::Response::Status::Ok).
isOk
());
CHECK
(
sf::Ftp::Response
(sf::Ftp::Response::Status::NeedPassword).
isOk
());
CHECK
(!
sf::Ftp::Response
(sf::Ftp::Response::Status::ServiceUnavailable).
isOk
());
CHECK
(!
sf::Ftp::Response
(sf::Ftp::Response::Status::CommandUnknown).
isOk
());
CHECK
(!
sf::Ftp::Response
(sf::Ftp::Response::Status::InvalidResponse).
isOk
());
}
}
SECTION
(
"
DirectoryResponse
"
)
{
SECTION
(
"
Construction
"
)
{
const
sf::Ftp::DirectoryResponse
directoryResponse
(
sf::Ftp::Response
(sf::Ftp::Response::Status::Ok,
"
Ok
"
));
CHECK
(directoryResponse.
isOk
());
CHECK
(directoryResponse.
getStatus
() == sf::Ftp::Response::Status::Ok);
CHECK
(directoryResponse.
getMessage
() ==
"
Ok
"
);
CHECK
(directoryResponse.
getDirectory
() ==
"
Ok
"
);
}
SECTION
(
"
getDirectory()
"
)
{
CHECK
(
sf::Ftp::DirectoryResponse
(sf::Ftp::Response{}).
getDirectory
().
empty
());
CHECK
(
sf::Ftp::DirectoryResponse
(sf::Ftp::Response{sf::Ftp::Response::Status::Ok,
"
/usr/local/lib
"
}).
getDirectory
() ==
"
/usr/local/lib
"
);
}
}
SECTION
(
"
ListingResponse
"
)
{
SECTION
(
"
Construction
"
)
{
const
sf::Ftp::ListingResponse
listingResponse
(
sf::Ftp::Response
(sf::Ftp::Response::Status::Ok),
"
"
);
CHECK
(listingResponse.
isOk
());
CHECK
(listingResponse.
getStatus
() == sf::Ftp::Response::Status::Ok);
CHECK
(listingResponse.
getMessage
().
empty
());
CHECK
(listingResponse.
getListing
().
empty
());
}
SECTION
(
"
getListing()
"
)
{
const
sf::Ftp::ListingResponse
listingResponse
(
sf::Ftp::Response
(sf::Ftp::Response::Status::Ok),
"
foo
\r\n
bar
\r\n
baz
"
);
CHECK
(listingResponse.
getListing
() == std::vector<std::string>{
"
foo
"
,
"
bar
"
});
}
}
}
Back
|
FazBrowse Home
|
New Git URL