diff options
Diffstat (limited to 'test/main.cpp')
-rw-r--r-- | test/main.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/test/main.cpp b/test/main.cpp deleted file mode 100644 index f18332c..0000000 --- a/test/main.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "resources.h" -#include "zstd_resources.h" -#include <cstdio> -#include <cstdlib> - -int main(int, char **) -{ - constexpr auto size = staticdata::entries.size(); - constexpr embed::Resources static_ctx(staticdata::entries, staticdata::values); - const embed::CompressedResources zstd_ctx(zstd_data::entries, zstd_data::values, zstd_data::compression, zstd_data::dictionary); - for(std::size_t i = 0; i < size; ++i) { - const auto s = static_ctx.value(i); - const auto v = zstd_ctx.decompress(i); - - if(s.size() != v.size()) { - printf(" raw data at path [%s] size=%li\n", staticdata::entries.at(i), s.size()); - printf(" zstd data at path [%s] size=%li\n", zstd_data::entries.at(i), v.size()); - return EXIT_FAILURE; - } - - if(!std::equal(s.begin(), s.end(), v.begin(), v.end())) { - printf("failed comparing values at path [%s]\n", staticdata::entries.at(i)); - for(const char &c : s) - printf("%c", c); - for(const char &c : v) - printf("%c", c); - return EXIT_FAILURE; - } - } - printf("Zstd compression test complete\n"); - - return EXIT_SUCCESS; -} |