Omer Frenkel has posted comments on this change. Change subject: engine : Math operations on SizeConverter converted sizes ......................................................................
Patch Set 2: (2 comments) https://gerrit.ovirt.org/#/c/36315/2/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/SizeConverter.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/SizeConverter.java: Line 11: Line 12: public static final long BYTES_IN_KB = 1024L; Line 13: public static final long BYTES_IN_MB = 1024L * 1024L; Line 14: public static final long BYTES_IN_GB = 1024L * 1024L * 1024L; Line 15: public static final long BYTES_IN_TB = 1024L * 1024L * 1024L * 1024L; i would do BYTES_IN_GB * 1024L Line 16: Line 17: public SizeConverter() { Line 18: Line 19: } https://gerrit.ovirt.org/#/c/36315/2/backend/manager/modules/common/src/test/java/org/ovirt/engine/core/common/utils/SizeConverterTest.java File backend/manager/modules/common/src/test/java/org/ovirt/engine/core/common/utils/SizeConverterTest.java: Line 49: assertEquals(gigabytes, 3); Line 50: } Line 51: Line 52: @Test Line 53: public void testConvertBytestoMB() { no need for a test to 'converToTB' ? Line 54: long bytes = 3160000L; Line 55: int megabytes = SizeConverter.convert(bytes, SizeConverter.SizeUnit.BYTES, Line 56: SizeConverter.SizeUnit.MB).intValue(); Line 57: assertEquals(megabytes, 3); -- To view, visit https://gerrit.ovirt.org/36315 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9fd4e7b7b9411cf17d66037e6424a979c2d037f Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: anmolbabu <anb...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Ramesh N <rnach...@redhat.com> Gerrit-Reviewer: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: anmolbabu <anb...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches