parameters: (self, func, f, *extras)
docstring: Overridden from TypeHandler.
docstring_summary: Overridden from TypeHandler.
docstring_tokens: Overridden from TypeHandler .
function: def WriteImmediateServiceUnitTest(self, func, f, *extras):
      """Overridden from TypeHandler."""
      valid_test = """
  TEST_P(%(test_name)s, %(name)sValidArgs) {
    cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
    SpecializedSetup<cmds::%(name)s, 0>(true);
    %(data_type)s temp[%(data_count)s * 2] = { 0, };
    EXPECT_CALL(
        *gl_,
        %(gl_func_name)s(%(gl_args)s,
            PointsToArray(temp, %(data_count)s)));
    cmd.Init(%(args)s, &temp[0]);
    EXPECT_EQ(error::kNoError,
              ExecuteImmediateCmd(cmd, sizeof(temp)));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """
      gl_arg_strings = []
      gl_any_strings = []
      arg_strings = []
      for arg in func.GetOriginalArgs()[0:-1]:
        gl_arg_strings.append(arg.GetValidGLArg(func))
        gl_any_strings.append("_")
        if not arg.IsConstant():
          arg_strings.append(arg.GetValidArg(func))
      extra = {
        'data_type': self.GetArrayType(func),
        'data_count': self.GetArrayCount(func),
        'args': ", ".join(arg_strings),
        'gl_args': ", ".join(gl_arg_strings),
        'gl_any_args': ", ".join(gl_any_strings),
      }
      self.WriteValidUnitTest(func, f, valid_test, extra, *extras)
  
      invalid_test = """
  TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
    cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
    EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(0);
    SpecializedSetup<cmds::%(name)s, 0>(false);
    %(data_type)s temp[%(data_count)s * 2] = { 0, };
    cmd.Init(%(all_but_last_args)s, &temp[0]);
    EXPECT_EQ(error::%(parse_result)s,
              ExecuteImmediateCmd(cmd, sizeof(temp)));%(gl_error_test)s
  }
  """
      self.WriteInvalidUnitTest(func, f, invalid_test, extra, *extras)
function_tokens: def WriteImmediateServiceUnitTest ( self , func , f , * extras ) : valid_test = """
  TEST_P(%(test_name)s, %(name)sValidArgs) {
    cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
    SpecializedSetup<cmds::%(name)s, 0>(true);
    %(data_type)s temp[%(data_count)s * 2] = { 0, };
    EXPECT_CALL(
        *gl_,
        %(gl_func_name)s(%(gl_args)s,
            PointsToArray(temp, %(data_count)s)));
    cmd.Init(%(args)s, &temp[0]);
    EXPECT_EQ(error::kNoError,
              ExecuteImmediateCmd(cmd, sizeof(temp)));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """ gl_arg_strings = [ ] gl_any_strings = [ ] arg_strings = [ ] for arg in func . GetOriginalArgs ( ) [ 0 : - 1 ] : gl_arg_strings . append ( arg . GetValidGLArg ( func ) ) gl_any_strings . append ( "_" ) if not arg . IsConstant ( ) : arg_strings . append ( arg . GetValidArg ( func ) ) extra = { 'data_type' : self . GetArrayType ( func ) , 'data_count' : self . GetArrayCount ( func ) , 'args' : ", " . join ( arg_strings ) , 'gl_args' : ", " . join ( gl_arg_strings ) , 'gl_any_args' : ", " . join ( gl_any_strings ) , } self . WriteValidUnitTest ( func , f , valid_test , extra , * extras ) invalid_test = """
  TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
    cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
    EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(0);
    SpecializedSetup<cmds::%(name)s, 0>(false);
    %(data_type)s temp[%(data_count)s * 2] = { 0, };
    cmd.Init(%(all_but_last_args)s, &temp[0]);
    EXPECT_EQ(error::%(parse_result)s,
              ExecuteImmediateCmd(cmd, sizeof(temp)));%(gl_error_test)s
  }
  """ self . WriteInvalidUnitTest ( func , f , invalid_test , extra , * extras )