MeterLogger
|
#include <ctype.h>
#include <assert.h>
#include "heatshrink_encoder.h"
#include "heatshrink_decoder.h"
#include "greatest.h"
Go to the source code of this file.
Data Structures | |
struct | cfg_info |
|
static |
Definition at line 638 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, cfg_info::decoder_input_buffer_size, dump_buf(), FAILm, free, heatshrink_decoder_alloc(), heatshrink_decoder_finish(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_free(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), hsd, HSDR_FINISH_DONE, HSDR_FINISH_MORE, HSDR_POLL_EMPTY, HSDR_POLL_MORE, hse, HSER_FINISH_DONE, HSER_FINISH_MORE, HSER_POLL_EMPTY, HSER_POLL_MORE, isprint, cfg_info::log_lvl, cfg_info::lookahead_sz2, malloc, memset, NULL, PASS, printf, and cfg_info::window_sz2.
Referenced by data_with_simple_repetition_should_compress_and_decompress_properly(), data_without_duplication_should_match(), pseudorandom_data_should_match(), regression_backreference_counters_should_not_roll_over(), regression_index_fail(), sixty_four_k(), and small_input_buffer_should_not_impact_decoder_correctness().
TEST data_with_simple_repetition_should_compress_and_decompress_properly | ( | void | ) |
Definition at line 758 of file test_heatshrink_dynamic.c.
References compress_and_expand_and_check(), cfg_info::decoder_input_buffer_size, cfg_info::log_lvl, cfg_info::lookahead_sz2, and cfg_info::window_sz2.
Referenced by SUITE().
TEST data_with_simple_repetition_should_match_with_absurdly_tiny_buffers | ( | void | ) |
Definition at line 812 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, dump_buf(), heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_free(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), hsd, hse, HSER_FINISH_MORE, and PASS.
Referenced by SUITE().
TEST data_without_duplication_should_match | ( | void | ) |
Definition at line 746 of file test_heatshrink_dynamic.c.
References compress_and_expand_and_check(), cfg_info::decoder_input_buffer_size, cfg_info::log_lvl, cfg_info::lookahead_sz2, and cfg_info::window_sz2.
Referenced by SUITE().
TEST data_without_duplication_should_match_with_absurdly_tiny_buffers | ( | void | ) |
Definition at line 771 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, dump_buf(), heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_free(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), hsd, hse, HSER_FINISH_MORE, and PASS.
Referenced by SUITE().
TEST decoder_alloc_should_reject_excessively_small_window | ( | void | ) |
Definition at line 251 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), HEATSHRINK_MIN_WINDOW_BITS, NULL, and PASS.
Referenced by SUITE().
TEST decoder_alloc_should_reject_zero_byte_input_buffer | ( | void | ) |
Definition at line 257 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), HEATSHRINK_MIN_WINDOW_BITS, NULL, and PASS.
Referenced by SUITE().
TEST decoder_finish_should_note_when_done | ( | void | ) |
Definition at line 508 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_finish(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), hsd, HSDR_FINISH_DONE, HSDR_POLL_EMPTY, HSDR_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST decoder_finish_should_reject_null_input | ( | void | ) |
Definition at line 498 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_finish(), heatshrink_decoder_free(), hsd, HSDR_FINISH_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_expand_short_literal | ( | void | ) |
Definition at line 358 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), hsd, HSDR_POLL_EMPTY, HSDR_SINK_OK, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_expand_short_literal_and_backref | ( | void | ) |
Definition at line 379 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, dump_buf(), heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), hsd, HSDR_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_expand_short_literal_and_backref_when_fed_input_byte_by_byte | ( | void | ) |
Definition at line 469 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_finish(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), hsd, HSDR_POLL_EMPTY, HSDR_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_expand_short_self_overlapping_backref | ( | void | ) |
Definition at line 405 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, dump_buf(), heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), hsd, HSDR_SINK_OK, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_reject_null_hsd | ( | void | ) |
Definition at line 330 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_poll(), HSDR_POLL_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_reject_null_output_buffer | ( | void | ) |
Definition at line 338 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), HEATSHRINK_MIN_WINDOW_BITS, hsd, HSDR_POLL_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_reject_null_output_size_pointer | ( | void | ) |
Definition at line 348 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), HEATSHRINK_MIN_WINDOW_BITS, hsd, HSDR_POLL_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_return_empty_if_empty | ( | void | ) |
Definition at line 319 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), HEATSHRINK_MIN_WINDOW_BITS, hsd, HSDR_POLL_EMPTY, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_suspend_if_out_of_space_in_output_buffer_during_backref_expansion | ( | void | ) |
Definition at line 446 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), hsd, HSDR_POLL_MORE, HSDR_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST decoder_poll_should_suspend_if_out_of_space_in_output_buffer_during_literal_expansion | ( | void | ) |
Definition at line 427 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_sink(), hsd, HSDR_POLL_MORE, HSDR_SINK_OK, and PASS.
Referenced by SUITE().
TEST decoder_should_not_get_stuck_with_finish_yielding_MORE_but_0_bytes_output_from_poll | ( | void | ) |
Definition at line 563 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_finish(), heatshrink_decoder_free(), heatshrink_decoder_poll(), heatshrink_decoder_reset(), heatshrink_decoder_sink(), hsd, HSDR_FINISH_DONE, HSDR_POLL_EMPTY, HSDR_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST decoder_sink_should_reject_excessively_large_input | ( | void | ) |
Definition at line 288 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_sink(), HEATSHRINK_MIN_WINDOW_BITS, hsd, HSDR_SINK_FULL, HSDR_SINK_OK, and PASS.
Referenced by SUITE().
TEST decoder_sink_should_reject_null_count_pointer | ( | void | ) |
Definition at line 279 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_sink(), HEATSHRINK_MIN_WINDOW_BITS, hsd, HSDR_SINK_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST decoder_sink_should_reject_null_hsd_pointer | ( | void | ) |
Definition at line 263 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_sink(), HSDR_SINK_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST decoder_sink_should_reject_null_input_pointer | ( | void | ) |
Definition at line 270 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_sink(), HEATSHRINK_MIN_WINDOW_BITS, hsd, HSDR_SINK_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST decoder_sink_should_sink_data_when_preconditions_hold | ( | void | ) |
Definition at line 306 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_decoder_alloc(), heatshrink_decoder_free(), heatshrink_decoder_sink(), HEATSHRINK_MIN_WINDOW_BITS, hsd, HSDR_SINK_OK, heatshrink_decoder::input_index, heatshrink_decoder::input_size, and PASS.
Referenced by SUITE().
|
static |
Definition at line 20 of file test_heatshrink_dynamic.c.
References isprint, and printf.
Referenced by compress_and_expand_and_check(), data_with_simple_repetition_should_match_with_absurdly_tiny_buffers(), data_without_duplication_should_match_with_absurdly_tiny_buffers(), decoder_poll_should_expand_short_literal_and_backref(), decoder_poll_should_expand_short_self_overlapping_backref(), encoder_poll_should_detect_repeated_substring(), encoder_poll_should_detect_repeated_substring_and_preserve_trailing_literal(), and encoder_should_emit_series_of_same_byte_as_literal_then_backref().
TEST encoder_alloc_should_reject_invalid_arguments | ( | void | ) |
Definition at line 27 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_encoder_alloc(), HEATSHRINK_MAX_WINDOW_BITS, HEATSHRINK_MIN_LOOKAHEAD_BITS, HEATSHRINK_MIN_WINDOW_BITS, NULL, and PASS.
Referenced by SUITE().
TEST encoder_finish_should_reject_nulls | ( | void | ) |
Definition at line 64 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_encoder_finish(), HSER_FINISH_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST encoder_poll_should_detect_repeated_substring | ( | void | ) |
Definition at line 180 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, dump_buf(), heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_free(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), hse, HSER_FINISH_DONE, HSER_FINISH_MORE, HSER_POLL_EMPTY, HSER_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST encoder_poll_should_detect_repeated_substring_and_preserve_trailing_literal | ( | void | ) |
Definition at line 207 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, dump_buf(), heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_free(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), hse, HSER_FINISH_DONE, HSER_FINISH_MORE, HSER_POLL_EMPTY, HSER_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST encoder_poll_should_indicate_when_no_input_is_provided | ( | void | ) |
Definition at line 97 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_encoder_alloc(), heatshrink_encoder_free(), heatshrink_encoder_poll(), hse, HSER_POLL_EMPTY, and PASS.
Referenced by SUITE().
TEST encoder_poll_should_reject_nulls | ( | void | ) |
Definition at line 49 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_encoder_alloc(), heatshrink_encoder_free(), heatshrink_encoder_poll(), hse, HSER_POLL_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
TEST encoder_should_emit_data_without_repetitions_as_literal_sequence | ( | void | ) |
Definition at line 109 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_free(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), hse, HSER_FINISH_DONE, HSER_FINISH_MORE, HSER_POLL_EMPTY, HSER_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST encoder_should_emit_series_of_same_byte_as_literal_then_backref | ( | void | ) |
Definition at line 145 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, dump_buf(), heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_free(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), hse, HSER_FINISH_DONE, HSER_FINISH_MORE, HSER_POLL_EMPTY, HSER_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST encoder_sink_should_accept_input_when_it_will_fit | ( | void | ) |
Definition at line 69 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, heatshrink_encoder_alloc(), heatshrink_encoder_free(), heatshrink_encoder_sink(), hse, HSER_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST encoder_sink_should_accept_partial_input_when_some_will_fit | ( | void | ) |
Definition at line 83 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, heatshrink_encoder_alloc(), heatshrink_encoder_free(), heatshrink_encoder_sink(), hse, HSER_SINK_OK, memset, and PASS.
Referenced by SUITE().
TEST encoder_sink_should_reject_nulls | ( | void | ) |
Definition at line 37 of file test_heatshrink_dynamic.c.
References ASSERT, ASSERT_EQ, heatshrink_encoder_alloc(), heatshrink_encoder_free(), heatshrink_encoder_sink(), hse, HSER_SINK_ERROR_NULL, NULL, and PASS.
Referenced by SUITE().
|
static |
Definition at line 854 of file test_heatshrink_dynamic.c.
References hs_index::size.
Referenced by pseudorandom_data_should_match(), regression_backreference_counters_should_not_roll_over(), regression_index_fail(), and sixty_four_k().
TEST gen | ( | void | ) |
Definition at line 537 of file test_heatshrink_dynamic.c.
References ASSERT_EQ, heatshrink_encoder_alloc(), heatshrink_encoder_finish(), heatshrink_encoder_free(), heatshrink_encoder_poll(), heatshrink_encoder_sink(), hse, HSER_FINISH_DONE, HSER_FINISH_MORE, HSER_POLL_EMPTY, HSER_SINK_OK, memset, PASS, and printf.
Referenced by SUITE().
GREATEST_MAIN_DEFS | ( | ) |
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 989 of file test_heatshrink_dynamic.c.
References GREATEST_MAIN_BEGIN, GREATEST_MAIN_END, and RUN_SUITE.
Definition at line 862 of file test_heatshrink_dynamic.c.
References compress_and_expand_and_check(), cfg_info::decoder_input_buffer_size, fill_with_pseudorandom_letters(), cfg_info::log_lvl, printf, and hs_index::size.
Referenced by SUITE().
TEST regression_backreference_counters_should_not_roll_over | ( | void | ) |
Definition at line 885 of file test_heatshrink_dynamic.c.
References compress_and_expand_and_check(), cfg_info::decoder_input_buffer_size, fill_with_pseudorandom_letters(), cfg_info::log_lvl, cfg_info::lookahead_sz2, hs_index::size, and cfg_info::window_sz2.
Referenced by SUITE().
TEST regression_index_fail | ( | void | ) |
Definition at line 900 of file test_heatshrink_dynamic.c.
References compress_and_expand_and_check(), cfg_info::decoder_input_buffer_size, fill_with_pseudorandom_letters(), cfg_info::log_lvl, cfg_info::lookahead_sz2, hs_index::size, and cfg_info::window_sz2.
Referenced by SUITE().
TEST sixty_four_k | ( | void | ) |
Definition at line 917 of file test_heatshrink_dynamic.c.
References compress_and_expand_and_check(), cfg_info::decoder_input_buffer_size, fill_with_pseudorandom_letters(), cfg_info::log_lvl, cfg_info::lookahead_sz2, hs_index::size, and cfg_info::window_sz2.
Referenced by SUITE().
TEST small_input_buffer_should_not_impact_decoder_correctness | ( | void | ) |
Definition at line 872 of file test_heatshrink_dynamic.c.
References compress_and_expand_and_check(), cfg_info::decoder_input_buffer_size, cfg_info::log_lvl, cfg_info::lookahead_sz2, PASS, hs_index::size, and cfg_info::window_sz2.
Referenced by SUITE().
SUITE | ( | encoding | ) |
Definition at line 233 of file test_heatshrink_dynamic.c.
References encoder_alloc_should_reject_invalid_arguments(), encoder_finish_should_reject_nulls(), encoder_poll_should_detect_repeated_substring(), encoder_poll_should_detect_repeated_substring_and_preserve_trailing_literal(), encoder_poll_should_indicate_when_no_input_is_provided(), encoder_poll_should_reject_nulls(), encoder_should_emit_data_without_repetitions_as_literal_sequence(), encoder_should_emit_series_of_same_byte_as_literal_then_backref(), encoder_sink_should_accept_input_when_it_will_fit(), encoder_sink_should_accept_partial_input_when_some_will_fit(), encoder_sink_should_reject_nulls(), and RUN_TEST.
SUITE | ( | decoding | ) |
Definition at line 601 of file test_heatshrink_dynamic.c.
References decoder_alloc_should_reject_excessively_small_window(), decoder_alloc_should_reject_zero_byte_input_buffer(), decoder_finish_should_note_when_done(), decoder_finish_should_reject_null_input(), decoder_poll_should_expand_short_literal(), decoder_poll_should_expand_short_literal_and_backref(), decoder_poll_should_expand_short_literal_and_backref_when_fed_input_byte_by_byte(), decoder_poll_should_expand_short_self_overlapping_backref(), decoder_poll_should_reject_null_hsd(), decoder_poll_should_reject_null_output_buffer(), decoder_poll_should_reject_null_output_size_pointer(), decoder_poll_should_return_empty_if_empty(), decoder_poll_should_suspend_if_out_of_space_in_output_buffer_during_backref_expansion(), decoder_poll_should_suspend_if_out_of_space_in_output_buffer_during_literal_expansion(), decoder_should_not_get_stuck_with_finish_yielding_MORE_but_0_bytes_output_from_poll(), decoder_sink_should_reject_excessively_large_input(), decoder_sink_should_reject_null_count_pointer(), decoder_sink_should_reject_null_hsd_pointer(), decoder_sink_should_reject_null_input_pointer(), decoder_sink_should_sink_data_when_preconditions_hold(), gen(), and RUN_TEST.
SUITE | ( | integration | ) |
Definition at line 932 of file test_heatshrink_dynamic.c.
References data_with_simple_repetition_should_compress_and_decompress_properly(), data_with_simple_repetition_should_match_with_absurdly_tiny_buffers(), data_without_duplication_should_match(), data_without_duplication_should_match_with_absurdly_tiny_buffers(), cfg_info::decoder_input_buffer_size, GREATEST_IS_VERBOSE, GREATEST_MAIN_DEFS(), cfg_info::log_lvl, cfg_info::lookahead_sz2, printf, pseudorandom_data_should_match(), regression_backreference_counters_should_not_roll_over(), regression_index_fail(), RUN_TEST, RUN_TESTp, sixty_four_k(), hs_index::size, small_input_buffer_should_not_impact_decoder_correctness(), and cfg_info::window_sz2.