original_docstring: Writes the GLES2 Implemention unit test.
docstring: Writes the GLES2 Implemention unit test.
docstring_tokens: Writes the GLES2 Implemention unit test .
code: def WriteGLES2ImplementationUnitTest(self, func, file):
      """Writes the GLES2 Implemention unit test."""
      code = """
  TEST_F(GLES2ImplementationTest, %(name)s) {
    struct Cmds {
      cmds::%(name)s cmd;
    };
    typedef cmds::%(name)s::Result Result;
    Result::Type result = 0;
    Cmds expected;
    ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
    expected.cmd.Init(%(cmd_args)s, result1.id, result1.offset);
    EXPECT_CALL(*command_buffer(), OnFlush())
        .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
        .RetiresOnSaturation();
    gl_->%(name)s(%(args)s, &result);
    EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
    EXPECT_EQ(static_cast<Result::Type>(1), result);
  }
  """
      first_cmd_arg = func.GetCmdArgs()[0].GetValidNonCachedClientSideCmdArg(func)
      if not first_cmd_arg:
        return
  
      first_gl_arg = func.GetCmdArgs()[0].GetValidNonCachedClientSideArg(func)
      cmd_arg_strings = [first_cmd_arg]
      for arg in func.GetCmdArgs()[1:-2]:
        cmd_arg_strings.append(arg.GetValidClientSideCmdArg(func))
      gl_arg_strings = [first_gl_arg]
      for arg in func.GetOriginalArgs()[1:-1]:
        gl_arg_strings.append(arg.GetValidClientSideArg(func))
  
      file.Write(code % {
            'name': func.name,
            'args': ", ".join(gl_arg_strings),
            'cmd_args': ", ".join(cmd_arg_strings),
          })
code_tokens: def WriteGLES2ImplementationUnitTest ( self , func , file ) : code = """
  TEST_F(GLES2ImplementationTest, %(name)s) {
    struct Cmds {
      cmds::%(name)s cmd;
    };
    typedef cmds::%(name)s::Result Result;
    Result::Type result = 0;
    Cmds expected;
    ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
    expected.cmd.Init(%(cmd_args)s, result1.id, result1.offset);
    EXPECT_CALL(*command_buffer(), OnFlush())
        .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
        .RetiresOnSaturation();
    gl_->%(name)s(%(args)s, &result);
    EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
    EXPECT_EQ(static_cast<Result::Type>(1), result);
  }
  """ first_cmd_arg = func . GetCmdArgs ( ) [ 0 ] . GetValidNonCachedClientSideCmdArg ( func ) if not first_cmd_arg : return first_gl_arg = func . GetCmdArgs ( ) [ 0 ] . GetValidNonCachedClientSideArg ( func ) cmd_arg_strings = [ first_cmd_arg ] for arg in func . GetCmdArgs ( ) [ 1 : - 2 ] : cmd_arg_strings . append ( arg . GetValidClientSideCmdArg ( func ) ) gl_arg_strings = [ first_gl_arg ] for arg in func . GetOriginalArgs ( ) [ 1 : - 1 ] : gl_arg_strings . append ( arg . GetValidClientSideArg ( func ) ) file . Write ( code % { 'name' : func . name , 'args' : ", " . join ( gl_arg_strings ) , 'cmd_args' : ", " . join ( cmd_arg_strings ) , } )
short_docstring: Writes the GLES2 Implemention unit test.
short_docstring_tokens: Writes the GLES2 Implemention unit test .
comment: """Writes the GLES2 Implemention unit test."""