tests: Fixed compile errors

This commit is contained in:
WerWolv
2021-10-03 12:32:58 +02:00
parent 12a8cadcfe
commit 51a98736e8
10 changed files with 34 additions and 25 deletions

View File

@@ -1425,7 +1425,7 @@ namespace hex::pl {
literal = pattern->clone();
}
if (auto transformFunc = pattern->getTransformFunction(); transformFunc.has_value()) {
if (auto transformFunc = pattern->getTransformFunction(); transformFunc.has_value() && pattern->getEvaluator() != nullptr) {
auto result = transformFunc->func(evaluator, { literal });
if (!result.has_value())

View File

@@ -56,15 +56,21 @@ namespace hex::pl {
class PatternCreationLimiter {
public:
explicit PatternCreationLimiter(Evaluator *evaluator) : m_evaluator(evaluator) {
if (this->m_evaluator == nullptr) return;
this->m_evaluator->patternCreated();
}
PatternCreationLimiter(const PatternCreationLimiter &other) {
if (this->m_evaluator == nullptr) return;
this->m_evaluator = other.m_evaluator;
this->m_evaluator->patternCreated();
}
~PatternCreationLimiter() {
if (this->m_evaluator == nullptr) return;
this->m_evaluator->patternDestroyed();
}

View File

@@ -32,6 +32,7 @@ namespace hex {
if (ImGui::Button("hex.common.okay"_lang) || ImGui::IsKeyDown(ImGuiKey_Escape))
ImGui::CloseCurrentPopup();
ImGui::SetWindowPos((SharedData::windowSize - ImGui::GetWindowSize()) / 2, ImGuiCond_Appearing);
ImGui::EndPopup();
}
@@ -43,6 +44,7 @@ namespace hex {
if (ImGui::Button("hex.common.okay"_lang) || ImGui::IsKeyDown(ImGuiKey_Escape))
ImGui::CloseCurrentPopup();
ImGui::SetWindowPos((SharedData::windowSize - ImGui::GetWindowSize()) / 2, ImGuiCond_Appearing);
ImGui::EndPopup();
}
@@ -56,6 +58,7 @@ namespace hex {
ImGui::CloseCurrentPopup();
}
ImGui::SetWindowPos((SharedData::windowSize - ImGui::GetWindowSize()) / 2, ImGuiCond_Appearing);
ImGui::EndPopup();
}
}