Bug 825205 - WebGL drawElements: add unit test for the case where the max allowable index wrap to 0 in the index type - r=vladv
authorBenoit Jacob <bjacob@mozilla.com>
Sat, 05 Jan 2013 21:05:08 -0500
changeset 117769 27fead003810e687a88e24e3620e6c43076dcfe6
parent 117768 387349ed9abf760cebb676d572fc28241092f1eb
child 117770 a30a8521c16880fe67a34fd5e566123b45301716
push id24112
push usereakhgari@mozilla.com
push dateSun, 06 Jan 2013 18:33:28 +0000
treeherdermozilla-central@6503c6bee6f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladv
bugs825205
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 825205 - WebGL drawElements: add unit test for the case where the max allowable index wrap to 0 in the index type - r=vladv
content/canvas/compiledtest/TestWebGLElementArrayCache.cpp
--- a/content/canvas/compiledtest/TestWebGLElementArrayCache.cpp
+++ b/content/canvas/compiledtest/TestWebGLElementArrayCache.cpp
@@ -110,16 +110,23 @@ void CheckSanity()
     data[i] = numElems - i;
   c.BufferData(data, numBytes);
   VERIFY( c.Validate(type, numElems,     0, numElems));
   VERIFY(!c.Validate(type, numElems - 1, 0, numElems));
 
   MOZ_ASSERT(numElems > 10);
   VERIFY( c.Validate(type, numElems - 10, 10, numElems - 10));
   VERIFY(!c.Validate(type, numElems - 11, 10, numElems - 10));
+
+  // bug 825205
+  if (sizeof(T) < sizeof(uint32_t)) {
+    uint32_t bigValWrappingToZero = uint32_t(T(-1)) + 1;
+    VERIFY(c.Validate(type, bigValWrappingToZero,     0, numElems));
+    VERIFY(c.Validate(type, bigValWrappingToZero - 1, 0, numElems));
+  }
 }
 
 int main(int argc, char *argv[])
 {
   srand(0); // do not want a random seed here.
 
   CheckSanity<uint8_t>();
   CheckSanity<uint16_t>();