tools/tests/functional/algorithmic_tests/low_level_api/inflate_stop_conditions.cpp
// 1.a Identical test to 1, except for the fact, that there's only one bfinal eob symbol
1.a Identical test to 1, except for the fact, that there's only one bfinal eob symbol
1 . a Identical test to 1 except for the fact that there ' s only one bfinal eob symbol
QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_F(inflate_stop_conditions, dont_stop_on_eob, inflate_stop_condtition_test) {
        auto dataset = util::TestEnvironment::GetInstance().GetCompleteDataset();
        source = dataset["file1"];
        std::vector<uint8_t> compressed_source(source.size() * 2);
        destination.resize(compressed_source.size() * 2);
        auto source_size = static_cast<uint32_t>(source.size());
        qpl::test::random random(0u, 0u, GetSeed());
        random.set_range(1u, 5000u);
        auto block_size = static_cast<uint32_t>(random);
        uint32_t expected_block_count = source_size / block_size;
        expected_block_count += (0u == source_size % block_size) ? 0 : 1;
        deflate_stream_by_blocks(source,
                                 compressed_source,
                                 block_size);
        job_ptr->next_in_ptr = compressed_source.data();
        job_ptr->available_in = static_cast<uint32_t>(compressed_source.size());
        job_ptr->next_out_ptr = destination.data();
        job_ptr->available_out = static_cast<uint32_t>(destination.size());
        job_ptr->flags = QPL_FLAG_FIRST | QPL_FLAG_DECOMP_FLUSH_ALWAYS;
        job_ptr->decomp_end_processing = qpl_dont_stop_or_check;
        auto status = run_job_api(job_ptr);
        ASSERT_EQ(QPL_STS_OK, status);
        ASSERT_EQ(job_ptr->total_out, source_size);
        ASSERT_TRUE(CompareVectors(source, destination, source_size));
    }
QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_F ( inflate_stop_conditions , dont_stop_on_eob , inflate_stop_condtition_test ) { auto dataset = util :: TestEnvironment :: GetInstance ( ) . GetCompleteDataset ( ) ; source = dataset [ " " ] ; std :: vector < uint8_t > compressed_source ( source . size ( ) * 2 ) ; destination . resize ( compressed_source . size ( ) * 2 ) ; auto source_size = static_cast < uint32_t > ( source . size ( ) ) ; qpl :: test :: random random ( 0u , 0u , GetSeed ( ) ) ; random . set_range ( 1u , 5000u ) ; auto block_size = static_cast < uint32_t > ( random ) ; uint32_t expected_block_count = source_size / block_size ; expected_block_count += ( 0u == source_size % block_size ) ? 0 : 1 ; deflate_stream_by_blocks ( source , compressed_source , block_size ) ; job_ptr -> next_in_ptr = compressed_source . data ( ) ; job_ptr -> available_in = static_cast < uint32_t > ( compressed_source . size ( ) ) ; job_ptr -> next_out_ptr = destination . data ( ) ; job_ptr -> available_out = static_cast < uint32_t > ( destination . size ( ) ) ; job_ptr -> flags = QPL_FLAG_FIRST | QPL_FLAG_DECOMP_FLUSH_ALWAYS ; job_ptr -> decomp_end_processing = qpl_dont_stop_or_check ; auto status = run_job_api ( job_ptr ) ; ASSERT_EQ ( QPL_STS_OK , status ) ; ASSERT_EQ ( job_ptr -> total_out , source_size ) ; ASSERT_TRUE ( CompareVectors ( source , destination , source_size ) ) ; }
1.a Identical test to 1, except for the fact, that there's only one bfinal eob symbol
1 . a Identical test to 1 except for the fact that there ' s only one bfinal eob symbol
// Get stream compressed with severals deflate blocks // Which means we have multiple eob symbols here // Set up job, set dont_stop_or_check condition // Expect the whole compressed stream to be decompressed