parameters: (self, func, file)
docstring: Overrriden from TypeHandler.
docstring_summary: Overrriden from TypeHandler.
docstring_tokens: Overrriden from TypeHandler .
function: def WriteServiceUnitTest(self, func, file):
      """Overrriden from TypeHandler."""
      TypeHandler.WriteServiceUnitTest(self, func, file)
      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_F(%(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 = []
            for count, arg in enumerate(func.GetOriginalArgs()):
              arg_strings.append(arg.GetValidArg(func, count, 0))
            arg_strings[ndx] = range_check['test_value']
            vars = {
              'test_name': 'GLES2DecoderTest%d' % file.file_num,
              'name': name,
              'ndx': ndx,
              'check_ndx': check_ndx,
              'args': ", ".join(arg_strings),
            }
            file.Write(valid_test % vars)
function_tokens: def WriteServiceUnitTest ( self , func , file ) : TypeHandler . WriteServiceUnitTest ( self , func , file ) 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_F(%(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 = [ ] for count , arg in enumerate ( func . GetOriginalArgs ( ) ) : arg_strings . append ( arg . GetValidArg ( func , count , 0 ) ) arg_strings [ ndx ] = range_check [ 'test_value' ] vars = { 'test_name' : 'GLES2DecoderTest%d' % file . file_num , 'name' : name , 'ndx' : ndx , 'check_ndx' : check_ndx , 'args' : ", " . join ( arg_strings ) , } file . Write ( valid_test % vars )