WillAyd commented on code in PR #276:
URL: https://github.com/apache/arrow-nanoarrow/pull/276#discussion_r1296384905


##########
src/nanoarrow/buffer_test.cc:
##########
@@ -271,6 +271,65 @@ TEST(BitmapTest, BitmapTestElement) {
   EXPECT_EQ(ArrowBitGet(bitmap, 16 + 7), 0);
 }
 
+TEST(BitmapTest, BitmapTestBitsGet) {
+  uint8_t bitmap[10];
+  int8_t result[sizeof(bitmap) * 8];
+
+  memset(bitmap, 0xff, sizeof(bitmap));
+  ArrowBitsGet(bitmap, 0, sizeof(result), result);
+  for (int i = 0; i < sizeof(result); i++) {
+    EXPECT_EQ(result[i], 1);
+  }
+
+  bitmap[2] = 0xfd;
+  ArrowBitsGet(bitmap, 0, sizeof(result), result);
+  EXPECT_EQ(result[16 + 0], 1);

Review Comment:
   Not sure if the newer test design is exactly what you are looking for from a 
readability perspective, but should definitely give better coverage



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to