Skip to content

Commit

Permalink
Revise array xml unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bocchino committed Jun 20, 2023
1 parent eaa63c5 commit 5936681
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 43 deletions.
14 changes: 7 additions & 7 deletions compiler/tools/fpp-to-xml/test/array/ArrayEnum2ArrayAi.ref.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
ArrayEnum2ArrayAi.xml
Generated by fpp-to-xml
====================================================================== -->
<array name="ArrayEnum2">
<array namespace="N" name="ArrayEnum2">
<import_enum_type>ArrayEnumE2EnumAi.xml</import_enum_type>
<type>ArrayEnumE2</type>
<type>M::ArrayEnumE2</type>
<size>5</size>
<format>%s</format>
<default>
<value>ArrayEnumE2::A</value>
<value>ArrayEnumE2::A</value>
<value>ArrayEnumE2::A</value>
<value>ArrayEnumE2::A</value>
<value>ArrayEnumE2::A</value>
<value>M::ArrayEnumE2::A</value>
<value>M::ArrayEnumE2::A</value>
<value>M::ArrayEnumE2::A</value>
<value>M::ArrayEnumE2::A</value>
<value>M::ArrayEnumE2::A</value>
</default>
</array>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ArrayEnumE2EnumAi.xml
Generated by fpp-to-xml
====================================================================== -->
<enum name="ArrayEnumE2" serialize_type="I32" default="A">
<enum namespace="M" name="ArrayEnumE2" serialize_type="I32" default="A">
<item name="A" value="10"/>
<item name="B" value="20"/>
<item name="C" value="30"/>
Expand Down
4 changes: 2 additions & 2 deletions compiler/tools/fpp-to-xml/test/array/ArrayOK3ArrayAi.ref.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
ArrayOK3ArrayAi.xml
Generated by fpp-to-xml
====================================================================== -->
<array name="ArrayOK3">
<array namespace="M2" name="ArrayOK3">
<type size="80">string</type>
<size>2</size>
<format>%s</format>
<default>
<value>"\"\\"</value>
<value>"abc\ndef"</value>
<value>"abc\ndef\n"</value>
</default>
</array>
10 changes: 5 additions & 5 deletions compiler/tools/fpp-to-xml/test/array/ArrayOK4ArrayAi.ref.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Generated by fpp-to-xml
<comment>
Array with array arg
</comment>
<type>ArrayOK3</type>
<type>M2::ArrayOK3</type>
<size>4</size>
<format>%s</format>
<default>
<value>ArrayOK3("\"\\", "abc\ndef")</value>
<value>ArrayOK3("\"\\", "abc\ndef")</value>
<value>ArrayOK3("\"\\", "abc\ndef")</value>
<value>ArrayOK3("\"\\", "abc\ndef")</value>
<value>M2::ArrayOK3("\"\\", "abc\ndef\n")</value>
<value>M2::ArrayOK3("\"\\", "abc\ndef\n")</value>
<value>M2::ArrayOK3("\"\\", "abc\ndef\n")</value>
<value>M2::ArrayOK3("\"\\", "abc\ndef\n")</value>
</default>
</array>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ArrayOK5ArrayAi.xml
Generated by fpp-to-xml
====================================================================== -->
<array name="ArrayOK5">
<array namespace="M4" name="ArrayOK5">
<include_header>T.hpp</include_header>
<type>T</type>
<size>3</size>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
BuiltInTypeArrayAi.xml
Generated by fpp-to-xml
====================================================================== -->
<array name="BuiltInType">
<array namespace="M" name="BuiltInType">
<type>FwOpcodeType</type>
<size>3</size>
<format>%s</format>
Expand Down
18 changes: 10 additions & 8 deletions compiler/tools/fpp-to-xml/test/array/array_enum.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ module M {
Z = 9
}

}
enum ArrayEnumE2 {
A = 10
B = 20
C = 30
D = 40
}

enum ArrayEnumE2 {
A = 10
B = 20
C = 30
D = 40
}

module N {

array ArrayEnum1 = [2] M.ArrayEnumE1 @< Array with enum argument
}

array ArrayEnum2 = [5] ArrayEnumE2
array ArrayEnum2 = [5] M.ArrayEnumE2

}
19 changes: 12 additions & 7 deletions compiler/tools/fpp-to-xml/test/array/array_ok.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@ module M1 {
}

module M2 {

array ArrayOK2 = [3] M1.ArrayOK1
}

array ArrayOK3 = [2] string default ["\"\\", """
abc
def
"""]
array ArrayOK3 = [2] string default ["\"\\", """
abc
def
"""]
}
module M3 {
array ArrayOK4 = [4] ArrayOK3 @< Array with array arg
array ArrayOK4 = [4] M2.ArrayOK3 @< Array with array arg
}
type T
array ArrayOK5 = [3] T
module M4 {
array ArrayOK5 = [3] T
}
6 changes: 5 additions & 1 deletion compiler/tools/fpp-to-xml/test/array/built_in_type.fpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
type FwOpcodeType

array BuiltInType = [3] FwOpcodeType
module M {

array BuiltInType = [3] FwOpcodeType

}
10 changes: 0 additions & 10 deletions compiler/tools/fpp-to-xml/test/array/check-xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
export COMPILER_ROOT=$PWD/../../../..

skip_xml_names="
BuiltInTypeArray
ArrayEnumE2Enum
ArrayEnum2Array
ArrayOK3Array
ArrayOK5Array
ArrayStruct1Array
"

Expand All @@ -18,11 +13,6 @@ done

skip_cpp_names="
BuiltInTypeArray
ArrayEnumE2Enum
ArrayEnum2Array
ArrayOK3Array
ArrayOK4Array
ArrayOK5Array
ArrayStruct1Array
"

Expand Down

0 comments on commit 5936681

Please sign in to comment.