From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] test-symtab: Update after support for empty symtabs
Date: Mon, 27 Mar 2023 11:19:47 +0200 [thread overview]
Message-ID: <87pm8umtzg.fsf@redhat.com> (raw)
Hello,
Now that we support empty symtabs test-symtab needs to be updated so
that it expects to have a corpus now, upon a binary with no exported
symbols, albeit an empty one.
* tests/test-symtab.cc (TEST_CASE("Symtab::Empty", "[symtab,
basic]")): Adjust.
(TEST_CASE("Symtab::NoDebugInfo", "[symtab, basic]")): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
tests/test-symtab.cc | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/tests/test-symtab.cc b/tests/test-symtab.cc
index dd3f3824..8a5860af 100644
--- a/tests/test-symtab.cc
+++ b/tests/test-symtab.cc
@@ -66,10 +66,9 @@ TEST_CASE("Symtab::Empty", "[symtab, basic]")
{
const std::string binary = "basic/empty.so";
corpus_sptr corpus_ptr;
- const fe_iface::status status = read_corpus(binary, corpus_ptr);
- REQUIRE(!corpus_ptr);
-
- REQUIRE((status & fe_iface::STATUS_NO_SYMBOLS_FOUND));
+ read_corpus(binary, corpus_ptr);
+ REQUIRE(corpus_ptr->get_fun_symbol_map().empty());
+ REQUIRE(corpus_ptr->get_var_symbol_map().empty());
}
TEST_CASE("Symtab::NoDebugInfo", "[symtab, basic]")
@@ -241,10 +240,9 @@ TEST_CASE("Symtab::SymtabWithWhitelist", "[symtab, whitelist]")
+ "basic/one_function_one_variable_irrelevant.whitelist");
corpus_sptr corpus_ptr;
- const fe_iface::status status =
- read_corpus(binary, corpus_ptr, whitelists);
- REQUIRE(!corpus_ptr);
- REQUIRE((status & fe_iface::STATUS_NO_SYMBOLS_FOUND));
+ read_corpus(binary, corpus_ptr, whitelists);
+ REQUIRE(corpus_ptr->get_fun_symbol_map().empty());
+ REQUIRE(corpus_ptr->get_var_symbol_map().empty());
}
GIVEN("we read the binary with only the function whitelisted")
--
2.39.2
--
Dodji
reply other threads:[~2023-03-27 9:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pm8umtzg.fsf@redhat.com \
--to=dodji@redhat.com \
--cc=libabigail@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).