I could not send it to the mailing list, so I'm resending it.
___
Hi Aleksander,

I have tested your patch.
I have confirmed that the coverage improves
to the expected value(69.8%->80.1%)
Your patch looks good to me.

## test and make coverage

source: commit 9a45a89c38f3257b13e09edf382e32fa28b918c2 (HEAD)

./configure --enable-coverage --enable-tap-tests --with-llvm CFLAGS=-O0
make check-world
make coverage-html

## Proposal to add a test for the set_masklen function

I think we could add the following test to
further improve the coverage.

Adding the following cases to the set_masklen()
test would further improve coverage.
* netmask = -1
* netmask > maxvalue(33 when ipv4)

```
-- check to treat netmask as maximum value when -1
SELECT set_masklen(cidr(text(c)), -1) FROM INET_TBL;
set_masklen
--------------------
192.168.1.0/32
192.168.1.0/32
192.168.1.0/32
192.168.1.0/32
192.168.1.0/32
192.168.1.0/32
10.0.0.0/32
10.0.0.0/32
10.1.2.3/32
10.1.2.0/32
10.1.0.0/32
10.0.0.0/32
10.0.0.0/32
10.0.0.0/32
10:23::f1/128
10:23::8000/128
::ffff:1.2.3.4/128
(17 rows)

-- check that rejects invalid netmask
SELECT set_masklen(inet(text(i)), 33) FROM INET_TBL;
ERROR: invalid mask length: 33
SELECT set_masklen(cidr(text(c)), 33) FROM INET_TBL;
ERROR: invalid mask length: 33
```

This would increase coverage from 80.1% to 80.5%.
The improvement value is small, but it would
be worth adding. What do you think?

As a side note,
the macaddr/macaddr8 type processing
in the convert_network_to_scalar() does not seem
to be testing. This is related to
the macaddr/macaddr8 type histograms and do not
appear to work in a simple test.
This should be considered for another time.

Best Regards,
Keisuke Kuroda
NTT Comware


Reply via email to