summaryrefslogtreecommitdiffstats
path: root/test/adx.c
diff options
context:
space:
mode:
authorEthan Werner <mail@ethanwerner.com>2026-08-09 15:02:21 +0400
committerEthan Werner <mail@ethanwerner.com>2026-08-09 15:02:21 +0400
commit3d92926a902017e7cf1f5738e99ff62da596ce12 (patch)
tree2b55422c26a48759d56fa91f06df24449e9dfa88 /test/adx.c
parent07e18043145f3d91c8ea7ec3ad41b3c905585277 (diff)
refactormain
Diffstat (limited to 'test/adx.c')
-rw-r--r--test/adx.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/adx.c b/test/adx.c
index e8df67e..aac452d 100644
--- a/test/adx.c
+++ b/test/adx.c
@@ -13,6 +13,11 @@ bool ts_test_adx( void )
x[1] = malloc( n * sizeof( fp_t ) );
x[2] = malloc( n * sizeof( fp_t ) );
x[3] = malloc( n * sizeof( fp_t ) );
+ if ( !x[0 ] || !x[1] || !x[2] || !x[3] )
+ {
+ free( x[0] ); free( x[1] ); free( x[2] ); free( x[3] );
+ return false;
+ }
for ( uint_t i = 0; i < n; ++i )
{
@@ -36,7 +41,16 @@ bool ts_test_adx( void )
* indices [offset..n-1], not compacted [0..y_n-1] */
fp_t *y[4];
for ( uint_t i = 0; i < 4; ++i )
+ {
y[i] = calloc( n, sizeof( fp_t ) );
+ if ( !y[i] )
+ {
+ for ( uint_t j = 0; j < i; ++j )
+ free( y[j] );
+ free( x[0] ); free( x[1] ); free( x[2] ); free( x[3] );
+ return false;
+ }
+ }
uint8_t c[TS_CONSTANT_SIZE] = { 0 };
*( uint_t * )c = k;