tools/tests/functional/algorithmic_tests/low_level_api/inflate_stop_conditions.cpp
// 2. Stop on any EOB symbol
2. Stop on any EOB symbol
2 . Stop on any EOB symbol
QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_F(inflate_stop_conditions, 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_stop_on_any_eob;
        auto status = run_job_api(job_ptr);
        ASSERT_EQ(QPL_STS_OK, status);
        ASSERT_EQ(job_ptr->total_out, block_size);
        ASSERT_TRUE(CompareVectors(source, destination, block_size));
    }
QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_F ( inflate_stop_conditions , 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_stop_on_any_eob ; auto status = run_job_api ( job_ptr ) ; ASSERT_EQ ( QPL_STS_OK , status ) ; ASSERT_EQ ( job_ptr -> total_out , block_size ) ; ASSERT_TRUE ( CompareVectors ( source , destination , block_size ) ) ; }
2.
2 .
// Get stream compressed with severals deflate blocks // Which means we have multiple eob symbols here // Set up job, set stop_on_eob condition // Expect just the 1st deflate block to be decompressed