Blender V5.3
BLI_array_store_test.cc File Reference
#include "testing/testing.h"
#include "MEM_guardedalloc.h"
#include "BLI_array_store.hh"
#include "BLI_array_utils_c.hh"
#include "BLI_listbase.hh"
#include "BLI_rand_c.hh"
#include "BLI_resource_strings.h"
#include "BLI_string.hh"
#include "BLI_sys_types.hh"
#include "BLI_utildefines.hh"

Go to the source code of this file.

Classes

struct  blender::TestChunk
struct  blender::TestBuffer

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define testbuffer_list_state_from_string_array(lb, data_array)
#define TESTBUFFER_STRINGS_CREATE(lb, ...)
#define TESTBUFFER_STRINGS(stride, chunk_count, ...)
#define D   "#1#2#3#4"
#define WORDS   words10k, sizeof(words10k)

Functions

static TestChunk * blender::testchunk_list_add (ListBaseT< TestChunk > *lb, const void *data, size_t data_len)
static void blender::testchunk_list_free (ListBaseT< TestChunk > *lb)
static char * blender::testchunk_as_data_array (TestChunk **tc_array, int tc_array_len, size_t *r_data_len)
static TestBuffer * blender::testbuffer_list_add (ListBaseT< TestBuffer > *lb, const void *data, size_t data_len)
static TestBuffer * blender::testbuffer_list_add_copydata (ListBaseT< TestBuffer > *lb, const void *data, size_t data_len)
static void blender::testbuffer_list_state_from_data (ListBaseT< TestBuffer > *lb, const char *data, const size_t data_len)
static void blender::testbuffer_list_state_from_data__stride_expand (ListBaseT< TestBuffer > *lb, const char *data, const size_t data_len, const size_t stride)
static bool blender::testbuffer_item_validate (TestBuffer *tb)
static bool blender::testbuffer_list_validate (const ListBaseT< TestBuffer > *lb)
static void blender::testbuffer_list_data_randomize (ListBaseT< TestBuffer > *lb, uint random_seed)
static void blender::testbuffer_list_store_populate (BArrayStore *bs, ListBaseT< TestBuffer > *lb)
static void blender::testbuffer_list_store_clear (BArrayStore *bs, ListBaseT< TestBuffer > *lb)
static void blender::testbuffer_list_free (ListBaseT< TestBuffer > *lb)
static void blender::testbuffer_run_tests_single (BArrayStore *bs, ListBaseT< TestBuffer > *lb)
static void blender::testbuffer_run_tests (BArrayStore *bs, ListBaseT< TestBuffer > *lb)
static void blender::testbuffer_run_tests_simple (ListBaseT< TestBuffer > *lb, const int stride, const int chunk_count)
 blender::TEST (array_store, Nop)
 blender::TEST (array_store, NopState)
 blender::TEST (array_store, Single)
 blender::TEST (array_store, DoubleNop)
 blender::TEST (array_store, DoubleDiff)
 blender::TEST (array_store, TextMixed)
 blender::TEST (array_store, TextDupeIncreaseDecrease)
static void blender::plain_text_helper (const char *words, int words_len, const char word_delim, const int stride, const int chunk_count, const int random_seed)
 blender::TEST (array_store, TextSentences_Chunk1)
 blender::TEST (array_store, TextSentences_Chunk2)
 blender::TEST (array_store, TextSentences_Chunk8)
 blender::TEST (array_store, TextSentences_Chunk32)
 blender::TEST (array_store, TextSentences_Chunk128)
 blender::TEST (array_store, TextSentences_Chunk1024)
 blender::TEST (array_store, TextSentences_Chunk3)
 blender::TEST (array_store, TextSentences_Chunk13)
 blender::TEST (array_store, TextSentences_Chunk131)
 blender::TEST (array_store, TextWords_Chunk1)
 blender::TEST (array_store, TextWords_Chunk2)
 blender::TEST (array_store, TextWords_Chunk8)
 blender::TEST (array_store, TextWords_Chunk32)
 blender::TEST (array_store, TextWords_Chunk128)
 blender::TEST (array_store, TextWords_Chunk1024)
 blender::TEST (array_store, TextWords_Chunk3)
 blender::TEST (array_store, TextWords_Chunk13)
 blender::TEST (array_store, TextWords_Chunk131)
 blender::TEST (array_store, TextSentencesRandom_Stride3_Chunk3)
 blender::TEST (array_store, TextSentencesRandom_Stride8_Chunk8)
 blender::TEST (array_store, TextSentencesRandom_Stride32_Chunk1)
 blender::TEST (array_store, TextSentencesRandom_Stride12_Chunk512)
 blender::TEST (array_store, TextSentencesRandom_Stride128_Chunk6)
static uint blender::rand_range_i (RNG *rng, uint min_i, uint max_i, uint step)
static void blender::testbuffer_list_state_random_data (ListBaseT< TestBuffer > *lb, const size_t stride, const size_t data_min_len, const size_t data_max_len, const uint mutate, RNG *rng)
static void blender::random_data_mutate_helper (const int items_size_min, const int items_size_max, const int items_total, const int stride, const int chunk_count, const int random_seed, const int mutate)
 blender::TEST (array_store, TestData_Stride1_Chunk32_Mutate2)
 blender::TEST (array_store, TestData_Stride8_Chunk512_Mutate2)
 blender::TEST (array_store, TestData_Stride12_Chunk48_Mutate2)
 blender::TEST (array_store, TestData_Stride32_Chunk64_Mutate1)
 blender::TEST (array_store, TestData_Stride32_Chunk64_Mutate8)
static void blender::random_chunk_generate (ListBaseT< TestChunk > *lb, const int chunks_per_buffer, const int stride, const int chunk_count, const int random_seed)
static void blender::random_chunk_mutate_helper (const int chunks_per_buffer, const int items_total, const int stride, const int chunk_count, const int random_seed)
 blender::TEST (array_store, TestChunk_Rand8_Stride1_Chunk64)
 blender::TEST (array_store, TestChunk_Rand32_Stride1_Chunk64)
 blender::TEST (array_store, TestChunk_Rand64_Stride8_Chunk32)
 blender::TEST (array_store, TestChunk_Rand31_Stride11_Chunk21)
RLE Encode/Decode Utilities
static bool blender::rle_encode_decode_test (const uint8_t *data_dec, size_t data_dec_len, size_t *r_data_enc_len)
static void blender::array_store_test_random_span_rle_encode (const size_t data_size, const size_t span_size, const int permitations)
static void blender::array_store_test_random_data_rle_encode (const size_t data_size, const size_t data_ratio_size, const int permitations)
RLE Encode/Decode Tests
 blender::TEST (array_store, RLE_Simple)
 blender::TEST (array_store, RLE_Uniform)
 blender::TEST (array_store, RLE_Alignment)
 blender::TEST (array_store, RLE_RandomSpan)
 blender::TEST (array_store, RLE_RandomBytes)

Macro Definition Documentation

◆ D

#define D   "#1#2#3#4"

Referenced by area_light_spread_attenuation(), area_light_valid_ray_segment(), background_light_sample(), background_portal_pdf(), background_portal_sample(), background_sun_pdf(), bsdf_ashikhmin_velvet_eval(), bsdf_ashikhmin_velvet_sample(), bsdf_microfacet_eval(), bsdf_microfacet_sample(), btDoSimplex4(), bxdf_ggx_eval_reflection(), bxdf_ggx_eval_refraction(), bxdf_ggx_sample_reflection(), bxdf_ggx_sample_refraction(), camera_motion_vector_direction(), camera_sample_custom(), camera_sample_orthographic(), camera_sample_panorama(), camera_sample_perspective(), camera_sample_to_ray(), compute_v(), computeAccelerationsArticulatedBodyAlgorithmMultiDof(), libmv::ComputeTrackingEquation(), libmv::ArrayND< T, 3 >::CopyFrom(), differential_from_compact(), differential_make_compact(), eevee::ltc::detail::form_factor_attenuation(), guiding_phase_init(), guiding_record_background(), guiding_record_light_surface_segment(), integrate_light_forward(), integrate_sun_lights(), integrate_surface_bsdf_bssrdf_bounce(), integrate_surface_ray_portal(), integrator_eval_background_shader(), integrator_init_from_bake(), integrator_state_read_ray(), integrator_state_read_shadow_ray(), integrator_state_write_ray(), integrator_state_write_shadow_ray(), Freestyle::GeomUtils::intersect2dSegPoly(), kernel_displace_evaluate(), KernelFeatureRequest(), light_normal_uv_from_position(), light_sample(), light_sample_from_volume_segment(), light_sample_mis_weight_forward_background(), light_tree_emitter_importance(), light_tree_node_importance(), light_tree_pdf(), object_dir_transform(), object_inverse_dir_transform(), osl_eval_camera(), osl_eval_camera(), pdf_cos_hemisphere(), pdf_uniform_cone(), phase_draine_sample(), phase_fournier_forand_sample(), phase_henyey_greenstein_sample(), phase_rayleigh_sample(), phase_sample_direction(), Freestyle::ImagePyramid::pixel(), eevee::lightprobe::sphere::quad_solid_angle(), ray_cone_intersect(), ray_infinite_cylinder_intersect(), libmv::Tuple< int, N >::Reset(), EdgeDice::scale_factor(), eevee::ltc::detail::solve_cubic(), SolveP2(), SolveP4Bi(), sphere_light_pdf(), spherical_stereo_transform(), spot_light_pdf(), spot_light_valid_ray_segment(), sun_light_uv(), triangle_light_valid_ray_segment(), libmv::Tuple< int, N >::Tuple(), and Camera::world_to_raster_size().

◆ testbuffer_list_state_from_string_array

#define testbuffer_list_state_from_string_array ( lb,
data_array )
Value:
{ \
uint i_ = 0; \
const char *data; \
while ((data = data_array[i_++])) { \
testbuffer_list_state_from_data(lb, data, strlen(data)); \
} \
} \
((void)0)

Definition at line 186 of file BLI_array_store_test.cc.

◆ TESTBUFFER_STRINGS

#define TESTBUFFER_STRINGS ( stride,
chunk_count,
... )
Value:
{ \
ListBaseT<TestBuffer> lb; \
TESTBUFFER_STRINGS_CREATE(&lb, __VA_ARGS__); \
\
testbuffer_run_tests_simple(&lb, stride, chunk_count); \
\
testbuffer_list_free(&lb); \
} \
((void)0)

Definition at line 207 of file BLI_array_store_test.cc.

Referenced by blender::TEST().

◆ TESTBUFFER_STRINGS_CREATE

#define TESTBUFFER_STRINGS_CREATE ( lb,
... )
Value:
{ \
BLI_listbase_clear(lb); \
const char *data_array[] = {__VA_ARGS__ nullptr}; \
testbuffer_list_state_from_string_array((lb), data_array); \
} \
((void)0)

Definition at line 198 of file BLI_array_store_test.cc.

Referenced by blender::TEST().

◆ WORDS