gpu/command_buffer/build_cmd_buffer_lib.py
def WriteInvalidUnitTest(self, func, f, test, *extras):
    """Writes an invalid unit test for the service implementation."""
    if func.IsES3():
      return
    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

        varz = {
          '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:
          varz.update(extra)
        f.write(test % varz)
Writes an invalid unit test for the service implementation.
Writes an invalid unit test for the service implementation.
Writes an invalid unit test for the service implementation .
def WriteInvalidUnitTest(self, func, f, test, *extras):
    if func.IsES3():
      return
    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
        varz = {
          '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:
          varz.update(extra)
        f.write(test % varz)
def WriteInvalidUnitTest ( self , func , f , test , * extras ) : if func . IsES3 ( ) : return 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 varz = { '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 : varz . update ( extra ) f . write ( test % varz )
Writes an invalid unit test for the service implementation.
Writes an invalid unit test for the service implementation .
"""Writes an invalid unit test for the service implementation.""" # Service implementation does not test constants, as they are not part of # the call in the service side.
self
func
f
test