From: Piotr T. <pi...@ta...> - 2012-01-23 17:06:47
|
It might have been fixed in the 2.0 branch. Test: https://cobertura.svn.sourceforge.net/svnroot/cobertura/branches/ptab_v2_0/ Piotr On Sat, Jan 7, 2012 at 7:00 AM, Roger Binns <ro...@ro...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I have a switch statement on a byte value. 39 of the values are handled > while the rest go to a default arm (which happens to throw an exception) > as they are invalid. > > Cobertura reports 19% coverage (40 of 203). However this is done even > when I test all possible byte values. It would seem that Cobertura is > counting the distinct switch values rather than distinct targets. > > This is the javap output with some obvious bits elided. > > 73: iload_1 > 74: tableswitch{ //0 to 201 > 0: 5628; > 1: 1903; > 2: 1502; > 3: 2267; > 4: 2657; > 5: 2657; > 6: 2657; > 7: 4620; > 8: 4897; > 9: 5834; > 10: 5465; > 11: 1041; > 12: 2875; > 13: 4814; > 14: 2939; > 15: 3318; > 16: 1371; > 17: 1270; > 18: 1137; > 19: 896; > 20: 5950; > 21: 1137; > 22: 1137; > 23: 5127; > 24: 4952; > 25: 4988; > 26: 2657; > 27: 2167; > 28: 4050; > 29: 4278; > 30: 2437; > 31: 2657; > 32: 2657; > 33: 3807; > 34: 5089; > 35: 5950; > 36: 5950; > ... same up to 124 ... > 124: 5950; > 125: 5950; > 126: 5950; > 127: 5950; > 128: 5434; > 129: 898; > 130: 906; > 131: 937; > 132: 992; > 133: 992; > 134: 5950; > 135: 5950; > ... same up to 158 ... > 158: 5950; > 159: 5950; > 160: 1180; > 161: 5285; > 162: 1112; > 163: 5361; > 164: 4531; > 165: 5950; > 166: 5950; > ... same up to 198 ... > 198: 5950; > 199: 5950; > 200: 1054; > 201: 1077; > default: 5950 } > > Roger > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (GNU/Linux) > > iEYEARECAAYFAk8H35sACgkQmOOfHg372QQy5gCfYtUWPXCy67nrn7SUkHg1aqQd > nUgAnjvmK616B3nc5U5es18QqP5p/WxE > =TXWe > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel -- Pozdrawiam, Piotr Tabor |