aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ByteBufferTest.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/ByteBufferTest.cpp b/test/ByteBufferTest.cpp
index f8190c5..9f26971 100644
--- a/test/ByteBufferTest.cpp
+++ b/test/ByteBufferTest.cpp
@@ -8,12 +8,12 @@
using namespace std;
-static void checkBuffer(const ByteBuffer& buffer, size_t size, size_t cursor) {
+static void checkBuffer(const ByteBuffer& buffer, size_t size, size_t position) {
if (false) {
- cout << "size=" << buffer.getSize() << ", cursor=" << buffer.getCursor();
+ cout << "size=" << buffer.getSize() << ", position=" << buffer.getPosition();
}
BOOST_CHECK_EQUAL(buffer.getSize(), size);
- BOOST_CHECK_EQUAL(buffer.getCursor(), cursor);
+ BOOST_CHECK_EQUAL(buffer.getPosition(), position);
}
class Bytes {
@@ -70,13 +70,13 @@ BOOST_AUTO_TEST_CASE(setCursor) {
BOOST_CHECK_EQUAL(buffer.read8(), 0);
checkBuffer(buffer, 1000, 1);
- buffer.setCursor(0);
+ buffer.setPosition(0);
checkBuffer(buffer, 1000, 0);
BOOST_CHECK_EQUAL(buffer.read8(), 0);
checkBuffer(buffer, 1000, 1);
- buffer.setCursor(9);
+ buffer.setPosition(9);
checkBuffer(buffer, 1000, 9);
}
@@ -85,13 +85,13 @@ BOOST_AUTO_TEST_CASE(view) {
ByteBuffer buffer(b.bytes, b.capacity);
BOOST_CHECK_EQUAL(buffer.read8(), 0);
- ByteBuffer view1 = buffer.viewRest();
+ ByteBuffer view1 = buffer.viewCursorToEnd();
checkBuffer(view1, 999, 0);
BOOST_CHECK_EQUAL(view1.read8(), 1);
BOOST_CHECK_EQUAL(view1.read8(), 2);
- ByteBuffer view2 = view1.viewRest();
+ ByteBuffer view2 = view1.viewCursorToEnd();
checkBuffer(view2, 997, 0);
BOOST_CHECK_EQUAL(view1.read8(), 3);
@@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE(ieee_11073_20601_float_1_0d) {
ByteBuffer buffer(b.bytes, b.capacity);
buffer.writeFLOAT(1.0);
- buffer.setCursor(0);
+ buffer.setPosition(0);
BOOST_CHECK_EQUAL(buffer.readFLOAT(), 1.0);
}
@@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE(ieee_11073_20601_float_nan) {
BOOST_CHECK_EQUAL(std::isnan(stof("NaN")), true);
buffer.writeFLOAT(stof("NaN"));
- buffer.setCursor(0);
+ buffer.setPosition(0);
BOOST_CHECK_EQUAL(std::isnan(buffer.readFLOAT()), true);
}
@@ -120,7 +120,7 @@ void c(double input, uint32_t hx, double sigma = 0.00001) {
Bytes b(1000);
ByteBuffer buffer(b.bytes, b.capacity);
buffer.writeFLOAT(input);
- buffer.setCursor(0);
+ buffer.setPosition(0);
double output = buffer.readFLOAT();
stringstream str;