Ah, you've hit on a weird quirk caused by one of the few manipulations we do to your code before passing it to the C/C++ compiler (avr-gcc). The Arduino software automatically generates prototypes for your functions. This basically involves taking a copy of the function header and sticking it at the top of your sketch. Unfortunately, this means that it ends up before the #define statement, and so test is undeclared at that point.

One workaround is to use a single dimensional array whose size is the product of the two dimensions you want, and use (y * X_SIZE + x) to access an element of it. Then you can declare the function as: