Skip to content

Replace deprecated check macros #1707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dnf-4-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions libdnf/utils/smartcols/Table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,12 @@ void Table::addLine(const std::shared_ptr<Line> &line)
lines.push_back(line);
}

void Table::removeColumn(const std::shared_ptr<Column> &column)
{
std::remove(std::begin(columns), std::end(columns), column);
scols_table_remove_column(table, column->column);
}

void Table::removeColumns()
{
columns.clear();
scols_table_remove_columns(table);
}

void Table::removeLine(const std::shared_ptr<Line> &line)
{
std::remove(std::begin(lines), std::end(lines), line);
scols_table_remove_line(table, line->line);
}

void Table::removeLines()
{
lines.clear();
Expand Down
2 changes: 0 additions & 2 deletions libdnf/utils/smartcols/Table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ class Table
void enableNolinesep(bool enable) { scols_table_enable_nolinesep(table, enable); }

void addColumn(const std::shared_ptr<Column> &column);
void removeColumn(const std::shared_ptr<Column> &column);
void removeColumns();
void moveColumn(const std::shared_ptr<Column> &before, const std::shared_ptr<Column> &toMove);
std::shared_ptr<Column> newColumn(const std::string &name, double widthHint = 0, int flags = 0);
std::shared_ptr<Column> nextColumn(std::vector<std::shared_ptr<Column>>::iterator &iterator) { return *(iterator++); }

void addLine(const std::shared_ptr<Line> &line);
void removeLine(const std::shared_ptr<Line> &line);
void removeLines();
std::shared_ptr<Line> newLine();
std::shared_ptr<Line> newLine(const std::shared_ptr<Line> &parent);
Expand Down
14 changes: 7 additions & 7 deletions tests/hawkey/test_goal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ get_latest_pkg(DnfSack *sack, const char *name)
hy_query_filter(q, HY_PKG_REPONAME, HY_NEQ, HY_SYSTEM_REPO_NAME);
hy_query_filter_latest_per_arch(q, 1);
GPtrArray *plist = hy_query_run(q);
fail_unless(plist->len == 1,
"get_latest_pkg() failed finding '%s'.", name);
ck_assert_msg(plist->len == 1,
"get_latest_pkg() failed finding '%s'.", name);
auto pkg = static_cast<DnfPackage *>(g_object_ref(g_ptr_array_index(plist, 0)));
hy_query_free(q);
g_ptr_array_unref(plist);
Expand Down Expand Up @@ -436,7 +436,7 @@ assert_list_names(bool wanted, GPtrArray *plist, ...)
va_start(names, plist);
while ((name = va_arg(names, char *)) != NULL) {
if (i++ >= count) {
fail("assert_list_names(): list too short");
ck_abort_msg("assert_list_names(): list too short");
}
bool found = false;
for (auto string: stringVector) {
Expand All @@ -446,16 +446,16 @@ assert_list_names(bool wanted, GPtrArray *plist, ...)
}
}
if ((wanted && !found) || (!wanted && found)) {
fail_unless(false, "assert_list_names(): element '%s' %sfound '%zu'",
name, wanted ? "not ": "", stringVector.size());
ck_abort_msg("assert_list_names(): element '%s' %sfound '%zu'",
name, wanted ? "not ": "", stringVector.size());
}
}
// In the wanted case; we expect all the pkgs in the lists to fully
// describe each other. Otherwise, in the !wanted case we just care that
// all the passed pkg arguments are *not* found in the list, which is
// already checked above.
if (wanted) {
fail_unless(i == count, "assert_list_names(): too many items in the list (%d vs %d)", i, count);
ck_assert_msg(i == count, "assert_list_names(): too many items in the list (%d vs %d)", i, count);
}
va_end(names);
}
Expand Down Expand Up @@ -493,7 +493,7 @@ START_TEST(test_goal_upgrade_all)
g_ptr_array_unref(plist_obs);
g_ptr_array_unref(plist);

fail_unless(size_and_free(hy_goal_list_installs(goal, NULL)) == 0);
ck_assert(size_and_free(hy_goal_list_installs(goal, NULL)) == 0);
hy_goal_free(goal);
}
END_TEST
Expand Down
2 changes: 1 addition & 1 deletion tests/hawkey/test_iutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ START_TEST(test_dnf_solvfile_userdata)
repowriter_free(writer);
fclose(fp);

fp = fopen(new_file, "r");
fail_if((fp = fopen(new_file, "r")) == NULL);
std::unique_ptr<SolvUserdata, decltype(solv_free)*> dnf_solvfile = solv_userdata_read(fp);
fail_unless(dnf_solvfile);
fail_unless(solv_userdata_verify(dnf_solvfile.get(), cs_computed));
Expand Down
Loading