original_docstring: Writes an invalid unit test for the service implementation.
docstring: Writes an invalid unit test for the service implementation.
docstring_tokens: Writes an invalid unit test for the service implementation .
code: def WriteInvalidUnitTest(self, func, file, test, *extras):
      """Writes an invalid unit test for the service implementation."""
      for invalid_arg_index, invalid_arg in enumerate(func.GetOriginalArgs()):
        # Service implementation does not test constants, as they are not part of
        # the call in the service side.
        if invalid_arg.IsConstant():
          continue
  
        num_invalid_values = invalid_arg.GetNumInvalidValues(func)
        for value_index in range(0, num_invalid_values):
          arg_strings = []
          parse_result = "kNoError"
          gl_error = None
          for arg in func.GetOriginalArgs():
            if arg.IsConstant():
              continue
            if invalid_arg is arg:
              (arg_string, parse_result, gl_error) = arg.GetInvalidArg(
                  value_index)
            else:
              arg_string = arg.GetValidArg(func)
            arg_strings.append(arg_string)
          gl_arg_strings = []
          for arg in func.GetOriginalArgs():
            gl_arg_strings.append("_")
          gl_func_name = func.GetGLTestFunctionName()
          gl_error_test = ''
          if not gl_error == None:
            gl_error_test = '\n  EXPECT_EQ(%s, GetGLError());' % gl_error
  
          vars = {
            'name': func.name,
            'arg_index': invalid_arg_index,
            'value_index': value_index,
            'gl_func_name': gl_func_name,
            'args': ", ".join(arg_strings),
            'all_but_last_args': ", ".join(arg_strings[:-1]),
            'gl_args': ", ".join(gl_arg_strings),
            'parse_result': parse_result,
              'gl_error_test': gl_error_test,
          }
          for extra in extras:
            vars.update(extra)
          file.Write(test % vars)
code_tokens: def WriteInvalidUnitTest ( self , func , file , test , * extras ) : for invalid_arg_index , invalid_arg in enumerate ( func . GetOriginalArgs ( ) ) : if invalid_arg . IsConstant ( ) : continue num_invalid_values = invalid_arg . GetNumInvalidValues ( func ) for value_index in range ( 0 , num_invalid_values ) : arg_strings = [ ] parse_result = "kNoError" gl_error = None for arg in func . GetOriginalArgs ( ) : if arg . IsConstant ( ) : continue if invalid_arg is arg : ( arg_string , parse_result , gl_error ) = arg . GetInvalidArg ( value_index ) else : arg_string = arg . GetValidArg ( func ) arg_strings . append ( arg_string ) gl_arg_strings = [ ] for arg in func . GetOriginalArgs ( ) : gl_arg_strings . append ( "_" ) gl_func_name = func . GetGLTestFunctionName ( ) gl_error_test = '' if not gl_error == None : gl_error_test = '\n  EXPECT_EQ(%s, GetGLError());' % gl_error vars = { 'name' : func . name , 'arg_index' : invalid_arg_index , 'value_index' : value_index , 'gl_func_name' : gl_func_name , 'args' : ", " . join ( arg_strings ) , 'all_but_last_args' : ", " . join ( arg_strings [ : - 1 ] ) , 'gl_args' : ", " . join ( gl_arg_strings ) , 'parse_result' : parse_result , 'gl_error_test' : gl_error_test , } for extra in extras : vars . update ( extra ) file . Write ( test % vars )
short_docstring: Writes an invalid unit test for the service implementation.
short_docstring_tokens: Writes an invalid unit test for the service implementation .
comment: """Writes an invalid unit test for the service implementation."""$SEP$# Service implementation does not test constants, as they are not part of$SEP$# the call in the service side.