Verifies: SYS-REQ-006 [example] STK-REQ-004:AC-1:acceptance MCDC SYS-REQ-006: addressed_array_is_empty=F, addressed_array_is_well_formed=T, array_callback_receives_elements_in_order=F => FALSE MCDC SYS-REQ-006: addressed_array_is_empty=F, addressed_array_is_well_formed=T, array_callback_receives_ele
(t *testing.T)
| 1632 | // MCDC SYS-REQ-006: addressed_array_is_empty=F, addressed_array_is_well_formed=T, array_callback_receives_elements_in_order=F => FALSE |
| 1633 | // MCDC SYS-REQ-006: addressed_array_is_empty=F, addressed_array_is_well_formed=T, array_callback_receives_elements_in_order=T => TRUE |
| 1634 | func TestArrayEach(t *testing.T) { |
| 1635 | mock := []byte(`{"a": { "b":[{"x": 1} ,{"x":2},{ "x":3}, {"x":4} ]}}`) |
| 1636 | count := 0 |
| 1637 | |
| 1638 | ArrayEach(mock, func(value []byte, dataType ValueType, offset int, err error) { |
| 1639 | count++ |
| 1640 | |
| 1641 | switch count { |
| 1642 | case 1: |
| 1643 | if string(value) != `{"x": 1}` { |
| 1644 | t.Errorf("Wrong first item: %s", string(value)) |
| 1645 | } |
| 1646 | case 2: |
| 1647 | if string(value) != `{"x":2}` { |
| 1648 | t.Errorf("Wrong second item: %s", string(value)) |
| 1649 | } |
| 1650 | case 3: |
| 1651 | if string(value) != `{ "x":3}` { |
| 1652 | t.Errorf("Wrong third item: %s", string(value)) |
| 1653 | } |
| 1654 | case 4: |
| 1655 | if string(value) != `{"x":4}` { |
| 1656 | t.Errorf("Wrong forth item: %s", string(value)) |
| 1657 | } |
| 1658 | default: |
| 1659 | t.Errorf("Should process only 4 items") |
| 1660 | } |
| 1661 | }, "a", "b") |
| 1662 | } |
| 1663 | |
| 1664 | // Verifies: SYS-REQ-029 [boundary] |
| 1665 | // MCDC SYS-REQ-029: addressed_array_is_well_formed=F, malformed_array_input_returns_error=T => TRUE |
nothing calls this directly
no test coverage detected