Skip to content

Commit 765f0fb

Browse files
committed
Remove deprecated Point APIs marked for removal (#165)
1 parent 447971e commit 765f0fb

File tree

4 files changed

+0
-83
lines changed

4 files changed

+0
-83
lines changed

include/Point.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ namespace influxdb
6262
return this->addField(name, std::string{value});
6363
}
6464

65-
/// Generates current timestamp
66-
/// \deprecated Will be removed in v0.8.0
67-
[[deprecated("getCurrentTimestamp() will be removed in v0.8.0")]] static auto getCurrentTimestamp() -> decltype(std::chrono::system_clock::now());
68-
69-
/// Converts point to Influx Line Protocol
70-
/// \deprecated Will be removed in v0.8.0
71-
[[deprecated("toLineProtocol() will be removed in v0.8.0")]] std::string toLineProtocol() const;
72-
7365
/// Sets custom timestamp
7466
Point&& setTimestamp(std::chrono::time_point<std::chrono::system_clock> timestamp);
7567

src/Point.cxx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
///
2727

2828
#include "Point.h"
29-
#include "LineProtocol.h"
3029
#include <chrono>
3130
#include <memory>
3231
#include <sstream>
@@ -78,17 +77,6 @@ namespace influxdb
7877
return std::move(*this);
7978
}
8079

81-
auto Point::getCurrentTimestamp() -> decltype(std::chrono::system_clock::now())
82-
{
83-
return std::chrono::system_clock::now();
84-
}
85-
86-
std::string Point::toLineProtocol() const
87-
{
88-
LineProtocol formatter;
89-
return formatter.format(*this);
90-
}
91-
9280
std::string Point::getName() const
9381
{
9482
return mMeasurement;

test/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ function(add_unittest name)
3030
endfunction()
3131

3232
add_unittest(PointTest DEPENDS InfluxDB)
33-
target_compile_options(PointTest PRIVATE $<$<NOT:$<BOOL:${MSVC}>>:-Wno-deprecated-declarations>)
34-
3533
add_unittest(LineProtocolTest DEPENDS InfluxDB InfluxDB-Internal)
3634
add_unittest(InfluxDBTest DEPENDS InfluxDB)
3735
add_unittest(InfluxDBFactoryTest DEPENDS InfluxDB)

test/PointTest.cxx

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ namespace influxdb::test
2929
{
3030
using namespace Catch::Matchers;
3131

32-
namespace
33-
{
34-
constexpr std::chrono::time_point<std::chrono::system_clock> ignoreTimestamp(std::chrono::milliseconds(1230));
35-
}
36-
3732
TEST_CASE("Empty measurement", "[PointTest]")
3833
{
3934
const Point point{"test"};
@@ -186,60 +181,4 @@ namespace influxdb::test
186181
const auto point3 = Point{"test"}.addField("float_field", 1.23456789E-6);
187182
CHECK_THAT(point3.getFields(), Equals("float_field=0.00000"));
188183
}
189-
190-
TEST_CASE("Line protocol of empty measurement", "[PointTest]")
191-
{
192-
const auto point = Point{"test"}.setTimestamp(ignoreTimestamp);
193-
CHECK_THAT(point.toLineProtocol(), Equals("test 1230000000"));
194-
}
195-
196-
TEST_CASE("Line protocol of measurement with value", "[PointTest]")
197-
{
198-
const auto point = Point{"test"}.addField("x", "y").setTimestamp(ignoreTimestamp);
199-
CHECK_THAT(point.toLineProtocol(), Equals(R"(test x="y" 1230000000)"));
200-
}
201-
202-
TEST_CASE("Line protocol of measurement with multiple values", "[PointTest]")
203-
{
204-
const auto point = Point{"test"}
205-
.addField("int_field", 12)
206-
.addField("longlong_field", 123456790LL)
207-
.addField("string_field", "str")
208-
.addField("double_field", 1.81)
209-
.addField("bool_true_field", true)
210-
.addField("bool_false_field", false)
211-
.addField("uint_field", std::numeric_limits<unsigned int>::max())
212-
.addField("ulonglong_field", std::numeric_limits<unsigned long long int>::max())
213-
.setTimestamp(ignoreTimestamp);
214-
215-
CHECK_THAT(point.toLineProtocol(), Equals("test int_field=12i,"
216-
"longlong_field=123456790i,"
217-
"string_field=\"str\","
218-
"double_field=1.81000,"
219-
"bool_true_field=true,"
220-
"bool_false_field=false,"
221-
"uint_field=4294967295u,"
222-
"ulonglong_field=18446744073709551615u 1230000000"));
223-
}
224-
225-
TEST_CASE("Line protocol of measurement with tag", "[PointTest]")
226-
{
227-
const auto point = Point{"test"}
228-
.addField("v", 3)
229-
.addTag("t0", "tv0")
230-
.setTimestamp(ignoreTimestamp);
231-
CHECK_THAT(point.toLineProtocol(), Equals(R"(test,t0=tv0 v=3i 1230000000)"));
232-
}
233-
234-
TEST_CASE("Line protocol of measurement with multiple tags", "[PointTest]")
235-
{
236-
const auto point = Point{"test"}
237-
.addField("v", 3)
238-
.addTag("t0", "tv0")
239-
.addTag("t1", "tv1")
240-
.addTag("t2", "tv2")
241-
.setTimestamp(ignoreTimestamp);
242-
CHECK_THAT(point.toLineProtocol(), Equals(R"(test,t0=tv0,t1=tv1,t2=tv2 v=3i 1230000000)"));
243-
}
244-
245184
}

0 commit comments

Comments
 (0)