@@ -23,12 +23,12 @@ namespace bitstream::test::example
2323 BS_TEST_ASSERT (writer.serialize_bits (value, 5 ));
2424
2525 // Flush the writer's remaining state into the buffer
26- uint32_t num_bytes = writer.flush ();
26+ uint32_t num_bits = writer.flush ();
2727
28- BS_TEST_ASSERT_OPERATION (num_bytes , == , 1 );
28+ BS_TEST_ASSERT_OPERATION (num_bits , == , 5 );
2929
3030 // Create a reader, referencing the buffer and bytes written
31- bit_reader reader (buffer, num_bytes );
31+ bit_reader reader (buffer, num_bits );
3232
3333 // Read the value back
3434 uint32_t out_value; // We don't have to initialize it yet
@@ -49,12 +49,12 @@ namespace bitstream::test::example
4949 BS_TEST_ASSERT (writer.serialize <int32_t >(value, -90 , 40 )); // A lower and upper bound which the value will be quantized between
5050
5151 // Flush the writer's remaining state into the buffer
52- uint32_t num_bytes = writer.flush ();
52+ uint32_t num_bits = writer.flush ();
5353
54- BS_TEST_ASSERT_OPERATION (num_bytes , <= , 4 );
54+ BS_TEST_ASSERT_OPERATION (num_bits , <= , 32 );
5555
5656 // Create a reader by moving and invalidating the writer
57- bit_reader reader (buffer, num_bytes );
57+ bit_reader reader (buffer, num_bits );
5858
5959 // Read the value back
6060 int32_t out_value; // We don't have to initialize it yet
@@ -75,10 +75,10 @@ namespace bitstream::test::example
7575 BS_TEST_ASSERT (writer.serialize <const char *>(value, 32U )); // The second argument is the maximum size we expect the string to be
7676
7777 // Flush the writer's remaining state into the buffer
78- uint32_t num_bytes = writer.flush ();
78+ uint32_t num_bits = writer.flush ();
7979
8080 // Create a reader by moving and invalidating the writer
81- bit_reader reader (buffer, num_bytes );
81+ bit_reader reader (buffer, num_bits );
8282
8383 // Read the value back
8484 char out_value[32 ]; // Set the size to the max size
@@ -99,10 +99,10 @@ namespace bitstream::test::example
9999 BS_TEST_ASSERT (writer.serialize <std::string>(value, 32U )); // The second argument is the maximum size we expect the string to be
100100
101101 // Flush the writer's remaining state into the buffer
102- uint32_t num_bytes = writer.flush ();
102+ uint32_t num_bits = writer.flush ();
103103
104104 // Create a reader by moving and invalidating the writer
105- bit_reader reader (buffer, num_bytes );
105+ bit_reader reader (buffer, num_bits );
106106
107107 // Read the value back
108108 std::string out_value; // The string will be resized if the output doesn't fit
@@ -124,12 +124,12 @@ namespace bitstream::test::example
124124 writer.serialize <bounded_range>(range, value);
125125
126126 // Flush the writer's remaining state into the buffer
127- uint32_t num_bytes = writer.flush ();
127+ uint32_t num_bits = writer.flush ();
128128
129- BS_TEST_ASSERT_OPERATION (num_bytes , <= , 4 );
129+ BS_TEST_ASSERT_OPERATION (num_bits , <= , 32 );
130130
131131 // Create a reader by moving and invalidating the writer
132- bit_reader reader (buffer, num_bytes );
132+ bit_reader reader (buffer, num_bits );
133133
134134 // Read the value back
135135 float out_value;
0 commit comments