~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/cubegeom_pre.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#endif
27
27
 
28
28
#include <stdio.h>
 
29
#include <stdlib.h>
29
30
#include <string.h>
30
31
#include <assert.h>
31
32
 
32
 
void verify() {
33
 
  int width = 640, height = 480;
34
 
  unsigned char *data = (unsigned char*)malloc(width*height*4);
35
 
  glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
36
 
  int sum = 0;
37
 
  for (int x = 0; x < width*height*4; x++) {
38
 
    if (x % 4 != 3) sum += x * data[x];
39
 
  }
40
 
#if EMSCRIPTEN
41
 
  int result = sum;
42
 
  REPORT_RESULT();
43
 
#endif
44
 
}
45
 
 
46
33
int main(int argc, char *argv[])
47
34
{
48
35
    SDL_Surface *screen;
295
282
 
296
283
    SDL_GL_SwapBuffers();
297
284
 
298
 
    verify();
299
 
    
 
285
   
300
286
#if !EMSCRIPTEN
301
287
    SDL_Delay(1500);
302
288
#endif