From afba0fa335eb0a4ec92d5409e00de7c43f3dddd3 Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Sat, 14 Dec 2024 16:37:00 +0300 Subject: [PATCH] ... --- tests/adc_dev_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/adc_dev_test.cpp b/tests/adc_dev_test.cpp index 65fca3c..f665f18 100644 --- a/tests/adc_dev_test.cpp +++ b/tests/adc_dev_test.cpp @@ -107,16 +107,16 @@ int main() dev_t dev1("DEV1"); int attr1_val = 10; - // dev1.addAttribute(dev_t::attribute_t::makeArithAttr( - // "ATTR1", [&attr1_val]() { return attr1_val; }, [&attr1_val](const int& v) { attr1_val = v; })); dev1.addAttribute(dev_t::attribute_t::makeArithAttr( - "ATTR1", [&attr1_val]() { return attr1_val; }, [&attr1_val](const int& v) { attr1_val = v; }, + "ATTR1", [&attr1_val]() { return attr1_val; }, [&attr1_val](const int& v) { attr1_val = v; })); + dev1.addAttribute(dev_t::attribute_t::makeArithAttr( + "ATTR2", [&attr1_val]() { return attr1_val + 10; }, [&attr1_val](const int& v) { attr1_val = v; }, utils::AdcDefaultValueConverter<>::serialize)); devs.push_back({&dev1, {'D', '1'}}); serialized_t sn; - std::ranges::copy(std::string_view("ATTR1"), std::back_inserter(sn)); + std::ranges::copy(std::string_view("ATTR2"), std::back_inserter(sn)); devs[0].setAttr(sn, {'7', '7'}); auto r = getAttr(0, sn);