You can do this with apply, called on the columns of test:
test = apply(test, 2, function(x) x+rnorm(length(x), sd=sqrt(x)))
Longer form (without one-line function syntax):
adjust.values = function(x) {
return(x + rnorm(length(x), sd=sqrt(x)))
}
test = apply(test, 2, adjust.values)