Files
revng-revng/tests/unit/DiffInvalidationEvent.cpp
T
Ivan Krysak 7d235f4fd0 Enforce licence header consistency
Also do some basic cleanup: capitalize first letters, add `.`
at the end of the sentences, and so on.
2023-07-03 15:23:10 +00:00

39 lines
970 B
C++

/// \file DiffInvalidationEvent.cpp
/// 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/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::kinds;
using namespace pipeline;
BOOST_AUTO_TEST_SUITE(ModelInvalidationDiffSuite)
BOOST_AUTO_TEST_CASE(RootInvalidationTest) {
model::Binary Empty;
model::Binary New;
Context Ctx;
MetaAddress Address(0x1000, MetaAddressType::Code_aarch64);
New.ExtraCodeAddresses().insert(Address);
TargetsList ToRemove;
GlobalTupleTreeDiff Event(diff(Empty, New));
Root.getInvalidations(Ctx, ToRemove, Event);
BOOST_TEST(ToRemove.size() == 1);
BOOST_TEST(&ToRemove.front().getKind() == &Root);
}
BOOST_AUTO_TEST_SUITE_END()