Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb83289

Browse files
author
Federico Fissore
committed
Testing that prototype of a function containing a typename is not generated
Signed-off-by: Federico Fissore <f.fissore@arduino.cc>
1 parent830f8f2 commitbb83289

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

‎src/arduino.cc/builder/test/prototypes_adder_test.go‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,3 +658,43 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) {
658658
require.Equal(t,"#include <Arduino.h>\n#line 1\n",context[constants.CTX_INCLUDE_SECTION].(string))
659659
require.Equal(t,"void ciao();\nvoid setup();\nvoid loop();\n#line 3\n",context[constants.CTX_PROTOTYPE_SECTION].(string))
660660
}
661+
662+
funcTestPrototypesAdderSketchWithTypename(t*testing.T) {
663+
DownloadCoresAndToolsAndLibraries(t)
664+
665+
context:=make(map[string]interface{})
666+
667+
buildPath:=SetupBuildPath(t,context)
668+
deferos.RemoveAll(buildPath)
669+
670+
context[constants.CTX_HARDWARE_FOLDERS]= []string{filepath.Join("..","hardware"),"hardware","downloaded_hardware"}
671+
context[constants.CTX_TOOLS_FOLDERS]= []string{"downloaded_tools"}
672+
context[constants.CTX_FQBN]="arduino:avr:leonardo"
673+
context[constants.CTX_SKETCH_LOCATION]=filepath.Join("sketch_with_typename","sketch.ino")
674+
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION]="10600"
675+
context[constants.CTX_LIBRARIES_FOLDERS]= []string{"libraries","downloaded_libraries"}
676+
context[constants.CTX_VERBOSE]=true
677+
678+
commands:= []types.Command{
679+
&builder.SetupHumanLoggerIfMissing{},
680+
681+
&builder.ContainerSetupHardwareToolsLibsSketchAndProps{},
682+
683+
&builder.ContainerMergeCopySketchFiles{},
684+
685+
&builder.ContainerFindIncludes{},
686+
687+
&builder.PrintUsedLibrariesIfVerbose{},
688+
&builder.WarnAboutArchIncompatibleLibraries{},
689+
690+
&builder.ContainerAddPrototypes{},
691+
}
692+
693+
for_,command:=rangecommands {
694+
err:=command.Run(context)
695+
NoError(t,err)
696+
}
697+
698+
require.Equal(t,"#include <Arduino.h>\n#line 1\n",context[constants.CTX_INCLUDE_SECTION].(string))
699+
require.Equal(t,"void setup();\nvoid loop();\n#line 6\n",context[constants.CTX_PROTOTYPE_SECTION].(string))
700+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp