Fix test crashing if "xdg-mime" did not exist
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 21s
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 21s
This commit is contained in:
parent
67f59e1354
commit
8d2e5f52a4
1 changed files with 3 additions and 1 deletions
|
@ -979,7 +979,9 @@ int main(int argc, char **argv) {
|
||||||
{
|
{
|
||||||
FILE *fd = fopen("/usr/bin/xdg-mime", "rb");
|
FILE *fd = fopen("/usr/bin/xdg-mime", "rb");
|
||||||
int_fast8_t is_xdg_mime_exists = fd ? 1 : 0;
|
int_fast8_t is_xdg_mime_exists = fd ? 1 : 0;
|
||||||
|
if (fd) {
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_xdg_mime_exists) {
|
if (is_xdg_mime_exists) {
|
||||||
CHECK_TRUE(c_simple_http_is_xdg_mime_available());
|
CHECK_TRUE(c_simple_http_is_xdg_mime_available());
|
||||||
|
|
Loading…
Reference in a new issue