original_docstring: Writes a format test for a command.
docstring: Writes a format test for a command.
docstring_tokens: Writes a format test for a command .
code: def WriteFormatTest(self, func, file):
      """Writes a format test for a command."""
      file.Write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
      file.Write("  cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
                 (func.name, func.name))
      file.Write("  void* next_cmd = cmd.Set(\n")
      file.Write("      &cmd")
      args = func.GetCmdArgs()
      for value, arg in enumerate(args):
        file.Write(",\n      static_cast<%s>(%d)" % (arg.type, value + 11))
      file.Write(");\n")
      file.Write("  EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
                 func.name)
      file.Write("            cmd.header.command);\n")
      func.type_handler.WriteCmdSizeTest(func, file)
      for value, arg in enumerate(args):
        file.Write("  EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" %
                   (arg.type, value + 11, arg.name))
      file.Write("  CheckBytesWrittenMatchesExpectedSize(\n")
      file.Write("      next_cmd, sizeof(cmd));\n")
      file.Write("}\n")
      file.Write("\n")
code_tokens: def WriteFormatTest ( self , func , file ) : file . Write ( "TEST_F(GLES2FormatTest, %s) {\n" % func . name ) file . Write ( "  cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" % ( func . name , func . name ) ) file . Write ( "  void* next_cmd = cmd.Set(\n" ) file . Write ( "      &cmd" ) args = func . GetCmdArgs ( ) for value , arg in enumerate ( args ) : file . Write ( ",\n      static_cast<%s>(%d)" % ( arg . type , value + 11 ) ) file . Write ( ");\n" ) file . Write ( "  EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" % func . name ) file . Write ( "            cmd.header.command);\n" ) func . type_handler . WriteCmdSizeTest ( func , file ) for value , arg in enumerate ( args ) : file . Write ( "  EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % ( arg . type , value + 11 , arg . name ) ) file . Write ( "  CheckBytesWrittenMatchesExpectedSize(\n" ) file . Write ( "      next_cmd, sizeof(cmd));\n" ) file . Write ( "}\n" ) file . Write ( "\n" )
short_docstring: Writes a format test for a command.
short_docstring_tokens: Writes a format test for a command .
comment: """Writes a format test for a command."""