On 2/4/26 1:42 AM, Simon Glass wrote:
Hello Simon,
+ /* Test various sizes of decompression chunk sizes */
+ for (j = 0; j < ARRAY_SIZE(sizes); j++) {
+ env_set_ulong("gzwrite_chunk", sizes[j]);
+ for (i = 0; i < ARRAY_SIZE(sizes); i++) {
+ ret = do_test_cmd_zip_unzip(uts, sizes[i], true);
+ if (ret)
+ return ret;
+ }
+ }
+
return 0;
}
DM_TEST(dm_test_cmd_zip_gzwrite, UTF_CONSOLE);
--
2.51.0
Rather than an environment variable, you could create a variant of
gzwrite() which allows it to be passed.
This test is invoking the command line 'gzwrite' command, it is not
calling the gzwrite() function . And I don't think the chunk size should
be configurable on command line by users ?
Agreed.
But the command test could just use the default, then add a C test to
call the unzip function directly with a series of sizes. Going through
the command is a bit of a pain. We have quite a few examples where the
command tests are more basic than the 'lower-level' tests.
Isn't that what test/lib/compression.c test does already ?