emkornfield commented on a change in pull request #7817:
URL: https://github.com/apache/arrow/pull/7817#discussion_r463915338
##########
File path:
java/vector/src/test/java/org/apache/arrow/vector/TestValueVector.java
##########
@@ -2977,4 +2977,47 @@ public void testEmptyBufBehavior() {
assertEquals(0, vector.getOffsetBuffer().capacity());
}
}
+
+ @Test
+ public void testSetGetUInt1() {
+ try (UInt1Vector vector = new UInt1Vector("vector", allocator)) {
+ vector.allocateNew(2);
+
+ vector.setWithPossibleTruncate(0, 0xffL);
+ vector.setUnsafeWithPossibleTruncate(1, 0xffL);
+ vector.setValueCount(2);
+
+ assertEquals(255, vector.getValueAsLong(0));
+ assertEquals(255, vector.getValueAsLong(1));
+ }
+ }
+
+ @Test
+ public void testSetGetUInt2() {
+ try (UInt2Vector vector = new UInt2Vector("vector", allocator)) {
+ vector.allocateNew(2);
+
+ vector.setWithPossibleTruncate(0, 0xffffL);
Review comment:
Is there a constant someplace (or can this be moved to a constant on
Uint8 vector) to better indicating you are using MAX_INT.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]