mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-29 11:35:00 -04:00
testlibrary: Make remote existence assertions more friendly
Currently the output produced when assert_remote_in_installation() or assert_remote_not_in_installation() fails is not helpful: it doesn't mention the remote name or where the assertion was called from. Fix those problems by rewriting it as a #define.
This commit is contained in:
committed by
Simon McVittie
parent
f753dd214c
commit
dd48e78652
@@ -3448,19 +3448,21 @@ _is_remote_in_installation (FlatpakInstallation *installation,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
assert_remote_in_installation (FlatpakInstallation *installation,
|
||||
const char *remote_name)
|
||||
{
|
||||
g_assert_true (_is_remote_in_installation (installation, remote_name));
|
||||
}
|
||||
#define assert_remote_in_installation(inst, remote) \
|
||||
G_STMT_START { \
|
||||
if (!_is_remote_in_installation (inst, remote)) \
|
||||
g_assertion_message (G_LOG_DOMAIN, \
|
||||
__FILE__, __LINE__, G_STRFUNC, \
|
||||
"remote " remote " not found"); \
|
||||
} G_STMT_END
|
||||
|
||||
static void
|
||||
assert_remote_not_in_installation (FlatpakInstallation *installation,
|
||||
const char *remote_name)
|
||||
{
|
||||
g_assert_true (!_is_remote_in_installation (installation, remote_name));
|
||||
}
|
||||
#define assert_remote_not_in_installation(inst, remote) \
|
||||
G_STMT_START { \
|
||||
if (_is_remote_in_installation (inst, remote)) \
|
||||
g_assertion_message (G_LOG_DOMAIN, \
|
||||
__FILE__, __LINE__, G_STRFUNC, \
|
||||
"remote " remote " was found"); \
|
||||
} G_STMT_END
|
||||
|
||||
static gboolean
|
||||
add_new_remote3 (FlatpakTransaction *transaction,
|
||||
|
||||
Reference in New Issue
Block a user