NumericLoggingDecorator implements Numeric, PerformanceLogger { @Override public DRes<SInt> mult(DRes<SInt> a, DRes<SInt> b) { this.multCount++; return this.delegate.mult(a, b); } NumericLoggingDecorator(Numeric delegate); @Override DRes<SInt> add(DRes<SInt> a, DRes<SInt> b); @Override DRes<SInt> add(BigInteger a, DRes<SInt> b); @Override DRes<SInt> sub(DRes<SInt> a, DRes<SInt> b); @Override DRes<SInt> sub(BigInteger a, DRes<SInt> b); @Override DRes<SInt> sub(DRes<SInt> a, BigInteger b); @Override DRes<SInt> mult(DRes<SInt> a, DRes<SInt> b); @Override DRes<SInt> mult(BigInteger a, DRes<SInt> b); @Override DRes<SInt> randomBit(); @Override DRes<SInt> randomElement(); @Override DRes<SInt> known(BigInteger value); @Override DRes<SInt> input(BigInteger value, int inputParty); @Override DRes<BigInteger> open(DRes<SInt> secretShare); @Override DRes<BigInteger> open(DRes<SInt> secretShare, int outputParty); @Override void reset(); @Override Map<String, Long> getLoggedValues(); static final String ARITHMETIC_BASIC_MULT; static final String ARITHMETIC_BASIC_ADD; static final String ARITHMETIC_BASIC_SUB; static final String ARITHMETIC_BASIC_BIT; static final String ARITHMETIC_BASIC_RAND; }
@Test public void mult() { DRes<SInt> firstArgument = mock(DRes.class); DRes<SInt> secondArgument = mock(DRes.class); decorator.mult(firstArgument, secondArgument); verify(delegate, times(1)).mult(firstArgument, secondArgument); }
@Test public void testMult() { BigInteger firstArgument = mock(BigInteger.class); DRes<SInt> secondArgument = mock(DRes.class); decorator.mult(firstArgument, secondArgument); verify(delegate, times(1)).mult(firstArgument, secondArgument); }