Adds a new test case generator for the given system function.
172044
public void addGenerator( String functionName, ITestCaseGenerator generator)
    {
    String functionKey = getFunctionKey( functionName);
    if( generators_.containsKey( functionKey))
      {
      throw new IllegalArgumentException( "Generator already defined for function=" + functionName);
      }

    if( generator != null)
      {
      generators_.put( functionKey, generator);
      }
    }
702405
@Nonnull
	public <V extends T> LFunctionBuilder<T, R> aCase(Class<V> argC, LFunction<V, R> function) {
		PartialCaseWithProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
929267
def main():
    """"""

    print("Python version %s" % sys.version)

    print("Testing compatibility for function defined with *args")
    test_func_args(func_old_args)
    test_func_args(func_new)

    print("Testing compatibility for function defined with **kwargs")
    test_func_kwargs(func_old_kwargs)
    test_func_kwargs(func_new)

    print("All tests successful - we can change *args and **kwargs to' \
          ' named args.")
    return 0
361865
def load_case(self, testcase):
        
        tests = [self.load_test(testcase, name)
                 for name in self.find_test_method_names(testcase)]
        return self.create_suite(tests)
1276921
@Nonnull
	public <V1 extends T1, V2 extends T2> LObjIntObjFunctionBuilder<T1, T2, R> aCase(Class<V1> argC1, Class<V2> argC3, LObjIntObjFunction<V1, V2, R> function) {
		PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC3 == null || argC3.isInstance(a2)));

		pc.evaluate(function);
		return self();
	}
1148139
@Nonnull
	public <V extends T> LToSrtFunctionBuilder<T> aCase(Class<V> argC, LToSrtFunction<V> function) {
		PartialCaseWithSrtProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
1011405
function addFunction(func, sig) {
  var base = 0;
  for (var i = base; i < base + 0; i++) {
    if (!functionPointers[i]) {
      functionPointers[i] = func;
      return jsCallStartIndex + i;
    }
  }
  throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';
}
1126809
@SuppressWarnings("unchecked")
  public <T extends SubSystem> T
  addSystemIfAbsent(Class<?> systemApi, T system)
  {
    SubSystem oldService
      = _systemMap.putIfAbsent(systemApi, system);

    if (oldService != null) {
      return (T) oldService;
    }

    _pendingStart.add(system);

    if (_lifecycle.isActive()) {
      startSystems();
    }

    return null;
  }
1328123
@Nonnull
	public <V extends T> LToFltFunctionBuilder<T> aCase(Class<V> argC, LToFltFunction<V> function) {
		PartialCaseWithFltProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
1301740
def add_suspect(self, case_obj, variant_obj):
        """"""
        new_suspect = Suspect(case=case_obj, variant_id=variant_obj.variant_id,
                              name=variant_obj.display_name)
        self.session.add(new_suspect)
        self.save()
        return new_suspect
674115
def add_call(self, func):
        """"""
        self.trace.append("{} ({}:{})".format(
            object_name(func),
            inspect.getsourcefile(func),
            inspect.getsourcelines(func)[1]))

        return self
1315823
private List<TestCaseDef> getBaseCases( FunctionInputDef inputDef, FunctionTestDef baseTests)
    {
    logger_.debug( "{}: Creating base test cases", inputDef);

    List<TestCaseDef> testCases = new ArrayList<TestCaseDef>();
    if( baseTests != null)
      {
      // For each base test case...
      for( Iterator<TestCase> baseCases = baseTests.getTestCases();
           baseCases.hasNext(); )
        {
        // Create the corresponding test case definition...
        TestCase baseTest = baseCases.next();
        TestCaseDef testCase = new TestCaseDef();
        testCase.setId( baseTest.getId());
        logger_.debug( "Adding base test={}", baseTest);

        // For each variable binding...
        for( Iterator<VarBinding> bindings = baseTest.getVarBindings();
             testCase != null && bindings.hasNext();)
          {
          VarBinding binding = bindings.next();
          VarDef var = inputDef.findVarDefPath( binding.getVar());
          VarValueDef value = var==null? null : var.getValue( binding.getValue());

          // Is variable still defined?
          if( var == null)
            {
            logger_.trace( "Var={} undefined", binding.getVar());
            }
          // Is value still defined?
          else if( value == null)
            {
            logger_.trace( "Value={} undefined", binding);
            }
          // Value type unchanged?
          else if( value.isValid() != binding.isValueValid())
            {
            // No, can't preserve this base test.
            logger_.debug
              ( "Can't add {}, {} changed to failure={}",
                new Object[]{ baseTest, binding, !value.isValid()});
            testCase = null;
            }
          else
            {
            // Add variable binding if still compatible.
            testCase.addCompatible( new Tuple( new VarBindingDef( var, value)));
            }
          }

        if( testCase != null && testCase.getVars().hasNext())
          {
          // Add new (possibly incomplete) test case definition for this base test.
          testCases.add( testCase);
          }
        }
      }
    
    logger_.debug( "{}: Completed {} base test cases", inputDef, testCases.size());
    return testCases;
    }
217019
async def syscall(self, func, ignoreException = False):
        
        ev = await self.syscall_noreturn(func)
        if hasattr(ev, 'exception'):
            if ignoreException:
                return
            else:
                raise ev.exception[1]
        else:
            return ev.retvalue
426417
def add_function(self, function):
        
        function = self.build_function(function)
        if function.name in self.functions:
            raise FunctionAlreadyRegistered(function.name)
        self.functions[function.name] = function
51492
def add_new_target_system(self, sysid):
        ''''''
        if sysid in self.pstate:
            return
        if not sysid in self.mpstate.mav_param_by_sysid:
            self.mpstate.mav_param_by_sysid[sysid] = mavparm.MAVParmDict()
            self.new_sysid_timestamp = time.time()
        fname = 'mav.parm'
        if sysid not in [(0,0),(1,1),(1,0)]:

            fname = 'mav_%u_%u.parm' % (sysid[0], sysid[1])
        self.pstate[sysid] = ParamState(self.mpstate.mav_param_by_sysid[sysid], self.logdir, self.vehicle_name, fname)
        if self.continue_mode and self.logdir is not None:
            parmfile = os.path.join(self.logdir, fname)
            if os.path.exists(parmfile):
                mpstate.mav_param.load(parmfile)
                self.pstate[sysid].mav_param_set = set(self.mav_param.keys())
        self.pstate[sysid].xml_filepath = self.xml_filepath
1055883
def add_ast_fn(d, spec, parent_function=None):
    

    if d["type"] == "Function":
        ast_fn = Function(d["function"]["name"], spec, parent_function=parent_function)
        for arg in d["args"]:
            if arg["type"] == "Function":
                ast_fn.add_argument(add_ast_fn(arg, spec, parent_function=ast_fn))
            elif arg["type"] == "NSArg":
                ast_fn.add_argument(
                    NSArg(arg["nsarg"]["ns"], arg["nsarg"]["ns_val"], ast_fn)
                )
            elif arg["type"] == "StrArg":
                ast_fn.add_argument(StrArg(arg["arg"], ast_fn))
    return ast_fn
75624
def addUnexpectedSuccess(self, test):
        
        result = self._handle_result(
            test, TestCompletionStatus.unexpected_success)
        self.unexpectedSuccesses.append(result)