@@ -94,22 +94,43 @@ if (.runThisTest) {
9494 checkEquals( runit_NumericMatrix_row( x ), sum( x [1 ,] ), msg = " iterating over a row" )
9595 }
9696
97+ test.NumericMatrix.row.const <- function (){
98+ x <- matrix ( 1 : 16 + .5 , ncol = 4 )
99+ checkEquals( runit_NumericMatrix_row_const( x ), sum( x [1 ,] ), msg = " iterating over a row" )
100+ }
101+
97102 test.CharacterMatrix.row <- function (){
98103 m <- matrix ( letters , ncol = 2 )
99104 checkEquals( runit_CharacterMatrix_row(m ), paste( m [1 ,], collapse = " " ), msg = " CharacterVector::Row" )
100105 }
101106
107+ test.CharacterMatrix.row.const <- function (){
108+ m <- matrix ( letters , ncol = 2 )
109+ checkEquals( runit_CharacterMatrix_row_const(m ), paste( m [1 ,], collapse = " " ), msg = " CharacterVector::Row" )
110+ }
111+
102112 test.List.row <- function (){
103113 m <- lapply( 1 : 16 , function (i ) seq(from = 1 , to = i ) )
104114 dim( m ) <- c( 4 , 4 )
105115 checkEquals( runit_GenericMatrix_row( m ), 1 + 0 : 3 * 4 , msg = " List::Row" )
106116 }
107117
118+ test.List.row.const <- function (){
119+ m <- lapply( 1 : 16 , function (i ) seq(from = 1 , to = i ) )
120+ dim( m ) <- c( 4 , 4 )
121+ checkEquals( runit_GenericMatrix_row_const( m ), 1 + 0 : 3 * 4 , msg = " List::Row" )
122+ }
123+
108124 test.NumericMatrix.column <- function (){
109125 x <- matrix ( 1 : 16 + .5 , ncol = 4 )
110126 checkEquals( runit_NumericMatrix_column( x ), sum( x [,1 ] ) , msg = " iterating over a column" )
111127 }
112128
129+ test.NumericMatrix.column.const <- function (){
130+ x <- matrix ( 1 : 16 + .5 , ncol = 4 )
131+ checkEquals( runit_NumericMatrix_column_const( x ), sum( x [,1 ] ) , msg = " iterating over a column" )
132+ }
133+
113134 test.NumericMatrix.cumsum <- function (){
114135 x <- matrix ( 1 : 8 + .5 , ncol = 2 )
115136 checkEquals( runit_NumericMatrix_cumsum( x ), t(apply(x , 1 , cumsum )) , msg = " cumsum" )
@@ -120,12 +141,23 @@ if (.runThisTest) {
120141 checkEquals( runit_CharacterMatrix_column(m ), paste( m [,1 ], collapse = " " ), msg = " CharacterVector::Column" )
121142 }
122143
144+ test.CharacterMatrix.column.const <- function (){
145+ m <- matrix ( letters , ncol = 2 )
146+ checkEquals( runit_CharacterMatrix_column_const(m ), paste( m [,1 ], collapse = " " ), msg = " CharacterVector::Column" )
147+ }
148+
123149 test.List.column <- function (){
124150 m <- lapply( 1 : 16 , function (i ) seq(from = 1 , to = i ) )
125151 dim( m ) <- c( 4 , 4 )
126152 checkEquals( runit_GenericMatrix_column( m ), 1 : 4 , msg = " List::Column" )
127153 }
128154
155+ test.List.column.const <- function (){
156+ m <- lapply( 1 : 16 , function (i ) seq(from = 1 , to = i ) )
157+ dim( m ) <- c( 4 , 4 )
158+ checkEquals( runit_GenericMatrix_column_const( m ), 1 : 4 , msg = " List::Column" )
159+ }
160+
129161 test.NumericMatrix.colsum <- function ( ){
130162 probs <- matrix (1 : 12 ,nrow = 3 )
131163 checkEquals( runit_NumericMatrix_colsum( probs ), t(apply(probs ,1 ,cumsum )) )
0 commit comments