parameters: (self, func, f, *extras)
docstring: Overrriden from TypeHandler.
docstring_summary: Overrriden from TypeHandler.
docstring_tokens: Overrriden from TypeHandler .
function: def WriteServiceUnitTest(self, func, f, *extras):
      """Overrriden from TypeHandler."""
      TypeHandler.WriteServiceUnitTest(self, func, f, *extras)
      state_name = func.GetInfo('state')
      state = _STATES[state_name]
      states = state['states']
      for ndx,item in enumerate(states):
        if 'range_checks' in item:
          for check_ndx, range_check in enumerate(item['range_checks']):
            valid_test = """
  TEST_P(%(test_name)s, %(name)sInvalidValue%(ndx)d_%(check_ndx)d) {
    SpecializedSetup<cmds::%(name)s, 0>(false);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
  }
  """
            name = func.name
            arg_strings = [
              arg.GetValidArg(func) \
              for arg in func.GetOriginalArgs() if not arg.IsConstant()
            ]
  
            arg_strings[ndx] = range_check['test_value']
            vars = {
              'name': name,
              'ndx': ndx,
              'check_ndx': check_ndx,
              'args': ", ".join(arg_strings),
            }
            for extra in extras:
              vars.update(extra)
            f.write(valid_test % vars)
        if 'nan_check' in item:
          valid_test = """
  TEST_P(%(test_name)s, %(name)sNaNValue%(ndx)d) {
    SpecializedSetup<cmds::%(name)s, 0>(false);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
  }
  """
          name = func.name
          arg_strings = [
            arg.GetValidArg(func) \
            for arg in func.GetOriginalArgs() if not arg.IsConstant()
          ]
  
          arg_strings[ndx] = 'nanf("")'
          vars = {
            'name': name,
            'ndx': ndx,
            'args': ", ".join(arg_strings),
          }
          for extra in extras:
            vars.update(extra)
          f.write(valid_test % vars)
function_tokens: def WriteServiceUnitTest ( self , func , f , * extras ) : TypeHandler . WriteServiceUnitTest ( self , func , f , * extras ) state_name = func . GetInfo ( 'state' ) state = _STATES [ state_name ] states = state [ 'states' ] for ndx , item in enumerate ( states ) : if 'range_checks' in item : for check_ndx , range_check in enumerate ( item [ 'range_checks' ] ) : valid_test = """
  TEST_P(%(test_name)s, %(name)sInvalidValue%(ndx)d_%(check_ndx)d) {
    SpecializedSetup<cmds::%(name)s, 0>(false);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
  }
  """ name = func . name arg_strings = [ arg . GetValidArg ( func ) for arg in func . GetOriginalArgs ( ) if not arg . IsConstant ( ) ] arg_strings [ ndx ] = range_check [ 'test_value' ] vars = { 'name' : name , 'ndx' : ndx , 'check_ndx' : check_ndx , 'args' : ", " . join ( arg_strings ) , } for extra in extras : vars . update ( extra ) f . write ( valid_test % vars ) if 'nan_check' in item : valid_test = """
  TEST_P(%(test_name)s, %(name)sNaNValue%(ndx)d) {
    SpecializedSetup<cmds::%(name)s, 0>(false);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
  }
  """ name = func . name arg_strings = [ arg . GetValidArg ( func ) for arg in func . GetOriginalArgs ( ) if not arg . IsConstant ( ) ] arg_strings [ ndx ] = 'nanf("")' vars = { 'name' : name , 'ndx' : ndx , 'args' : ", " . join ( arg_strings ) , } for extra in extras : vars . update ( extra ) f . write ( valid_test % vars )