aboutsummaryrefslogtreecommitdiff
path: root/test/ByteBufferTest.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-12-20 08:35:51 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2018-12-20 08:35:51 +0100
commitffa313e80a27005405334db6491075442f6e1abd (patch)
tree23a48c91cfc0810afe88cc6104d0667516fbd4a9 /test/ByteBufferTest.cpp
parentaf416f81b14a3bee682e300b165a6efdb9739d54 (diff)
downloadble-toys-master.tar.gz
ble-toys-master.tar.bz2
ble-toys-master.tar.xz
ble-toys-master.zip
o Using more natural byte ordering in the code. No external effect. o Using global ==, != and < operators instead of in-class operators for better compatibility with STL. ByteBuffer: o Renaming setPosition() to setCursor().
Diffstat (limited to 'test/ByteBufferTest.cpp')
-rw-r--r--test/ByteBufferTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ByteBufferTest.cpp b/test/ByteBufferTest.cpp
index 9f26971..7af18ef 100644
--- a/test/ByteBufferTest.cpp
+++ b/test/ByteBufferTest.cpp
@@ -70,13 +70,13 @@ BOOST_AUTO_TEST_CASE(setCursor) {
BOOST_CHECK_EQUAL(buffer.read8(), 0);
checkBuffer(buffer, 1000, 1);
- buffer.setPosition(0);
+ buffer.setCursor(0);
checkBuffer(buffer, 1000, 0);
BOOST_CHECK_EQUAL(buffer.read8(), 0);
checkBuffer(buffer, 1000, 1);
- buffer.setPosition(9);
+ buffer.setCursor(9);
checkBuffer(buffer, 1000, 9);
}
@@ -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.setPosition(0);
+ buffer.setCursor(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.setPosition(0);
+ buffer.setCursor(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.setPosition(0);
+ buffer.setCursor(0);
double output = buffer.readFLOAT();
stringstream str;