mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
39 lines
1005 B
C++
39 lines
1005 B
C++
/// \file DiffInvalidationEvent.cpp
|
|
/// \brief Tests for C API of revng-pipeline
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "revng/Model/Binary.h"
|
|
#include "revng/Pipes/Kinds.h"
|
|
#include "revng/Pipes/ModelInvalidationEvent.h"
|
|
#include "revng/Support/MetaAddress.h"
|
|
|
|
#define BOOST_TEST_MODULE PipelineC
|
|
bool init_unit_test();
|
|
#include "boost/test/unit_test.hpp"
|
|
|
|
#include "revng/UnitTestHelpers/UnitTestHelpers.h"
|
|
|
|
using namespace revng::pipes;
|
|
using namespace pipeline;
|
|
|
|
BOOST_AUTO_TEST_SUITE(ModelInvalidationDiffSuite)
|
|
|
|
BOOST_AUTO_TEST_CASE(RootInvalidationTest) {
|
|
model::Binary Empty;
|
|
model::Binary New;
|
|
|
|
MetaAddress Address(0x1000, MetaAddressType::Code_aarch64);
|
|
New.ExtraCodeAddresses.insert(Address);
|
|
|
|
TargetsList ToRemove;
|
|
ModelInvalidationEvent Event(diff(Empty, New));
|
|
Root.getInvalidations(ToRemove, Event);
|
|
BOOST_TEST(ToRemove.size() == 1);
|
|
BOOST_TEST(&ToRemove.front().getKind() == &Root);
|
|
}
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|