New test for another error case in DepositScriptAddress

On 14/09/14 22:19, Jimmy Song wrote:
> In waddrmgr/pool_test.go:
> 
>> +	defer tearDown()
>> +	if err := pool.CreateSeries(0, []string{pubKey0, pubKey1, pubKey2}, 2); err != nil {
>> +		t.Fatalf("Cannot creates series")
>> +	}
>> +
>> +	var err error
>> +	// Replace pool.manager.cryptoKeyScript with a fake one that has an Encrypt()
>> +	// method that always errors out. That should be caught and propagated as
>> +	// an ErrCrypto by DepositScriptAddress.
>> +	waddrmgr.RunWithReplacedCryptoKeyScript(
>> +		manager, &FailingToEncryptCryptoKey{}, func() {
>> +			_, err = pool.DepositScriptAddress(0, 0, uint32(1))
>> +		})
>> +
>> +	checkManagerError(t, "", err, waddrmgr.ErrCrypto)
>> +}
> 
> As I pointed out before, if err is nil, this is going to fail with
> "cannot convert nil to type waddrmgr.ManagerError" within

And as I replied to you before, it won't because checkManagerError()
uses the comma ok idiom, which accounts for that.

> checkManagerError. You will need to check for err's nilness beforehand
> and give the appropriate response. Also, if you're going to use
> checkManagerError, please pass in a testName instead of an empty string.

Why pass a test name when we already have the test function name, which
is printed to stdout together with the failure? The testName argument in
checkManagerError() is meant for table-driven tests, which is not the
case here. Using it here will just make the test name to be shown twice
in two different lines, which is useless.