update tag name length max to 128

This commit is contained in:
hxy7yx
2024-01-30 17:44:25 +08:00
parent d11ae338ab
commit c0ea9d15fe
2 changed files with 28 additions and 2 deletions
+1 -1
View File
@@ -31,7 +31,7 @@
#define NEU_GET_VERSION_FIX(V) ((0x000000ff & V))
#define NEU_VERSION(MAJOR, MINOR, FIX) ((MAJOR << 16) | (MINOR << 8) | FIX)
#define NEU_TAG_NAME_LEN 64
#define NEU_TAG_NAME_LEN 128
#define NEU_TAG_ADDRESS_LEN 128
#define NEU_TAG_DESCRIPTION_LEN 128
#define NEU_GROUP_MAX_PER_NODE 512
+27 -1
View File
@@ -457,4 +457,30 @@ class TestLog:
)
assert 409 == response.status_code
assert NEU_ERR_TAG_NAME_CONFLICT == response.json()['error']
assert NEU_ERR_TAG_NAME_CONFLICT == response.json()['error']
@description(given="tag name length exceeds 128", when="adding", then="add failed")
def test_adding_tag_name_exceeds_128(self):
response = api.add_gtags(
node='modbus-tcp-tag-test',
groups=[{"group": "group","interval": 3000,
"tags": [{
"name": "Lt7Pa5Q0tKJN2gL3WiYJLnaFzqBq5q5xyJ1vYHxyf2j0IZR7y3RBYxXGQBHwV7dEzD7lIcF1yX9aR3vH8leYxXxHUILk2eVqQBlaQLaROZt9yZ9xQNxKkfy5mySHb79",
"address": "1!400001",
"attribute": 3,
"type": 3,
"decimal": 0.01}]}])
assert 200 == response.status_code
assert NEU_ERR_SUCCESS == response.json()['error']
response = api.add_gtags(
node='modbus-tcp-tag-test',
groups=[{"group": "group","interval": 3000,
"tags": [{
"name": "Lt7Pa5Q0tKJN2gL3WiYJLnaFzqBq5q5xyJ1vYHxyf2j0IZR7y3RBYxXGQBHwV7dEzD7lIcF1yX9aR3vH8leYxXxHUILk2eVqQBlaQLaROZt9yZ9xQNxKkfy5mySHb79Y8",
"address": "1!400001",
"attribute": 3,
"type": 3,
"decimal": 0.01}]}])
assert 400 == response.status_code
assert NEU_ERR_TAG_NAME_TOO_LONG == response.json()['error']