Ember+ loadable plugin
Source
{"-context10Err", fields{}, args{asn1.NewDecoder([]byte{}), 10}, &Element{}, asn1.NewDecoder(nil), true},
/*
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
package ember
import (
"testing"
"github.com/google/go-cmp/cmp"
"golang.zabbix.com/plugin/ember-plus/ember/asn1"
)
func TestElement_handleApplication(t *testing.T) {
t.Parallel()
type fields struct {
ElementType ElementType
}
type args struct {
decoder *asn1.Decoder
}
tests := []struct {
name string
fields fields
args args
wantDecoder *asn1.Decoder
wantElements *Element
wantErr bool
}{
{
"+node",
fields{
ElementType: "node",
},
args{
asn1.NewDecoder(
[]byte{
0xA0, 0x03, 0x02, 0x01, 0x01, 0xA1, 0x27, 0x31, 0x25, 0xA0, 0x16, 0x0C, 0x14, 0x52, 0x33, 0x4C,
0x41, 0x59, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6C, 0x50, 0x61, 0x74, 0x63, 0x68, 0x42, 0x61,
0x79, 0xA1, 0x02, 0x0C, 0x00, 0xA4, 0x02, 0x0C, 0x00, 0xA3, 0x03, 0x01, 0x01, 0xFF,
},
),
},
asn1.NewDecoder([]byte{}),
&Element{
IsOnline: true,
Identifier: "R3LAYVirtualPatchBay",
Path: "1",
ElementType: "node",
},
false,
},
{
"+nodeEndless",
fields{
ElementType: "node",
},
args{
asn1.NewDecoder(
[]byte{
0xA0, 0x03, 0x02, 0x01, 0x03, 0xA1, 0x80, 0x31, 0x80, 0xA0, 0x0C, 0x0C, 0x0A, 0x43, 0x6F, 0x6D,
0x70, 0x72, 0x65, 0x73, 0x73, 0x6F, 0x72, 0xA3, 0x03, 0x01, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00,
},
),
},
asn1.NewDecoder([]byte{}),
&Element{
IsOnline: true,
Identifier: "Compressor",
Path: "3",
ElementType: "node",
},
false,
},
{
"+endlessAdditional",
fields{
ElementType: "node",