Skip to content

Commit

Permalink
borken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed May 19, 2024
1 parent 1934257 commit 7035ef7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion include/prometheus_gauge_populator.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@

#include <prometheus/gauge.h>

#include <gmock/gmock.h>

namespace gr::prometheus {

/// This block takes a float as an input and writes in into a prometheus gauge
class PrometheusGaugePopulator : virtual public block {
class PrometheusGaugePopulator : public block {
private:
/// the prometheus gauge we are populating with this block
::prometheus::Gauge& gauge_;
Expand All @@ -23,6 +25,7 @@ class PrometheusGaugePopulator : virtual public block {

int general_work(int noutput_items, gr_vector_int& ninput_items, gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items) override;

};

} // namespace gr::prometheus
Expand Down
8 changes: 3 additions & 5 deletions test/prometheus_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ TEST(config /*unused*/, CreatingPrometheusServer/*unused*/) {
auto& stream_signal_strength = signal_strength.Add(
{{"frequency", std::to_string(2.0)}, {"name", "test"}});

auto populator = PrometheusGaugePopulatorMock::make(/*gauge=*/stream_signal_strength);
testing::NiceMock<PrometheusGaugePopulatorMock> populator{/*gauge=*/stream_signal_strength};
EXPECT_CALL(populator, consume_each);

int noutput_items = 1;
gr_vector_int ninput_items;
Expand All @@ -47,16 +48,13 @@ TEST(config /*unused*/, CreatingPrometheusServer/*unused*/) {
input_items[0] = &vec;
gr_vector_void_star output_items;

populator->general_work(noutput_items, ninput_items, input_items, output_items);
populator.general_work(noutput_items, ninput_items, input_items, output_items);

std::cout << name << std::endl;
for (auto x : labels) {
std::cout << x.first << "/" << x.second << std::endl;
}




/*EXPECT_EQ(slice.center_frequency_, 1000);
EXPECT_EQ(slice.frequency_range_.lower_bound(), 900);
EXPECT_EQ(slice.frequency_range_.upper_bound(), 1100);
Expand Down

0 comments on commit 7035ef7

Please sign in to comment.