mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
build: Only copy yara crypto wrapper if it changed
This commit is contained in:
0
tests/CMakeLists.txt
Normal file
0
tests/CMakeLists.txt
Normal file
8
tests/include/test_patterns/test_pattern.hpp
Normal file
8
tests/include/test_patterns/test_pattern.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by werwo on 11/09/2021.
|
||||
//
|
||||
|
||||
#ifndef IMHEX_TEST_PATTERN_HPP
|
||||
#define IMHEX_TEST_PATTERN_HPP
|
||||
|
||||
#endif //IMHEX_TEST_PATTERN_HPP
|
||||
30
tests/include/test_patterns/test_pattern_example.hpp
Normal file
30
tests/include/test_patterns/test_pattern_example.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <hex/pattern_language/pattern_data.hpp>
|
||||
|
||||
namespace hex::test {
|
||||
|
||||
class TestPattern {
|
||||
public:
|
||||
TestPattern() = default;
|
||||
virtual TestPattern() {
|
||||
for (auto &pattern : this->m_patterns)
|
||||
delete pattern;
|
||||
}
|
||||
|
||||
virtual std::string getSourceCode() = 0;
|
||||
|
||||
[[nodiscard]]
|
||||
virtual const std::vector<pl::PatternData*>& getPatterns() const final { return this->m_patterns; }
|
||||
virtual void addPattern(pl::PatternData *pattern) final {
|
||||
this->m_patterns.push_back(pattern);
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<pl::PatternData*> m_patterns;
|
||||
};
|
||||
|
||||
}
|
||||
26
tests/include/test_patterns/test_pattern_placement.hpp
Normal file
26
tests/include/test_patterns/test_pattern_placement.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "test_pattern.hpp"
|
||||
|
||||
namespace hex::test {
|
||||
|
||||
class TestPatternExample : public TestPattern {
|
||||
public:
|
||||
TestPatternExample() {
|
||||
auto placementTest = new pl::PatternDataSigned(0x00, sizeof(u32));
|
||||
placementTest->setTypeName("u32");
|
||||
placementTest->setVariableName("placementTest");
|
||||
addPattern(placementTest);
|
||||
}
|
||||
~TestPatternExample() override = default;
|
||||
|
||||
[[nodiscard]]
|
||||
std::string getSourceCode() const override {
|
||||
return R"(
|
||||
u32 placementTest @ 0x00;
|
||||
)";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
8
tests/include/test_provider.hpp
Normal file
8
tests/include/test_provider.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by werwo on 11/09/2021.
|
||||
//
|
||||
|
||||
#ifndef IMHEX_TEST_PROVIDER_HPP
|
||||
#define IMHEX_TEST_PROVIDER_HPP
|
||||
|
||||
#endif //IMHEX_TEST_PROVIDER_HPP
|
||||
1
tests/source/main.cpp
Normal file
1
tests/source/main.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <catch.hpp>
|
||||
Reference in New Issue
Block a user