You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/06/05 08:04:35 UTC
[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #788: MINIFICPP-1229 - Fix and enable CompressContentTests
hunyadi-dev commented on a change in pull request #788:
URL: https://github.com/apache/nifi-minifi-cpp/pull/788#discussion_r435756163
##########
File path: libminifi/test/archive-tests/CompressContentTests.cpp
##########
@@ -91,851 +91,826 @@ class ReadCallback: public org::apache::nifi::minifi::InputStreamCallback {
int archive_buffer_size_;
};
-TEST_CASE("CompressFileGZip", "[compressfiletest1]") {
- try {
- std::ofstream expectfile;
- expectfile.open(EXPECT_COMPRESS_CONTENT);
+class CompressDecompressionTestController : public TestController{
+protected:
+ static std::string tempDir;
+ static std::string raw_content_path;
+ static std::string compressed_content_path;
+ static TestController global_controller;
+public:
+ class RawContent{
+ std::string content_;
+ RawContent(std::string&& content_): content_(std::move(content_)) {}
+ friend class CompressDecompressionTestController;
+ public:
+ bool operator==(const std::string& actual) const noexcept {
+ return content_ == actual;
+ }
+ bool operator!=(const std::string& actual) const noexcept {
+ return content_ != actual;
+ }
+ };
- std::mt19937 gen(std::random_device { }());
+ std::string rawContentPath() const {
+ return raw_content_path;
+ }
+
+ std::string compressedPath() const {
+ return compressed_content_path;
+ }
+
+ RawContent getRawContent() const {;
+ std::ifstream file;
+ file.open(raw_content_path, std::ios::binary);
+ std::string contents((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
+ file.close();
+ return {std::move(contents)};
+ }
+
+ virtual ~CompressDecompressionTestController() = 0;
+};
+
+CompressDecompressionTestController::~CompressDecompressionTestController() {}
Review comment:
This seems fancy and all, but what is the advantage of having an implementation **if** the implementation is `{}` anyways?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org