summaryrefslogtreecommitdiffstats
path: root/src/tests/support.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:22:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:22:08 +0000
commit55fffa809312f6c0ae40528fd1ee66b7559c4650 (patch)
treebb6b3e63b35220d36bdc654f784a985e88ba1cd2 /src/tests/support.cpp
parentReleasing progress-linux version 0.17.0-3~progress7.99u1. (diff)
downloadrnp-55fffa809312f6c0ae40528fd1ee66b7559c4650.tar.xz
rnp-55fffa809312f6c0ae40528fd1ee66b7559c4650.zip
Merging upstream version 0.17.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tests/support.cpp')
-rw-r--r--src/tests/support.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tests/support.cpp b/src/tests/support.cpp
index c94a901..2867304 100644
--- a/src/tests/support.cpp
+++ b/src/tests/support.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 [Ribose Inc](https://www.ribose.com).
+ * Copyright (c) 2017-2023 [Ribose Inc](https://www.ribose.com).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@@ -184,6 +184,7 @@ path_mkdir(mode_t mode, const char *first, ...)
assert_int_equal(0, RNP_MKDIR(buffer, mode));
}
+#ifndef WINSHELLAPI
static int
remove_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
{
@@ -193,6 +194,7 @@ remove_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ft
return ret;
}
+#endif
static const char *
get_tmp()
@@ -737,7 +739,9 @@ check_json_field_bool(json_object *obj, const std::string &field, bool value)
if (!json_object_is_type(fld, json_type_boolean)) {
return false;
}
- return json_object_get_boolean(fld) == value;
+ // 'json_object_get_boolean' returns 'json_bool' which is 'int' on Windows
+ // but bool on other platforms
+ return (json_object_get_boolean(fld) ? true : false) == value;
}
bool