mirror of
https://github.com/QuasarApp/pe-parse.git
synced 2025-04-26 12:24:32 +00:00
* tests: add a testcase for #153 * tests: rename testcase, hook up * tests: fix REQUIRE check
18 lines
516 B
C++
18 lines
516 B
C++
#include <pe-parse/parse.h>
|
|
|
|
#include <catch2/catch.hpp>
|
|
|
|
#include "filesystem_compat.h"
|
|
|
|
namespace peparse {
|
|
TEST_CASE("malformed PE (GH#153) does not parse", "[pr_153]") {
|
|
auto path = fs::path(ASSETS_DIR) / "pr_153.exe";
|
|
auto *p = ParsePEFromFile(path.string().c_str());
|
|
|
|
// pr_153.exe should not parse, and should return an error indicating
|
|
// that the magic was invalid (masking the underlying PEERR_ADDRESS error).
|
|
REQUIRE(p == nullptr);
|
|
REQUIRE(GetPEErr() == PEERR_MAGIC);
|
|
}
|
|
} // namespace peparse
|