4
4
#include <fluent-bit/flb_mem.h>
5
5
#include <fluent-bit/flb_utils.h>
6
6
#include <fluent-bit/flb_gzip.h>
7
+ #include <fluent-bit/flb_zstd.h>
7
8
8
9
#include <fluent-bit/aws/flb_aws_compress.h>
9
10
#include "flb_tests_internal.h"
@@ -53,6 +54,22 @@ void test_compression_gzip()
53
54
flb_aws_compress_test_cases (cases );
54
55
}
55
56
57
+ void test_compression_zstd ()
58
+ {
59
+ struct flb_aws_test_case cases [] =
60
+ {
61
+ {
62
+ "zstd" ,
63
+ "hello hello hello hello hello hello" ,
64
+ "KLUv/SAjZQAAMGhlbGxvIAEAuUsR" ,
65
+ 0
66
+ },
67
+ { 0 }
68
+ };
69
+
70
+ flb_aws_compress_test_cases (cases );
71
+ }
72
+
56
73
void test_b64_truncated_gzip ()
57
74
{
58
75
struct flb_aws_test_case cases [] =
@@ -70,6 +87,22 @@ struct flb_aws_test_case cases[] =
70
87
41 );
71
88
}
72
89
90
+ void test_b64_truncated_zstd ()
91
+ {
92
+ struct flb_aws_test_case cases [] =
93
+ {
94
+ {
95
+ "zstd" ,
96
+ "hello hello hello hello hello hello" ,
97
+ "hello hello hello hello hello hello" ,
98
+ 0 /* Expected ret */
99
+ },
100
+ { 0 }
101
+ };
102
+
103
+ flb_aws_compress_truncate_b64_test_cases__zstd_decode (cases ,41 );
104
+ }
105
+
73
106
void test_b64_truncated_gzip_truncation ()
74
107
{
75
108
struct flb_aws_test_case cases [] =
@@ -202,7 +235,9 @@ struct flb_aws_test_case cases[] =
202
235
203
236
TEST_LIST = {
204
237
{ "test_compression_gzip" , test_compression_gzip },
238
+ { "test_compression_zstd" , test_compression_zstd },
205
239
{ "test_b64_truncated_gzip" , test_b64_truncated_gzip },
240
+ { "test_b64_truncated_zstd" , test_b64_truncated_zstd },
206
241
{ "test_b64_truncated_gzip_truncation" , test_b64_truncated_gzip_truncation },
207
242
{ "test_b64_truncated_gzip_truncation_buffer_too_small" ,
208
243
test_b64_truncated_gzip_truncation_buffer_too_small },
@@ -231,6 +266,14 @@ static void flb_aws_compress_truncate_b64_test_cases__gzip_decode(
231
266
cases , max_out_len , & flb_gzip_uncompress );
232
267
}
233
268
269
+ static void flb_aws_compress_truncate_b64_test_cases__zstd_decode (
270
+ struct flb_aws_test_case * cases ,
271
+ size_t max_out_len )
272
+ {
273
+ flb_aws_compress_general_test_cases (FLB_AWS_COMPRESS_TEST_TYPE_B64_TRUNCATE ,
274
+ cases , max_out_len , & flb_zstd_uncompress );
275
+ }
276
+
234
277
/* General test case loop flb_aws_compress */
235
278
static void flb_aws_compress_general_test_cases (int test_type ,
236
279
struct flb_aws_test_case * cases ,
0 commit comments