Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jranieri-grammatech committed Mar 20, 2024
1 parent aa2bdb4 commit e32dab4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/gtirb/ByteInterval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class GTIRB_EXPORT_API ByteInterval : public Node {
///
/// \brief A comparison object that allows searching in the block set by
/// offset.
struct OffsetCmp {
struct GTIRB_EXPORT_API OffsetCmp {
bool operator()(uint64_t Offset, const Block& B) const {
return Offset < B.Offset;
}
Expand Down
4 changes: 1 addition & 3 deletions src/ByteInterval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ ChangeStatus ByteInterval::removeBlock(BlockType* B) {
"recovering from rejected removal is not implemented yet");
}

[[maybe_unused]] ChangeStatus Status = sizeChange(B, B->getSize(), 0);
assert(Status != ChangeStatus::Rejected &&
"recovering from rejected removal is not implemented yet");
updateIntervalMap(B, B->getSize(), std::nullopt);
Index.erase(Iter);
B->setParent(nullptr, nullptr);
return ChangeStatus::Accepted;
Expand Down
1 change: 0 additions & 1 deletion src/test/ByteInterval.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <gtirb/Symbol.hpp>
#include <gtirb/proto/ByteInterval.pb.h>
#include <gtest/gtest.h>
#include <iostream>
#include <sstream>

using namespace gtirb;
Expand Down
10 changes: 5 additions & 5 deletions src/test/Section.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,14 +747,14 @@ TEST(Unit_Section, testIterationOrder) {
auto* CB11 = BI1->addBlock<CodeBlock>(Ctx, 0, 0);
auto* CB12 = BI1->addBlock<CodeBlock>(Ctx, 0, 1);
auto* BI2 = S->addByteInterval(Ctx, Addr(0));
auto* CB21 = BI2->addBlock<DataBlock>(Ctx, 0, 0);
auto* CB22 = BI2->addBlock<DataBlock>(Ctx, 0, 1);
auto* DB21 = BI2->addBlock<DataBlock>(Ctx, 0, 0);
auto* DB22 = BI2->addBlock<DataBlock>(Ctx, 0, 1);
auto* BI3 = S->addByteInterval(Ctx, Addr(1));
auto* CB31 = BI3->addBlock<DataBlock>(Ctx, 0, 0);
auto* CB32 = BI3->addBlock<DataBlock>(Ctx, 0, 1);
auto* DB31 = BI3->addBlock<DataBlock>(Ctx, 0, 0);
auto* DB32 = BI3->addBlock<DataBlock>(Ctx, 0, 1);

{
std::vector<Node*> ExpectedOrder = {CB11, CB21, CB12, CB22, CB31, CB32};
std::vector<Node*> ExpectedOrder = {CB11, DB21, CB12, DB22, DB31, DB32};
EXPECT_EQ(pointers(S->blocks()), ExpectedOrder);
}
}

0 comments on commit e32dab4

Please sign in to comment.