Commit 238b49f3 authored by Francis Dupont's avatar Francis Dupont

[65-libyang-option-data] Addressed last comments (test doc and example)

parent 971938d0
...@@ -35,7 +35,8 @@ public: ...@@ -35,7 +35,8 @@ public:
virtual ~TranslatorOptionDataListTest() { } virtual ~TranslatorOptionDataListTest() { }
}; };
// Test get empty option data list. // This test verifies that an empty option data list can be properly
// translated from YANG to JSON.
TEST_F(TranslatorOptionDataListTest, getEmpty) { TEST_F(TranslatorOptionDataListTest, getEmpty) {
useModel("kea-dhcp4-server"); useModel("kea-dhcp4-server");
...@@ -48,7 +49,8 @@ TEST_F(TranslatorOptionDataListTest, getEmpty) { ...@@ -48,7 +49,8 @@ TEST_F(TranslatorOptionDataListTest, getEmpty) {
EXPECT_EQ(0, options->size()); EXPECT_EQ(0, options->size());
} }
// Test get one option data. // This test verifies that one option data can be properly translated
// from YANG to JSON.
TEST_F(TranslatorOptionDataListTest, get) { TEST_F(TranslatorOptionDataListTest, get) {
useModel("kea-dhcp6-server"); useModel("kea-dhcp6-server");
...@@ -80,7 +82,8 @@ TEST_F(TranslatorOptionDataListTest, get) { ...@@ -80,7 +82,8 @@ TEST_F(TranslatorOptionDataListTest, get) {
EXPECT_TRUE(option->equals(*options->get(0))); EXPECT_TRUE(option->equals(*options->get(0)));
} }
// Test set empty option data list. // This test verifies that an empty option data list can be properly
// translated from JSON to YANG.
TEST_F(TranslatorOptionDataListTest, setEmpty) { TEST_F(TranslatorOptionDataListTest, setEmpty) {
useModel("kea-dhcp4-server"); useModel("kea-dhcp4-server");
...@@ -96,7 +99,8 @@ TEST_F(TranslatorOptionDataListTest, setEmpty) { ...@@ -96,7 +99,8 @@ TEST_F(TranslatorOptionDataListTest, setEmpty) {
EXPECT_EQ(0, options->size()); EXPECT_EQ(0, options->size());
} }
// Test set an option data. // This test verifies that one option data can be properly translated
// from JSON to YANG.
TEST_F(TranslatorOptionDataListTest, set) { TEST_F(TranslatorOptionDataListTest, set) {
useModel("kea-dhcp6-server"); useModel("kea-dhcp6-server");
......
...@@ -42,6 +42,29 @@ namespace yang { ...@@ -42,6 +42,29 @@ namespace yang {
// +--rw always-send? boolean // +--rw always-send? boolean
// +--rw user-context? string // +--rw user-context? string
// @endcode // @endcode
//
// An example in JSON and YANG formats:
// @code
// [
// {
// "code": 100,
// "space": "dns",
// "csv-format": false,
// "data": "12121212",
// "always-send": false
// }
// ]
// @endcode
// @code
// /kea-dhcp6-server:config (container)
// /kea-dhcp6-server:config/option-data-list (container)
// /kea-dhcp6-server:config/option-data-list/option-data (list instance)
// /kea-dhcp6-server:config/option-data-list/option-data/code = 100
// /kea-dhcp6-server:config/option-data-list/option-data/space = dns
// /kea-dhcp6-server:config/option-data-list/option-data/data = 12121212
// /kea-dhcp6-server:config/option-data-list/option-data/csv-format = false
// /kea-dhcp6-server:config/option-data-list/option-data/always-send = false
// @endcode
class TranslatorOptionData : virtual public TranslatorBasic { class TranslatorOptionData : virtual public TranslatorBasic {
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment