parameters: (self, func, file)
docstring: Writes the GLES2 Implemention unit test.
docstring_summary: Writes the GLES2 Implemention unit test.
docstring_tokens: Writes the GLES2 Implemention unit test .
function: def WriteGLES2ImplementationUnitTest(self, func, file):
      """Writes the GLES2 Implemention unit test."""
      code = """
  TEST_F(GLES2ImplementationTest, %(name)s) {
    struct Cmds {
      %(name)sImmediate cmd;
      %(type)s data[%(count)d];
    };
  
    Cmds expected;
    for (int jj = 0; jj < %(count)d; ++jj) {
      expected.data[jj] = static_cast<%(type)s>(jj);
    }
    expected.cmd.Init(%(cmd_args)s, &expected.data[0]);
    gl_->%(name)s(%(args)s, &expected.data[0]);
    EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
  }
  """
      cmd_arg_strings = []
      count = 0
      for arg in func.GetCmdArgs()[0:-2]:
        cmd_arg_strings.append(arg.GetValidClientSideCmdArg(func, count, 0))
        count += 1
      gl_arg_strings = []
      count = 0
      for arg in func.GetOriginalArgs()[0:-1]:
        gl_arg_strings.append(arg.GetValidClientSideArg(func, count, 0))
        count += 1
      file.Write(code % {
            'name': func.name,
            'type': func.GetInfo('data_type'),
            'count': func.GetInfo('count'),
            'args': ", ".join(gl_arg_strings),
            'cmd_args': ", ".join(cmd_arg_strings),
          })
function_tokens: def WriteGLES2ImplementationUnitTest ( self , func , file ) : code = """
  TEST_F(GLES2ImplementationTest, %(name)s) {
    struct Cmds {
      %(name)sImmediate cmd;
      %(type)s data[%(count)d];
    };
  
    Cmds expected;
    for (int jj = 0; jj < %(count)d; ++jj) {
      expected.data[jj] = static_cast<%(type)s>(jj);
    }
    expected.cmd.Init(%(cmd_args)s, &expected.data[0]);
    gl_->%(name)s(%(args)s, &expected.data[0]);
    EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
  }
  """ cmd_arg_strings = [ ] count = 0 for arg in func . GetCmdArgs ( ) [ 0 : - 2 ] : cmd_arg_strings . append ( arg . GetValidClientSideCmdArg ( func , count , 0 ) ) count += 1 gl_arg_strings = [ ] count = 0 for arg in func . GetOriginalArgs ( ) [ 0 : - 1 ] : gl_arg_strings . append ( arg . GetValidClientSideArg ( func , count , 0 ) ) count += 1 file . Write ( code % { 'name' : func . name , 'type' : func . GetInfo ( 'data_type' ) , 'count' : func . GetInfo ( 'count' ) , 'args' : ", " . join ( gl_arg_strings ) , 'cmd_args' : ", " . join ( cmd_arg_strings ) , } )