Skip to content

Commit

Permalink
Fix assertions for maximum data length and increase vector size in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Feb 8, 2024
1 parent 68597c6 commit 0ce142a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private void validateSingleCellDataVectors( ExpressionExperiment ee, Quantitatio
"Only double is supported for single-cell data vector storage." );
int maximumDataLength = 8 * singleCellDimension.getCellIds().size();
for ( SingleCellExpressionDataVector vector : vectors ) {
Assert.isTrue( vector.getData().length < maximumDataLength,
Assert.isTrue( vector.getData().length <= maximumDataLength,
String.format( "All vector must have at most %d bytes.", maximumDataLength ) );
// 1. monotonous, 2. distinct, 3. within the range of the cell IDs
int lastI = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,12 @@ private Collection<SingleCellExpressionDataVector> createSingleCellVectors( Sing
v.setDesignElement( cs );
v.setSingleCellDimension( scd );
v.setQuantitationType( qt );
v.setData( new byte[0] );
v.setDataIndices( new int[0] );
v.setData( new byte[8 * 100] );
int[] ix = new int[8 * 100];
for ( int i = 0; i < 800; i++ ) {
ix[i] = i;
}
v.setDataIndices( ix );
vectors.add( v );
}
return vectors;
Expand Down

0 comments on commit 0ce142a

Please sign in to comment.