Lolly 1.4.28
Loading...
Searching...
No Matches
Functions
md5_test.cpp File Reference
#include "a_lolly_test.hpp"
#include "file.hpp"
#include "lolly/hash/md5.hpp"
Include dependency graph for md5_test.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("md5_hexdigest")
 

Function Documentation

◆ TEST_CASE()

TEST_CASE ( "md5_hexdigest" )

Definition at line 18 of file md5_test.cpp.

18 {
19 SUBCASE ("normal file") {
20 string_eq (md5_hexdigest (url_pwd () * "LICENSE"),
21 "d32239bcb673463ab874e80d47fae504");
22 }
23 SUBCASE ("empty file") {
24 url temp= url_temp ();
25 string_save ("", temp);
26 CHECK_EQ (file_size (temp), 0);
27 string_eq (md5_hexdigest (temp), "d41d8cd98f00b204e9800998ecf8427e");
28 }
29 SUBCASE ("invalid file") {
30 string_eq (md5_hexdigest (url_system ("https://mogan.app")), "");
31 string_eq (md5_hexdigest (url_system ("/path/to/not_exist")), "");
32 }
33}
The list class represents a linked list.
Definition list.hpp:48
Definition url.hpp:37
void string_save(const string &s, url u)
Definition file.cpp:496
url url_temp(string suffix)
Definition file.cpp:274
int file_size(url u)
Definition file.cpp:155
void string_eq(string left, string right)
url url_system(string name)
Definition url.cpp:306
url url_pwd()
Definition url.cpp:326