| 37 | } |
| 38 | }; |
| 39 | var testAttributes = function(shaderName, attributes, expectedAttributes) { |
| 40 | // assert(expectedAttributes.length === Object.keys(attributes).length, |
| 41 | // shaderName + ' expected ' + expectedAttributes.length + |
| 42 | // ' attributes but has ' + Object.keys(attributes).length); |
| 43 | // test each one |
| 44 | for (var i = 0; i < expectedAttributes.length; i++) { |
| 45 | var attribute = attributes[expectedAttributes[i]]; |
| 46 | assert( |
| 47 | attribute !== undefined, |
| 48 | shaderName + ' missing expected attribute: ' + expectedAttributes[i] |
| 49 | ); |
| 50 | } |
| 51 | }; |
| 52 | var testShader = function( |
| 53 | shaderName, |
| 54 | shaderObj, |