Fix BitBufferHelper::toNumber() 90/77990/6
authorStephen Kitt <skitt@redhat.com>
Tue, 20 Nov 2018 16:04:48 +0000 (17:04 +0100)
committerArunprakash D <d.arunprakash@ericsson.com>
Thu, 24 Jan 2019 08:34:35 +0000 (08:34 +0000)
commit774fe046a797d5152d94fc36094af188d8de9100
tree2ee1789b14871568c828c7ea52716de87f317e68
parent77e089feaf71f325ffc5082d00fa493567b02c49
Fix BitBufferHelper::toNumber()

Static analysis suggested that toNumber() was incorrect (there was a
redundant write to value). Adding test cases to the UT showed that
this was the case; this patch adds the new test cases and fixes
toNumber(). It also switches assertTrue() to assertEquals() where
appropriate and cleans up a number of redundant initialisers.

Change-Id: Ia31bc91bd63f2f406dfc2d9194bf0ae4c4274055
Signed-off-by: Stephen Kitt <skitt@redhat.com>
libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/BitBufferHelper.java
libraries/liblldp/src/test/java/org/opendaylight/openflowplugin/libraries/liblldp/BitBufferHelperTest.java [moved from libraries/liblldp/src/test/java/org/opendaylight/openflowplugin/libraries/sal/packet/BitBufferHelperTest.java with 55% similarity]