diff --git a/.gitignore b/.gitignore index 2640221e..3a98d318 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,38 @@ out/skm out/lib/ tools/scripts/nuget-pkg/obj tools/scripts/test/obj + + +### Test Generator Specific ### +# Generated test directories +**/splashkit-test-generator/**/bin +**/splashkit-test-generator/**/obj +**/splashkit-test-generator/**/target +**/splashkit-test-generator/**/output +**/splashkit-test-generator/**/logs +**/splashkit-test-generator/**/.cargo +**/splashkit-test-generator/**/TestResults +**/splashkit-test-generator/**/.pytest_cache +**/splashkit-test-generator/**/target +**/splashkit-test-generator/**/build +**/splashkit-test-generator/**/*.dylib +**/splashkit-test-generator/**/*.dll +**/splashkit-test-generator/**/*.so +**/generated_tests/**/tests + +# Generated test files +**/splashkit-test-generator/**/test +splashkit_test.* +test_main* +!test_main.pas +!test_main.cpp +link*res +lib.rs + +### Language Specific ### +*.o +*.ppu +*.log +__pycache__ +.pytest_cache +splashkit_test_generator.sln diff --git a/coresdk/src/test/splashkit-test-generator/README.md b/coresdk/src/test/splashkit-test-generator/README.md new file mode 100644 index 00000000..b73a3f27 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/README.md @@ -0,0 +1,106 @@ +# SplashKit Test Generator and Runner + +A testing framework for generating and running tests across multiple programming languages for the SplashKit SDK. + +## Supported Languages + +- C++ +- Python +- Pascal +- Rust +- C# + +## Prerequisites + +Before using the test generator and runner, ensure you have the following installed: + +- Ruby (for running the generator and test runner) +- SplashKit SDK +- Language-specific requirements: + - C++: g++ compiler and Catch2 testing framework + - Python: Python 3.x and pytest + - Pascal: Free Pascal Compiler (FPC) and FPCUnit + - Rust: Rust compiler and Cargo + - C#: .NET SDK + +## Installation Instructions + +1. Clone this repository +2. Install the required dependencies: + +## Usage + +### Test Generator + +Generate tests from API specification: + +ruby main.rb path/to/api.json + +### Test Runner + +You can run tests either by using command-line arguments or by editing main.rb directly. + +#### Command Line Usage + +Run all tests for a language +ruby main.rb -l cpp + +Run specific test group +ruby main.rb -l cpp -g animations + +Run single test +ruby main.rb -l cpp -g animations -t animation_count + +#### File Usage + +ruby main.rb --run-tests + +Run all tests for a language in run_tests: + +TestRunner.run_all_tests(:cpp) +TestRunner.run_all_tests(:python) +TestRunner.run_all_tests(:pascal) +TestRunner.run_all_tests(:rust) +TestRunner.run_all_tests(:csharp) + +Run specific test group: + +TestRunner.run_single_file(:cpp, 'animations') + +Run single test: + +TestRunner.run_specific_test(:cpp, 'animations', 'animation_count') + +## Test Types + +### Sequential Tests + +These tests run in sequence (not parallel): + +- audio +- animations +- windows +- graphics +- camera +- sprites +- physics +- timers + +### Manual Tests + +These tests require user interaction: + +- input +- interface +- terminal +- logging + +### Skipped Tests + +These tests are skipped by default (for now): + +- networking + +## Test Configuration + +Tests are defined in JSON files under `data/tests/`: diff --git a/coresdk/src/test/splashkit-test-generator/data/language_files/cpp/CMakeLists.txt b/coresdk/src/test/splashkit-test-generator/data/language_files/cpp/CMakeLists.txt new file mode 100644 index 00000000..0c2f0c7f --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/language_files/cpp/CMakeLists.txt @@ -0,0 +1,238 @@ +cmake_minimum_required(VERSION 3.5) +project(splashkit) + +cmake_policy(SET CMP0083 NEW) +include(CheckPIESupported) +check_pie_supported() + +# SK Directories relative to cmake project +set(SKCORE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../../") +get_filename_component(SKCORE_ROOT "${SKCORE_ROOT}" ABSOLUTE) +set(SK_SRC "${SKCORE_ROOT}/coresdk/src") +set(SK_EXT "${SKCORE_ROOT}/coresdk/external") +set(SK_LIB "${SKCORE_ROOT}/coresdk/lib") +set(SK_OUT "${SKCORE_ROOT}/out") +set(SK_BIN "${SKCORE_ROOT}/bin") +set(SK_CLIB "${SKCORE_ROOT}/generated/clib") +set(SK_GEN_CPP "${SKCORE_ROOT}/generated/cpp") +set(BASE_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib") + +if (WIN32 OR MSYS OR MINGW) + SET(MSYS "true") + add_definitions(-DWINDOWS) +endif() + +# Check for Raspberry Pi +include(CheckIncludeFile) +find_path(BCM_HOST_INCLUDE_DIR bcm_host.h PATHS "/opt/vc/include") +#### SETUP #### +if (APPLE) + # MAC OS PROJECT FLAGS + add_link_options("-Wl-U,___darwin_check_fd_set_overflow") + set(LIB_FLAGS "-L${SK_LIB}/mac \ + -framework IOKit \ + -framework ForceFeedback \ + -framework CoreFoundation \ + -framework Metal \ + -framework Cocoa \ + -framework Carbon \ + -framework AudioUnit \ + -framework AudioToolbox \ + -framework CoreAudio \ + -framework CoreVideo \ + -lSDL2 \ + -lSDL2_mixer \ + -lSDL2_ttf \ + -lSDL2_gfx \ + -lSDL2_image \ + -lSDL2_net \ + -lpthread \ + -lbz2 \ + -lFLAC \ + -lvorbis \ + -lz \ + -lpng16 \ + -lvorbisfile \ + -logg \ + -lwebp \ + -lcurl \ + -liconv \ + -ldl") +# WINDOWS PROJECT FLAGS +elseif(MSYS) + string(COMPARE EQUAL "MINGW32" "$ENV{MSYSTEM}" MINGW32) + string(COMPARE EQUAL "MINGW64" "$ENV{MSYSTEM}" MINGW64) + + if (${MINGW32}) + message("Using mingw32") + set(OS_PATH_SUFFIX "win32") + set(MINGW_PATH_PART "mingw32") + elseif (${MINGW64}) + message("Using mingw64") + set(OS_PATH_SUFFIX "win64") + set(MINGW_PATH_PART "mingw64") + else ( ) + message(SEND_ERROR "Failed to detect windows architecture") + return () + endif() + + find_package(PkgConfig REQUIRED) + pkg_check_modules(SDL2 REQUIRED sdl2 sdl2_ttf sdl2_image sdl2_net sdl2_mixer sdl2_gfx libpng libcurl) + + set(LIB_FLAGS "-L${SK_LIB}/${OS_PATH_SUFFIX} \ + -L/${MINGW_PATH_PART}/lib \ + -L/usr/lib \ + ${SDL2_LDFLAGS} \ + -lSDL2main \ + -Wl,-Bdynamic \ + -lws2_32 \ + -lcivetweb") + +# LINUX PROJECT FLAGS +else() + set(LIB_FLAGS "-lSDL2 \ + -lSDL2_mixer \ + -lSDL2_ttf \ + -lSDL2_gfx \ + -lSDL2_image \ + -lSDL2_net \ + -lpthread \ + -lbz2 \ + -lFLAC \ + -lvorbis \ + -lz \ + -lpng16 \ + -lvorbisfile \ + -logg \ + -lwebp \ + -lfreetype \ + -lcurl \ + -ldl \ + -lstdc++fs") +endif() + +if (BCM_HOST_INCLUDE_DIR) + message("Raspberry Pi detected") + + find_path(pigpio_INCLUDE_DIR NAMES pigpio.h pigpiod_if.h pigpiod_if2.h HINTS /usr/include) + + # Find the pigpio libraries. + find_library(pigpio_LIBRARY NAMES libpigpio.so HINTS /usr/lib) + + find_library(pigpiod_if_LIBRARY NAMES libpigpiod_if.so HINTS /usr/lib) + find_library(pigpiod_if2_LIBRARY NAMES libpigpiod_if2.so HINTS /usr/lib) + if(pigpiod_if2_LIBRARY) + set(pigpiod_if_LIBRARY ${pigpiod_if2_LIBRARY}) + # target_link_libraries(SplashKitBackend ${LIB_FLAGS} pigpiod_if2) + endif() + + + + # Add necessary directories for Raspberry Pi + include_directories(/usr/include) + # target_link_libraries(/usr/lib) + # target_link_libraries(SplashKitBackend ${LIB_FLAGS} pigpio) + link_directories(/user/lib) + # include_directories("/opt/vc/include") + + # link_directories("/opt/vc/lib") + set(LIB_FLAGS "-lSDL2 \ + -lSDL2_mixer \ + -lSDL2_ttf \ + -lSDL2_gfx \ + -lSDL2_image \ + -lSDL2_net \ + -lpthread \ + -lbz2 \ + -lFLAC \ + -lvorbis \ + -lz \ + -lpng16 \ + -lvorbisfile \ + -logg \ + -lwebp \ + -lfreetype \ + -lcurl \ + -ldl \ + -lstdc++fs\ + -lpigpiod_if2") +# Add -Wall and -pthread options +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") + # Define RASPBERRY_PI + add_definitions(-DRASPBERRY_PI) +else() + message("Raspberry Pi not detected") +endif() + + +# FLAGS +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + +# SOURCE FILES (excluding test files) +file(GLOB SOURCE_FILES + "${SK_SRC}/coresdk/*.cpp" + "${SK_SRC}/backend/*.cpp" + "${SK_EXT}/civetweb/src/civetweb.c" + "${SK_EXT}/sqlite/sqlite3.c" + "${SK_EXT}/hash-library/*.cpp" + "${SK_EXT}/easyloggingpp/*.cc" + "${SK_EXT}/microui/src/*.c" + "${SK_CLIB}/*.cpp" + +) + +# SKSDK FILE INCLUDES +file(GLOB SPLASHKITCPP_SOURCE_FILES + "${SK_GEN_CPP}/*.cpp" +) + +# DIRECTORY INCLUDES +include_directories("${SK_SRC}") +include_directories("${SK_SRC}/coresdk") +include_directories("${SK_SRC}/backend") +include_directories("${SK_SRC}/test") +include_directories("${SK_EXT}/civetweb/include") +include_directories("${SK_EXT}/easyloggingpp") +include_directories("${SK_EXT}/hash-library") +include_directories("${SK_EXT}/json") +include_directories("${SK_EXT}/catch") +include_directories("${SK_EXT}/microui/src") +include_directories("${SK_CLIB}") +include_directories("${SK_GEN_CPP}") + +# MAC OS DIRECTORY INCLUDES +if (APPLE) + include_directories("${SK_EXT}/SDL/include") + include_directories("${SK_EXT}/SDL_gfx") + include_directories("${SK_EXT}/SDL_image") + include_directories("${SK_EXT}/SDL_mixer") + include_directories("${SK_EXT}/SDL_net") + include_directories("${SK_EXT}/SDL_ttf") + include_directories("${SK_EXT}/SDL_image/external/libpng-1.6.2") +endif() + +# MACRO DEFINITIONS # +add_definitions(-DELPP_THREAD_SAFE) + +#### END SETUP #### +#### SplashKitBackend SHARED LIBRARY #### +add_library(SplashKitBackend SHARED ${SOURCE_FILES} ${SPLASHKITCPP_SOURCE_FILES}) +target_link_libraries(SplashKitBackend ${LIB_FLAGS}) + +# Set output directory based on the operating system +if (APPLE) + set_target_properties(SplashKitBackend + PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${BASE_OUTPUT_DIR}/macos" + ) +elseif (WIN32) + set_target_properties(SplashKitBackend + PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${BASE_OUTPUT_DIR}/windows" + ) +else() + set_target_properties(SplashKitBackend + PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${BASE_OUTPUT_DIR}/linux" + ) +endif() diff --git a/coresdk/src/test/splashkit-test-generator/data/language_files/rust/Cargo.toml b/coresdk/src/test/splashkit-test-generator/data/language_files/rust/Cargo.toml new file mode 100644 index 00000000..857ad044 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/language_files/rust/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "splashkit_backend" +version = "0.1.0" +edition = "2021" + +[dependencies] +libc = "0.2" + +[build-dependencies] +cc = "1.0" + +[lib] +name = "splashkit_backend" +crate-type = ["rlib"] + +links = "SplashKitBackend" \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/data/language_files/rust/build.rs b/coresdk/src/test/splashkit-test-generator/data/language_files/rust/build.rs new file mode 100644 index 00000000..4465279a --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/language_files/rust/build.rs @@ -0,0 +1,25 @@ +use std::env; +use std::path::PathBuf; + +fn main() { + let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| String::from("/"))); + + let lib_path = manifest_dir + .parent() + .unwrap() + .join("cpp") + .join("lib") + .canonicalize() + .expect("Failed to get absolute lib path"); + + let search_path = match env::consts::OS { + "macos" => lib_path.join("macos"), + "linux" => lib_path.join("linux"), + "windows" => lib_path.join("win64"), + _ => panic!("Unsupported operating system") + }; + + println!("cargo:rustc-link-search=native={}", search_path.display()); + println!("cargo:rustc-link-lib=dylib=SplashKitBackend"); + println!("cargo:rerun-if-changed=build.rs"); +} \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/animations.json b/coresdk/src/test/splashkit-test-generator/data/tests/animations.json new file mode 100644 index 00000000..a07a535e --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/animations.json @@ -0,0 +1,3232 @@ +{ + "group": "animations", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "animation_script", + "function_name": "free_all_animation_scripts", + "args": [] + }, + { + "cleanup_type": "animation", + "function_name": "free_animation", + "args": [ + { + "type": "object", + "object_type": "animation", + "variable_name": "animation" + } + ] + } + ], + "tests": [ + { + "name": "animation_count", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 1" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "animation_count", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + } + } + } + ] + }, + { + "name": "animation_current_cell", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 2" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 1" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "animation_current_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + "value2": { + "type": "int", + "value": -1 + } + } + } + ] + }, + { + "name": "animation_current_vector", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 3" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 2" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "animation_current_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "current_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "current_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "current_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "animation_ended", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 4" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 3" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "animation_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + }, + { + "type": "loop", + "iterations": 50, + "loop_steps": [ + { + "type": "function", + "function_name": "update_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "animation_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "animation_entered_frame", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 5" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 4" + }, + { + "type": "string", + "value": "walkfront" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "update_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "float", + "value": 20.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "animation_entered_frame", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + }, + { + "type": "function", + "function_name": "update_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "animation_entered_frame", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "animation_frame_time", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 6" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 5" + }, + { + "type": "string", + "value": "walkfront" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "update_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "animation_frame_time", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "frame_time" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "frame_time" + }, + "value2": { + "type": "float", + "value": 0.0 + } + } + } + ] + }, + { + "name": "animation_index", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 7" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "animation_index", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + "value2": { + "type": "int", + "value": -1 + } + } + }, + + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -1 + }, + "value2": { + "type": "function", + "function_name": "animation_index", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + }, + { + "type": "string", + "value": "NonExistentAnimation" + } + ] + } + } + } + ] + }, + { + "name": "animation_name", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 8" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 6" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "anim_name" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "moonwalkback" + }, + "value2": { + "type": "variable", + "variable_name": "anim_name" + } + } + } + ] + }, + { + "name": "animation_script_name", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 9" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Script 9" + }, + "value2": { + "type": "function", + "function_name": "animation_script_name", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + } + ] + } + } + } + ] + }, + { + "name": "animation_script_named", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 10" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "animation_script_named", + "args": [ + { + "type": "string", + "value": "Test Script 10" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_script" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_script" + }, + "value2": { + "type": "variable", + "variable_name": "test_script" + } + } + } + ] + }, + { + "name": "assign_animation_with_script", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 11" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 7" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_with_script", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "variable", + "variable_name": "test_script" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation_with_script_and_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 12" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 8" + }, + { + "type": "string", + "value": "walkfront" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_with_script_and_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "variable", + "variable_name": "test_script" + }, + { + "type": "string", + "value": "walkleft" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkleft" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation_index_with_script", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 13" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 9" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_index_with_script", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "variable", + "variable_name": "test_script" + }, + { + "type": "int", + "value": 0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation_index_with_script_and_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 14" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 10" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_index_with_script_and_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "variable", + "variable_name": "test_script" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation_with_script_named", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 15" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 11" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "c++ compiler is choosing the assign_animation_with_sound overload instead of assign_animation_with_script_named" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_with_script_named", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "string", + "value": "Test Script 15" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation_with_script_named_and_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 16" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 12" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_with_script_named_and_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "string", + "value": "Test Script 16" + }, + { + "type": "string", + "value": "walkfront" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation_index", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 17" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 13" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_index", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "int", + "value": 0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation_index_with_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 18" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 14" + }, + { + "type": "string", + "value": "moonwalkback" + }, + { + "type": "bool", + "value": false + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_index_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 19" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 15" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "assign_animation_with_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 20" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 16" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "assign_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "string", + "value": "walkfront" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "create_animation_from_index_with_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 21" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation_from_index_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 17" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "bool", + "value": true + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_animation" + } + } + }, + + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "create_animation", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 22" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 18" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_animation" + } + } + }, + + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "moonwalkback" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "create_animation_with_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 23" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 19" + }, + { + "type": "string", + "value": "moonwalkback" + }, + { + "type": "bool", + "value": true + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_animation" + } + } + }, + + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "moonwalkback" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "create_animation_from_script_named", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 24" + }, + { + "type": "string", + "value": "kermit.txt" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation_from_script_named", + "args": [ + { + "type": "string", + "value": "Test Script 24" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_animation" + } + } + }, + + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "moonwalkback" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "create_animation_from_script_named_with_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 25" + }, + { + "type": "string", + "value": "kermit.txt" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation_from_script_named_with_sound", + "args": [ + { + "type": "string", + "value": "Test Script 25" + }, + { + "type": "string", + "value": "moonwalkback" + }, + { + "type": "bool", + "value": true + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_animation" + } + } + }, + + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "moonwalkback" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "free_all_animation_scripts", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 26" + }, + { + "type": "string", + "value": "kermit.txt" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 27" + }, + { + "type": "string", + "value": "kermit.txt" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 26" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 27" + } + ] + } + } + }, + { + "type": "function", + "function_name": "free_all_animation_scripts", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 26" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 27" + } + ] + } + } + } + ] + }, + { + "name": "free_animation", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 28" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 22" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "free_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "Should show Attempting to get name of invalid animation data. warning:" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "function", + "function_name": "animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "animation_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "free_animation_script", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 29" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_script" + } + } + }, + { + "type": "function", + "function_name": "free_animation_script", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + } + ] + }, + + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 29" + } + ] + } + } + } + ] + }, + { + "name": "free_animation_script_with_name", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 30" + }, + { + "type": "string", + "value": "kermit.txt" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 30" + } + ] + } + } + }, + { + "type": "function", + "function_name": "free_animation_script_with_name", + "args": [ + { + "type": "string", + "value": "Test Script 30" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 30" + } + ] + } + } + } + ] + }, + { + "name": "has_animation_named", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 31" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + }, + { + "type": "string", + "value": "walkfront" + } + ] + } + } + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "Should show No Animation with name warning:" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + }, + { + "type": "string", + "value": "NonExistentAnimation" + } + ] + } + } + } + ] + }, + { + "name": "has_animation_script", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 32" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 32" + } + ] + } + } + }, + { + "type": "function", + "function_name": "free_animation_script", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 32" + } + ] + } + } + } + ] + }, + { + "name": "load_animation_script", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 33" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_script" + } + } + }, + { + "type": "function", + "function_name": "animation_script_name", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + } + ], + "store_result": "script_name" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Script 33" + }, + "value2": { + "type": "variable", + "variable_name": "script_name" + } + } + }, + { + "type": "function", + "function_name": "free_animation_script", + "args": [ + { + "type": "variable", + "variable_name": "test_script" + } + ] + }, + + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 33" + } + ] + } + } + } + ] + }, + { + "name": "restart_animation", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 34" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 23" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "loop", + "iterations": 50, + "loop_steps": [ + { + "type": "function", + "function_name": "update_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "animation_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "anim_ended" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "anim_ended" + } + } + }, + { + "type": "function", + "function_name": "restart_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "animation_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "restart_animation_with_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 35" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 24" + }, + { + "type": "string", + "value": "moonwalkback" + }, + { + "type": "bool", + "value": true + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "update_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "restart_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 3 + }, + "value2": { + "type": "function", + "function_name": "animation_current_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "update_animation_percent_with_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 36" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 25" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "update_animation_percent_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "float", + "value": 0.5 + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "animation_frame_time", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + "value2": { + "type": "float", + "value": 0.0 + } + } + } + ] + }, + { + "name": "update_animation", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 37" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 26" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "update_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "animation_current_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + } + } + ] + }, + { + "name": "update_animation_percent", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 38" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_script", + "value": "Test Animation 27" + }, + { + "type": "string", + "value": "walkfront" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "update_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "float", + "value": 0.5 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "animation_frame_time", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + "value2": { + "type": "float", + "value": 0.0 + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/audio.json b/coresdk/src/test/splashkit-test-generator/data/tests/audio.json new file mode 100644 index 00000000..3be208f3 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/audio.json @@ -0,0 +1,3437 @@ +{ + "group": "audio", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "audio", + "function_name": "close_audio", + "args": [] + }, + { + "cleanup_type": "music", + "function_name": "free_all_music", + "args": [] + }, + { + "cleanup_type": "sound_effect", + "function_name": "free_all_sound_effects", + "args": [] + } + ], + "tests": [ + { + "name": "audio_ready", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "audio_ready", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "close_audio", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "audio_ready", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_audio", + "args": [] + } + ] + }, + { + "name": "open_audio", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "audio_ready", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_audio", + "args": [] + } + ] + }, + { + "name": "fade_music_in_named", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "fade_music_in_named", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "int", + "value": 1000 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "fade_music_in_named_with_times", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "fade_music_in_named_with_times", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 1000 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "fade_music_in", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "fade_music_in", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + }, + { + "type": "int", + "value": 1000 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "fade_music_in_with_times", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "fade_music_in_with_times", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 1000 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "fade_music_out", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "function", + "function_name": "fade_music_out", + "args": [ + { + "type": "int", + "value": 1000 + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 1500 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "free_all_music", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "test_music1" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "test_music2" + }, + { + "type": "string", + "value": "dancingFrog.wav" + } + ] + }, + { + "type": "function", + "function_name": "free_all_music", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_music", + "args": [ + { + "type": "string", + "value": "test_music1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_music", + "args": [ + { + "type": "string", + "value": "test_music2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_music", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "function", + "function_name": "free_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_music", + "args": [ + { + "type": "string", + "value": "Test Music" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_music", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_music", + "args": [ + { + "type": "string", + "value": "Test Music" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_music", + "args": [ + { + "type": "string", + "value": "Test Music" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "load_music", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_music" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_valid", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "music_filename", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "path_to_resource", + "args": [ + { + "type": "string", + "value": "magical_night.ogg" + }, + { + "type": "enum", + "enum_type": "resource_kind", + "value": "sound_resource" + } + ] + }, + "value2": { + "type": "function", + "function_name": "music_filename", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + } + } + } + ] + }, + { + "name": "music_name", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Music" + }, + "value2": { + "type": "function", + "function_name": "music_name", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + } + } + } + ] + }, + { + "name": "music_named", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "music_named", + "args": [ + { + "type": "string", + "value": "Test Music" + } + ], + "store_result": "named_music" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_music" + }, + "value2": { + "type": "variable", + "variable_name": "named_music" + } + } + } + ] + }, + { + "name": "music_playing", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "music_valid", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_valid", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "music_valid", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "music_volume", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "function", + "function_name": "set_music_volume", + "args": [ + { + "type": "double", + "value": 0.5 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.5 + }, + "value2": { + "type": "function", + "function_name": "music_volume", + "args": [] + } + } + } + ] + }, + { + "name": "pause_music", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "function", + "function_name": "pause_music", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "play_music_named", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music_named", + "args": [ + { + "type": "string", + "value": "Test Music" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "play_music_named_with_times", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music_named_with_times", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "int", + "value": 2 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "play_music", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "play_music_with_times", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music_with_times", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + }, + { + "type": "int", + "value": 2 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "play_music_with_times_and_volume", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music_with_times_and_volume", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + }, + { + "type": "int", + "value": 2 + }, + { + "type": "double", + "value": 0.75 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.75 + }, + "value2": { + "type": "function", + "function_name": "music_volume", + "args": [] + } + } + } + ] + }, + { + "name": "resume_music", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "function", + "function_name": "pause_music", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "resume_music", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "set_music_volume", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "function", + "function_name": "set_music_volume", + "args": [ + { + "type": "double", + "value": 0.5 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.5 + }, + "value2": { + "type": "function", + "function_name": "music_volume", + "args": [] + } + } + } + ] + }, + { + "name": "stop_music", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_music", + "args": [ + { + "type": "string", + "value": "Test Music" + }, + { + "type": "string", + "value": "magical_night.ogg" + } + ], + "store_result": "test_music" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "music", + "store_result": "cleanup_music" + }, + { + "type": "function", + "function_name": "play_music", + "args": [ + { + "type": "variable", + "variable_name": "test_music" + } + ] + }, + { + "type": "function", + "function_name": "stop_music", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "music_playing", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "fade_all_sound_effects_out", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound 1" + }, + { + "type": "string", + "value": "comedy_boing.wav" + } + ], + "store_result": "test_sound1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound 2" + }, + { + "type": "string", + "value": "comedy_boing.ogg" + } + ], + "store_result": "test_sound2" + }, + { + "type": "function", + "function_name": "play_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound1" + } + ] + }, + { + "type": "function", + "function_name": "play_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound2" + } + ] + }, + { + "type": "function", + "function_name": "fade_all_sound_effects_out", + "args": [ + { + "type": "int", + "value": 1000 + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 1500 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "fade_sound_effect_out", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "function", + "function_name": "fade_sound_effect_out", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + }, + { + "type": "int", + "value": 1000 + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 1500 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_all_sound_effects", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound 1" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound 2" + }, + { + "type": "string", + "value": "comedy_boing.ogg" + } + ] + }, + { + "type": "function", + "function_name": "free_all_sound_effects", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound 1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound 2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_sound_effect", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "function", + "function_name": "free_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_sound_effect", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "load_sound_effect", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sound" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "play_sound_effect_named", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "play_sound_effect_named_with_volume", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_named_with_volume", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "double", + "value": 0.75 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "play_sound_effect_named_with_times", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_named_with_times", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "int", + "value": 3 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "play_sound_effect_named_with_times_and_volume", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_named_with_times_and_volume", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "int", + "value": 2 + }, + { + "type": "double", + "value": 0.75 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "play_sound_effect", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "play_sound_effect_with_volume", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "breakdance.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_with_volume", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + }, + { + "type": "double", + "value": 0.75 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "play_sound_effect_with_times", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_with_times", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + }, + { + "type": "int", + "value": 3 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "play_sound_effect_with_times_and_volume", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_with_times_and_volume", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + }, + { + "type": "int", + "value": 2 + }, + { + "type": "double", + "value": 0.75 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sound_effect_filename", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "path_to_resource", + "args": [ + { + "type": "string", + "value": "SwinGameStart.wav" + }, + { + "type": "enum", + "enum_type": "resource_kind", + "value": "sound_resource" + } + ] + }, + "value2": { + "type": "function", + "function_name": "sound_effect_filename", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + } + } + } + ] + }, + { + "name": "sound_effect_name", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Sound" + }, + "value2": { + "type": "function", + "function_name": "sound_effect_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + } + } + } + ] + }, + { + "name": "sound_effect_named", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "sound_effect_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ], + "store_result": "named_sound" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_sound" + }, + "value2": { + "type": "variable", + "variable_name": "named_sound" + } + } + } + ] + }, + { + "name": "sound_effect_playing_named", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "stop_sound_effect_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sound_effect_playing", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "stop_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sound_effect_valid", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sound" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "stop_sound_effect_named", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + { + "type": "function", + "function_name": "stop_sound_effect_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "Test Sound" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "stop_sound_effect", + "steps": [ + { + "type": "function", + "function_name": "open_audio", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "audio", + "store_result": "cleanup_audio" + }, + { + "type": "function", + "function_name": "load_sound_effect", + "args": [ + { + "type": "string", + "value": "Test Sound" + }, + { + "type": "string", + "value": "SwinGameStart.wav" + } + ], + "store_result": "test_sound" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sound_effect", + "store_result": "cleanup_sound_effect" + }, + { + "type": "function", + "function_name": "play_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "function", + "function_name": "stop_sound_effect", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing", + "args": [ + { + "type": "variable", + "variable_name": "test_sound" + } + ] + }, + "value2": null + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/camera.json b/coresdk/src/test/splashkit-test-generator/data/tests/camera.json new file mode 100644 index 00000000..edffcfa2 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/camera.json @@ -0,0 +1,2354 @@ +{ + "group": "camera", + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "sprite", + "function_name": "free_all_sprites", + "args": [] + }, + { + "cleanup_type": "bitmap", + "function_name": "free_all_bitmaps", + "args": [] + } + ], + "tests": [ + { + "name": "camera_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 1" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "camera_position", + "args": [], + "store_result": "test_camera_position" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_camera_position", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_camera_position", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "camera_x", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 2" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_position", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "camera_x", + "args": [] + } + } + } + ] + }, + { + "name": "camera_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_position", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 200.0 + }, + "value2": { + "type": "function", + "function_name": "camera_y", + "args": [] + } + } + } + ] + }, + { + "name": "center_camera_on_vector", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 4" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 1" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 1" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "center_camera_on_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": -267.8606182336807 + }, + { + "type": "double", + "value": -161.69777810573578 + } + ] + }, + "value2": { + "type": "function", + "function_name": "camera_position", + "args": [] + } + } + } + ] + }, + { + "name": "center_camera_on", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 5" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 2" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 2" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "center_camera_on", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": -300.0 + }, + { + "type": "double", + "value": -200.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "camera_position", + "args": [] + } + } + } + ] + }, + { + "name": "move_camera_by_vector", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 6" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "move_camera_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "move_camera_by_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "camera_x", + "args": [] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "camera_y", + "args": [] + } + } + } + ] + }, + { + "name": "move_camera_by", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 7" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_camera_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "move_camera_by", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "camera_x", + "args": [] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "camera_y", + "args": [] + } + } + } + ] + }, + { + "name": "move_camera_to_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 8" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_camera_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "camera_position", + "args": [] + } + } + } + ] + }, + { + "name": "move_camera_to", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 9" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_camera_to", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "camera_x", + "args": [] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "camera_y", + "args": [] + } + } + } + ] + }, + { + "name": "point_in_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 10" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ] + } + } + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1000.0 + }, + { + "type": "double", + "value": 1000.0 + } + ], + "store_result": "test_point_outside" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_point_outside" + } + ] + } + } + } + ] + }, + { + "name": "point_on_screen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 11" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_on_screen", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + } + ] + } + } + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1000.0 + }, + { + "type": "double", + "value": 1000.0 + } + ], + "store_result": "test_point_outside" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_on_screen", + "args": [ + { + "type": "variable", + "variable_name": "test_point_outside" + } + ] + } + } + } + ] + }, + { + "name": "rect_in_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 12" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_x", + "args": [ + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "set_camera_y", + "args": [ + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "rect_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 1000.0 + }, + { + "type": "double", + "value": 1000.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle_outside" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "rect_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rectangle_outside" + } + ] + } + } + } + ] + }, + { + "name": "rect_on_screen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 13" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "rect_on_screen", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "function", + "function_name": "move_camera_to", + "args": [ + { + "type": "double", + "value": 1000.0 + }, + { + "type": "double", + "value": 1000.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "rect_on_screen", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "screen_center", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 14" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_x", + "args": [ + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "set_camera_y", + "args": [ + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "screen_center", + "args": [], + "store_result": "test_center" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 400.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_center", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 300.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_center", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "screen_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 15" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "screen_rectangle", + "args": [], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 800.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_rectangle", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 600.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_rectangle", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "set_camera_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 16" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_position", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "camera_position", + "args": [] + } + } + } + ] + }, + { + "name": "set_camera_x", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 17" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_x", + "args": [ + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "camera_x", + "args": [] + } + } + } + ] + }, + { + "name": "set_camera_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 18" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_y", + "args": [ + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "camera_y", + "args": [] + } + } + } + ] + }, + { + "name": "to_screen_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 19" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_position", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "to_screen_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ], + "store_result": "test_screen_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_screen_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_screen_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "to_screen_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 20" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "to_screen_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "screen_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "cast_to": "float", + "function_name": "to_screen_x", + "args": [ + { + "type": "double", + "value": 100.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "screen_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "cast_to": "float", + "function_name": "to_screen_y", + "args": [ + { + "type": "double", + "value": 100.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "screen_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "to_screen_x", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 21" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_x", + "args": [ + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "to_screen_x", + "args": [ + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_screen_x" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_screen_x" + } + } + } + ] + }, + { + "name": "to_screen_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 22" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_y", + "args": [ + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "to_screen_y", + "args": [ + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_screen_y" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_screen_y" + } + } + } + ] + }, + { + "name": "to_world", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 23" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_position", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "to_world", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ], + "store_result": "test_world_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 500.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_world_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 400.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_world_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "to_world_x", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 24" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_position", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "to_world_x", + "args": [ + { + "type": "double", + "value": 400.0 + } + ], + "store_result": "test_world_x" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 500.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_world_x" + } + } + } + ] + }, + { + "name": "to_world_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 25" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_camera_position", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "to_world_y", + "args": [ + { + "type": "double", + "value": 300.0 + } + ], + "store_result": "test_world_y" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 400.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_world_y" + } + } + } + ] + }, + { + "name": "vector_world_to_screen", + "steps": [ + { + "type": "function", + "function_name": "vector_world_to_screen", + "args": [], + "store_result": "test_vector1" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "test_vector1" + } + } + }, + { + "type": "function", + "function_name": "move_camera_to", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "vector_world_to_screen", + "args": [], + "store_result": "test_vector2" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": -100.0 + }, + { + "type": "double", + "value": -100.0 + } + ], + "store_result": "test_vector_to" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable_field", + "variable_name": "test_vector_to", + "variable_field": "x" + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector2", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable_field", + "variable_name": "test_vector_to", + "variable_field": "y" + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector2", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "window_area", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 26" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "window_area", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "test_area" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 800.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_area", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 600.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_area", + "variable_field": "height" + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/color.json b/coresdk/src/test/splashkit-test-generator/data/tests/color.json new file mode 100644 index 00000000..5f1e4b64 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/color.json @@ -0,0 +1,14545 @@ +{ + "group": "color", + "tests": [ + { + "name": "alpha_of", + "steps": [ + { + "type": "function", + "function_name": "color_red", + "args": [], + "store_result": "red_color" + }, + { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ], + "store_result": "alpha_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "variable", + "variable_name": "alpha_value" + } + } + }, + { + "type": "function", + "function_name": "color_transparent", + "args": [], + "store_result": "transparent_color" + }, + { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "transparent_color" + } + ], + "store_result": "alpha_value_transparent" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "variable", + "variable_name": "alpha_value_transparent" + } + } + } + ] + }, + { + "name": "blue_of", + "steps": [ + { + "type": "function", + "function_name": "color_blue", + "args": [], + "store_result": "blue_color" + }, + { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_color" + } + ], + "store_result": "blue_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "variable", + "variable_name": "blue_value" + } + } + }, + { + "type": "function", + "function_name": "color_red", + "args": [], + "store_result": "red_color" + }, + { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ], + "store_result": "blue_value_red" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "variable", + "variable_name": "blue_value_red" + } + } + } + ] + }, + { + "name": "brightness_of", + "steps": [ + { + "type": "function", + "function_name": "color_white", + "args": [], + "store_result": "white_color" + }, + { + "type": "function", + "function_name": "brightness_of", + "args": [ + { + "type": "variable", + "variable_name": "white_color" + } + ], + "store_result": "white_brightness" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "variable", + "variable_name": "white_brightness" + } + } + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "black_color" + }, + { + "type": "function", + "function_name": "brightness_of", + "args": [ + { + "type": "variable", + "variable_name": "black_color" + } + ], + "store_result": "black_brightness" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable", + "variable_name": "black_brightness" + } + } + }, + { + "type": "function", + "function_name": "color_gray", + "args": [], + "store_result": "gray_color" + }, + { + "type": "function", + "function_name": "brightness_of", + "args": [ + { + "type": "variable", + "variable_name": "gray_color" + } + ], + "store_result": "gray_brightness" + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "variable", + "variable_name": "gray_brightness" + }, + "value2": { + "type": "double", + "value": 0.4 + }, + "value3": { + "type": "double", + "value": 0.6 + } + } + } + ] + }, + { + "name": "color_alice_blue", + "steps": [ + { + "type": "function", + "function_name": "color_alice_blue", + "args": [], + "store_result": "alice_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "alice_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 248 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "alice_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "alice_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "alice_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_antique_white", + "steps": [ + { + "type": "function", + "function_name": "color_antique_white", + "args": [], + "store_result": "antique_white_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "antique_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 235 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "antique_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 215 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "antique_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "antique_white_color" + } + ] + } + } + } + ] + }, + { + "name": "color_aqua", + "steps": [ + { + "type": "function", + "function_name": "color_aqua", + "args": [], + "store_result": "aqua_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "aqua_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "aqua_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "aqua_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "aqua_color" + } + ] + } + } + } + ] + }, + { + "name": "color_aquamarine", + "steps": [ + { + "type": "function", + "function_name": "color_aquamarine", + "args": [], + "store_result": "aquamarine_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "aquamarine_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "aquamarine_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 212 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "aquamarine_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "aquamarine_color" + } + ] + } + } + } + ] + }, + { + "name": "color_azure", + "steps": [ + { + "type": "function", + "function_name": "color_azure", + "args": [], + "store_result": "azure_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "azure_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "azure_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "azure_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "azure_color" + } + ] + } + } + } + ] + }, + { + "name": "color_beige", + "steps": [ + { + "type": "function", + "function_name": "color_beige", + "args": [], + "store_result": "beige_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "beige_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "beige_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 220 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "beige_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "beige_color" + } + ] + } + } + } + ] + }, + { + "name": "color_bisque", + "steps": [ + { + "type": "function", + "function_name": "color_bisque", + "args": [], + "store_result": "bisque_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "bisque_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 228 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "bisque_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 196 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "bisque_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "bisque_color" + } + ] + } + } + } + ] + }, + { + "name": "color_black", + "steps": [ + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "black_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "black_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "black_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "black_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "black_color" + } + ] + } + } + } + ] + }, + { + "name": "color_blanched_almond", + "steps": [ + { + "type": "function", + "function_name": "color_blanched_almond", + "args": [], + "store_result": "blanched_almond_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "blanched_almond_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 235 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "blanched_almond_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "blanched_almond_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "blanched_almond_color" + } + ] + } + } + } + ] + }, + { + "name": "color_blue", + "steps": [ + { + "type": "function", + "function_name": "color_blue", + "args": [], + "store_result": "blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_blue_violet", + "steps": [ + { + "type": "function", + "function_name": "color_blue_violet", + "args": [], + "store_result": "blue_violet_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 138 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 43 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 226 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_violet_color" + } + ] + } + } + } + ] + }, + { + "name": "color_bright_green", + "steps": [ + { + "type": "function", + "function_name": "color_bright_green", + "args": [], + "store_result": "bright_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "bright_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "bright_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "bright_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "bright_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_brown", + "steps": [ + { + "type": "function", + "function_name": "color_brown", + "args": [], + "store_result": "brown_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 165 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 42 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 42 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "brown_color" + } + ] + } + } + } + ] + }, + { + "name": "color_burly_wood", + "steps": [ + { + "type": "function", + "function_name": "color_burly_wood", + "args": [], + "store_result": "burly_wood_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 222 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "burly_wood_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 184 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "burly_wood_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 135 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "burly_wood_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "burly_wood_color" + } + ] + } + } + } + ] + }, + { + "name": "color_cadet_blue", + "steps": [ + { + "type": "function", + "function_name": "color_cadet_blue", + "args": [], + "store_result": "cadet_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 95 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "cadet_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 158 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "cadet_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 160 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "cadet_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "cadet_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_chartreuse", + "steps": [ + { + "type": "function", + "function_name": "color_chartreuse", + "args": [], + "store_result": "chartreuse_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "chartreuse_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "chartreuse_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "chartreuse_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "chartreuse_color" + } + ] + } + } + } + ] + }, + { + "name": "color_chocolate", + "steps": [ + { + "type": "function", + "function_name": "color_chocolate", + "args": [], + "store_result": "chocolate_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 210 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "chocolate_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 105 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "chocolate_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 30 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "chocolate_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "chocolate_color" + } + ] + } + } + } + ] + }, + { + "name": "color_coral", + "steps": [ + { + "type": "function", + "function_name": "color_coral", + "args": [], + "store_result": "coral_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "coral_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "coral_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 80 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "coral_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "coral_color" + } + ] + } + } + } + ] + }, + { + "name": "color_cornflower_blue", + "steps": [ + { + "type": "function", + "function_name": "color_cornflower_blue", + "args": [], + "store_result": "cornflower_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "cornflower_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 149 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "cornflower_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 237 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "cornflower_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "cornflower_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_cornsilk", + "steps": [ + { + "type": "function", + "function_name": "color_cornsilk", + "args": [], + "store_result": "cornsilk_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "cornsilk_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 248 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "cornsilk_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 220 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "cornsilk_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "cornsilk_color" + } + ] + } + } + } + ] + }, + { + "name": "color_crimson", + "steps": [ + { + "type": "function", + "function_name": "color_crimson", + "args": [], + "store_result": "crimson_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 220 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "crimson_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "crimson_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 60 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "crimson_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "crimson_color" + } + ] + } + } + } + ] + }, + { + "name": "color_cyan", + "steps": [ + { + "type": "function", + "function_name": "color_cyan", + "args": [], + "store_result": "cyan_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "cyan_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_blue", + "steps": [ + { + "type": "function", + "function_name": "color_dark_blue", + "args": [], + "store_result": "dark_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_cyan", + "steps": [ + { + "type": "function", + "function_name": "color_dark_cyan", + "args": [], + "store_result": "dark_cyan_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_cyan_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_goldenrod", + "steps": [ + { + "type": "function", + "function_name": "color_dark_goldenrod", + "args": [], + "store_result": "dark_goldenrod_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 184 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 134 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 11 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_goldenrod_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_gray", + "steps": [ + { + "type": "function", + "function_name": "color_dark_gray", + "args": [], + "store_result": "dark_gray_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 169 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 169 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 169 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_gray_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_green", + "steps": [ + { + "type": "function", + "function_name": "color_dark_green", + "args": [], + "store_result": "dark_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_khaki", + "steps": [ + { + "type": "function", + "function_name": "color_dark_khaki", + "args": [], + "store_result": "dark_khaki_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 189 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_khaki_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 183 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_khaki_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 107 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_khaki_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_khaki_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_magenta", + "steps": [ + { + "type": "function", + "function_name": "color_dark_magenta", + "args": [], + "store_result": "dark_magenta_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_magenta_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_magenta_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_magenta_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_magenta_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_olive_green", + "steps": [ + { + "type": "function", + "function_name": "color_dark_olive_green", + "args": [], + "store_result": "dark_olive_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 85 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_olive_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 107 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_olive_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 47 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_olive_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_olive_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_orange", + "steps": [ + { + "type": "function", + "function_name": "color_dark_orange", + "args": [], + "store_result": "dark_orange_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_orange_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 140 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_orange_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_orange_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_orange_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_orchid", + "steps": [ + { + "type": "function", + "function_name": "color_dark_orchid", + "args": [], + "store_result": "dark_orchid_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 153 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 204 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_orchid_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_red", + "steps": [ + { + "type": "function", + "function_name": "color_dark_red", + "args": [], + "store_result": "dark_red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_red_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_salmon", + "steps": [ + { + "type": "function", + "function_name": "color_dark_salmon", + "args": [], + "store_result": "dark_salmon_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 233 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 150 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 122 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_salmon_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_sea_green", + "steps": [ + { + "type": "function", + "function_name": "color_dark_sea_green", + "args": [], + "store_result": "dark_sea_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 143 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 188 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_sea_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_slate_blue", + "steps": [ + { + "type": "function", + "function_name": "color_dark_slate_blue", + "args": [], + "store_result": "dark_slate_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 72 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 61 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_slate_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_slate_gray", + "steps": [ + { + "type": "function", + "function_name": "color_dark_slate_gray", + "args": [], + "store_result": "dark_slate_gray_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 47 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 79 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 79 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_slate_gray_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_turquoise", + "steps": [ + { + "type": "function", + "function_name": "color_dark_turquoise", + "args": [], + "store_result": "dark_turquoise_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 206 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 209 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_turquoise_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dark_violet", + "steps": [ + { + "type": "function", + "function_name": "color_dark_violet", + "args": [], + "store_result": "dark_violet_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 148 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 211 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dark_violet_color" + } + ] + } + } + } + ] + }, + { + "name": "color_deep_pink", + "steps": [ + { + "type": "function", + "function_name": "color_deep_pink", + "args": [], + "store_result": "deep_pink_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "deep_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "deep_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 147 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "deep_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "deep_pink_color" + } + ] + } + } + } + ] + }, + { + "name": "color_deep_sky_blue", + "steps": [ + { + "type": "function", + "function_name": "color_deep_sky_blue", + "args": [], + "store_result": "deep_sky_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "deep_sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 191 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "deep_sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "deep_sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "deep_sky_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dim_gray", + "steps": [ + { + "type": "function", + "function_name": "color_dim_gray", + "args": [], + "store_result": "dim_gray_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 105 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dim_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 105 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dim_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 105 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dim_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dim_gray_color" + } + ] + } + } + } + ] + }, + { + "name": "color_dodger_blue", + "steps": [ + { + "type": "function", + "function_name": "color_dodger_blue", + "args": [], + "store_result": "dodger_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 30 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "dodger_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 144 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "dodger_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "dodger_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "dodger_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_firebrick", + "steps": [ + { + "type": "function", + "function_name": "color_firebrick", + "args": [], + "store_result": "firebrick_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 178 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "firebrick_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 34 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "firebrick_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 34 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "firebrick_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "firebrick_color" + } + ] + } + } + } + ] + }, + { + "name": "color_floral_white", + "steps": [ + { + "type": "function", + "function_name": "color_floral_white", + "args": [], + "store_result": "floral_white_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "floral_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "floral_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "floral_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "floral_white_color" + } + ] + } + } + } + ] + }, + { + "name": "color_forest_green", + "steps": [ + { + "type": "function", + "function_name": "color_forest_green", + "args": [], + "store_result": "forest_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 34 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "forest_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "forest_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 34 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "forest_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "forest_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_fuchsia", + "steps": [ + { + "type": "function", + "function_name": "color_fuchsia", + "args": [], + "store_result": "fuchsia_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "fuchsia_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "fuchsia_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "fuchsia_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "fuchsia_color" + } + ] + } + } + } + ] + }, + { + "name": "color_gainsboro", + "steps": [ + { + "type": "function", + "function_name": "color_gainsboro", + "args": [], + "store_result": "gainsboro_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 220 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "gainsboro_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 220 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "gainsboro_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 220 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "gainsboro_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "gainsboro_color" + } + ] + } + } + } + ] + }, + { + "name": "color_ghost_white", + "steps": [ + { + "type": "function", + "function_name": "color_ghost_white", + "args": [], + "store_result": "ghost_white_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 248 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "ghost_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 248 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "ghost_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "ghost_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "ghost_white_color" + } + ] + } + } + } + ] + }, + { + "name": "color_gold", + "steps": [ + { + "type": "function", + "function_name": "color_gold", + "args": [], + "store_result": "gold_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "gold_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 215 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "gold_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "gold_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "gold_color" + } + ] + } + } + } + ] + }, + { + "name": "color_goldenrod", + "steps": [ + { + "type": "function", + "function_name": "color_goldenrod", + "args": [], + "store_result": "goldenrod_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 218 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 165 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 32 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "goldenrod_color" + } + ] + } + } + } + ] + }, + { + "name": "color_gray", + "steps": [ + { + "type": "function", + "function_name": "color_gray", + "args": [], + "store_result": "gray_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "gray_color" + } + ] + } + } + } + ] + }, + { + "name": "color_green", + "steps": [ + { + "type": "function", + "function_name": "color_green", + "args": [], + "store_result": "green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_green_yellow", + "steps": [ + { + "type": "function", + "function_name": "color_green_yellow", + "args": [], + "store_result": "green_yellow_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 173 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "green_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "green_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 47 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "green_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "green_yellow_color" + } + ] + } + } + } + ] + }, + { + "name": "color_honeydew", + "steps": [ + { + "type": "function", + "function_name": "color_honeydew", + "args": [], + "store_result": "honeydew_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "honeydew_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "honeydew_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "honeydew_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "honeydew_color" + } + ] + } + } + } + ] + }, + { + "name": "color_hot_pink", + "steps": [ + { + "type": "function", + "function_name": "color_hot_pink", + "args": [], + "store_result": "hot_pink_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "hot_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 105 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "hot_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 180 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "hot_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "hot_pink_color" + } + ] + } + } + } + ] + }, + { + "name": "color_indian_red", + "steps": [ + { + "type": "function", + "function_name": "color_indian_red", + "args": [], + "store_result": "indian_red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "indian_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 92 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "indian_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 92 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "indian_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "indian_red_color" + } + ] + } + } + } + ] + }, + { + "name": "color_indigo", + "steps": [ + { + "type": "function", + "function_name": "color_indigo", + "args": [], + "store_result": "indigo_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 75 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "indigo_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "indigo_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 130 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "indigo_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "indigo_color" + } + ] + } + } + } + ] + }, + { + "name": "color_ivory", + "steps": [ + { + "type": "function", + "function_name": "color_ivory", + "args": [], + "store_result": "ivory_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "ivory_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "ivory_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "ivory_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "ivory_color" + } + ] + } + } + } + ] + }, + { + "name": "color_khaki", + "steps": [ + { + "type": "function", + "function_name": "color_khaki", + "args": [], + "store_result": "khaki_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "khaki_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 230 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "khaki_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 140 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "khaki_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "khaki_color" + } + ] + } + } + } + ] + }, + { + "name": "color_lavender", + "steps": [ + { + "type": "function", + "function_name": "color_lavender", + "args": [], + "store_result": "lavender_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 230 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "lavender_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 230 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "lavender_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "lavender_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "lavender_color" + } + ] + } + } + } + ] + }, + { + "name": "color_lavender_blush", + "steps": [ + { + "type": "function", + "function_name": "color_lavender_blush", + "args": [], + "store_result": "lavender_blush_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "lavender_blush_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "lavender_blush_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "lavender_blush_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "lavender_blush_color" + } + ] + } + } + } + ] + }, + { + "name": "color_lawn_green", + "steps": [ + { + "type": "function", + "function_name": "color_lawn_green", + "args": [], + "store_result": "lawn_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 124 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "lawn_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 252 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "lawn_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "lawn_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "lawn_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_lemon_chiffon", + "steps": [ + { + "type": "function", + "function_name": "color_lemon_chiffon", + "args": [], + "store_result": "lemon_chiffon_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "lemon_chiffon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "lemon_chiffon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "lemon_chiffon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "lemon_chiffon_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_blue", + "steps": [ + { + "type": "function", + "function_name": "color_light_blue", + "args": [], + "store_result": "light_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 173 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 216 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 230 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_coral", + "steps": [ + { + "type": "function", + "function_name": "color_light_coral", + "args": [], + "store_result": "light_coral_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_coral_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_coral_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_coral_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_coral_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_cyan", + "steps": [ + { + "type": "function", + "function_name": "color_light_cyan", + "args": [], + "store_result": "light_cyan_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 224 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_cyan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_cyan_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_goldenrod_yellow", + "steps": [ + { + "type": "function", + "function_name": "color_light_goldenrod_yellow", + "args": [], + "store_result": "light_goldenrod_yellow_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_goldenrod_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_goldenrod_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 210 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_goldenrod_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_goldenrod_yellow_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_gray", + "steps": [ + { + "type": "function", + "function_name": "color_light_gray", + "args": [], + "store_result": "light_gray_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 211 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 211 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 211 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_gray_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_green", + "steps": [ + { + "type": "function", + "function_name": "color_light_green", + "args": [], + "store_result": "light_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 144 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 238 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 144 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_pink", + "steps": [ + { + "type": "function", + "function_name": "color_light_pink", + "args": [], + "store_result": "light_pink_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 182 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 193 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_pink_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_salmon", + "steps": [ + { + "type": "function", + "function_name": "color_light_salmon", + "args": [], + "store_result": "light_salmon_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 160 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 122 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_salmon_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_sea_green", + "steps": [ + { + "type": "function", + "function_name": "color_light_sea_green", + "args": [], + "store_result": "light_sea_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 32 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 178 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 170 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_sea_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_sky_blue", + "steps": [ + { + "type": "function", + "function_name": "color_light_sky_blue", + "args": [], + "store_result": "light_sky_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 135 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 206 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_sky_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_slate_gray", + "steps": [ + { + "type": "function", + "function_name": "color_light_slate_gray", + "args": [], + "store_result": "light_slate_gray_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 119 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 136 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 153 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_slate_gray_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_steel_blue", + "steps": [ + { + "type": "function", + "function_name": "color_light_steel_blue", + "args": [], + "store_result": "light_steel_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 176 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_steel_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 196 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_steel_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 222 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_steel_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_steel_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_light_yellow", + "steps": [ + { + "type": "function", + "function_name": "color_light_yellow", + "args": [], + "store_result": "light_yellow_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "light_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "light_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 224 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "light_yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "light_yellow_color" + } + ] + } + } + } + ] + }, + { + "name": "color_lime", + "steps": [ + { + "type": "function", + "function_name": "color_lime", + "args": [], + "store_result": "lime_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "lime_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "lime_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "lime_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "lime_color" + } + ] + } + } + } + ] + }, + { + "name": "color_lime_green", + "steps": [ + { + "type": "function", + "function_name": "color_lime_green", + "args": [], + "store_result": "lime_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "lime_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "lime_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "lime_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "lime_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_linen", + "steps": [ + { + "type": "function", + "function_name": "color_linen", + "args": [], + "store_result": "linen_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "linen_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 240 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "linen_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 230 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "linen_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "linen_color" + } + ] + } + } + } + ] + }, + { + "name": "color_magenta", + "steps": [ + { + "type": "function", + "function_name": "color_magenta", + "args": [], + "store_result": "magenta_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "magenta_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "magenta_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "magenta_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "magenta_color" + } + ] + } + } + } + ] + }, + { + "name": "color_maroon", + "steps": [ + { + "type": "function", + "function_name": "color_maroon", + "args": [], + "store_result": "maroon_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "maroon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "maroon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "maroon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "maroon_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_aquamarine", + "steps": [ + { + "type": "function", + "function_name": "color_medium_aquamarine", + "args": [], + "store_result": "medium_aquamarine_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 102 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_aquamarine_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_aquamarine_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 170 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_aquamarine_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_aquamarine_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_blue", + "steps": [ + { + "type": "function", + "function_name": "color_medium_blue", + "args": [], + "store_result": "medium_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_orchid", + "steps": [ + { + "type": "function", + "function_name": "color_medium_orchid", + "args": [], + "store_result": "medium_orchid_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 186 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 85 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 211 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_orchid_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_purple", + "steps": [ + { + "type": "function", + "function_name": "color_medium_purple", + "args": [], + "store_result": "medium_purple_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 147 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_purple_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 112 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_purple_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 219 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_purple_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_purple_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_sea_green", + "steps": [ + { + "type": "function", + "function_name": "color_medium_sea_green", + "args": [], + "store_result": "medium_sea_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 60 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 179 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 113 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_sea_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_slate_blue", + "steps": [ + { + "type": "function", + "function_name": "color_medium_slate_blue", + "args": [], + "store_result": "medium_slate_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 104 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 238 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_slate_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_spring_green", + "steps": [ + { + "type": "function", + "function_name": "color_medium_spring_green", + "args": [], + "store_result": "medium_spring_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_spring_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_spring_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 154 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_spring_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_spring_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_turquoise", + "steps": [ + { + "type": "function", + "function_name": "color_medium_turquoise", + "args": [], + "store_result": "medium_turquoise_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 72 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 209 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 204 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_turquoise_color" + } + ] + } + } + } + ] + }, + { + "name": "color_medium_violet_red", + "steps": [ + { + "type": "function", + "function_name": "color_medium_violet_red", + "args": [], + "store_result": "medium_violet_red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 199 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_violet_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 21 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_violet_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 133 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_violet_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "medium_violet_red_color" + } + ] + } + } + } + ] + }, + { + "name": "color_midnight_blue", + "steps": [ + { + "type": "function", + "function_name": "color_midnight_blue", + "args": [], + "store_result": "midnight_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 25 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "midnight_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 25 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "midnight_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 112 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "midnight_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "midnight_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_mint_cream", + "steps": [ + { + "type": "function", + "function_name": "color_mint_cream", + "args": [], + "store_result": "mint_cream_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "mint_cream_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "mint_cream_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "mint_cream_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "mint_cream_color" + } + ] + } + } + } + ] + }, + { + "name": "color_misty_rose", + "steps": [ + { + "type": "function", + "function_name": "color_misty_rose", + "args": [], + "store_result": "misty_rose_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "misty_rose_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 228 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "misty_rose_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 225 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "misty_rose_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "misty_rose_color" + } + ] + } + } + } + ] + }, + { + "name": "color_moccasin", + "steps": [ + { + "type": "function", + "function_name": "color_moccasin", + "args": [], + "store_result": "moccasin_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "moccasin_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 228 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "moccasin_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 181 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "moccasin_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "moccasin_color" + } + ] + } + } + } + ] + }, + { + "name": "color_navajo_white", + "steps": [ + { + "type": "function", + "function_name": "color_navajo_white", + "args": [], + "store_result": "navajo_white_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "navajo_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 222 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "navajo_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 173 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "navajo_white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "navajo_white_color" + } + ] + } + } + } + ] + }, + { + "name": "color_navy", + "steps": [ + { + "type": "function", + "function_name": "color_navy", + "args": [], + "store_result": "navy_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "navy_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "navy_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "navy_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "navy_color" + } + ] + } + } + } + ] + }, + { + "name": "color_old_lace", + "steps": [ + { + "type": "function", + "function_name": "color_old_lace", + "args": [], + "store_result": "old_lace_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 253 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "old_lace_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "old_lace_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 230 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "old_lace_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "old_lace_color" + } + ] + } + } + } + ] + }, + { + "name": "color_olive", + "steps": [ + { + "type": "function", + "function_name": "color_olive", + "args": [], + "store_result": "olive_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "olive_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "olive_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "olive_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "olive_color" + } + ] + } + } + } + ] + }, + { + "name": "color_olive_drab", + "steps": [ + { + "type": "function", + "function_name": "color_olive_drab", + "args": [], + "store_result": "olive_drab_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 107 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "olive_drab_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 142 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "olive_drab_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 35 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "olive_drab_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "olive_drab_color" + } + ] + } + } + } + ] + }, + { + "name": "color_orange", + "steps": [ + { + "type": "function", + "function_name": "color_orange", + "args": [], + "store_result": "orange_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "orange_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 165 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "orange_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "orange_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "orange_color" + } + ] + } + } + } + ] + }, + { + "name": "color_orange_red", + "steps": [ + { + "type": "function", + "function_name": "color_orange_red", + "args": [], + "store_result": "orange_red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "orange_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 69 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "orange_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "orange_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "orange_red_color" + } + ] + } + } + } + ] + }, + { + "name": "color_orchid", + "steps": [ + { + "type": "function", + "function_name": "color_orchid", + "args": [], + "store_result": "orchid_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 218 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 112 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 214 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "orchid_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "orchid_color" + } + ] + } + } + } + ] + }, + { + "name": "color_pale_goldenrod", + "steps": [ + { + "type": "function", + "function_name": "color_pale_goldenrod", + "args": [], + "store_result": "pale_goldenrod_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 238 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 232 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 170 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_goldenrod_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_goldenrod_color" + } + ] + } + } + } + ] + }, + { + "name": "color_pale_green", + "steps": [ + { + "type": "function", + "function_name": "color_pale_green", + "args": [], + "store_result": "pale_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 152 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 251 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 152 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_pale_turquoise", + "steps": [ + { + "type": "function", + "function_name": "color_pale_turquoise", + "args": [], + "store_result": "pale_turquoise_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 175 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 238 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 238 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_turquoise_color" + } + ] + } + } + } + ] + }, + { + "name": "color_pale_violet_red", + "steps": [ + { + "type": "function", + "function_name": "color_pale_violet_red", + "args": [], + "store_result": "pale_violet_red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 219 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_violet_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 112 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_violet_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 147 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_violet_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "pale_violet_red_color" + } + ] + } + } + } + ] + }, + { + "name": "color_papaya_whip", + "steps": [ + { + "type": "function", + "function_name": "color_papaya_whip", + "args": [], + "store_result": "papaya_whip_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "papaya_whip_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 239 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "papaya_whip_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 213 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "papaya_whip_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "papaya_whip_color" + } + ] + } + } + } + ] + }, + { + "name": "color_peach_puff", + "steps": [ + { + "type": "function", + "function_name": "color_peach_puff", + "args": [], + "store_result": "peach_puff_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "peach_puff_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 218 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "peach_puff_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 185 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "peach_puff_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "peach_puff_color" + } + ] + } + } + } + ] + }, + { + "name": "color_peru", + "steps": [ + { + "type": "function", + "function_name": "color_peru", + "args": [], + "store_result": "peru_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "peru_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 133 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "peru_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 63 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "peru_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "peru_color" + } + ] + } + } + } + ] + }, + { + "name": "color_pink", + "steps": [ + { + "type": "function", + "function_name": "color_pink", + "args": [], + "store_result": "pink_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 192 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 203 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "pink_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "pink_color" + } + ] + } + } + } + ] + }, + { + "name": "color_plum", + "steps": [ + { + "type": "function", + "function_name": "color_plum", + "args": [], + "store_result": "plum_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 221 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "plum_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 160 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "plum_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 221 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "plum_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "plum_color" + } + ] + } + } + } + ] + }, + { + "name": "color_powder_blue", + "steps": [ + { + "type": "function", + "function_name": "color_powder_blue", + "args": [], + "store_result": "powder_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 176 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "powder_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 224 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "powder_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 230 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "powder_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "powder_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_purple", + "steps": [ + { + "type": "function", + "function_name": "color_purple", + "args": [], + "store_result": "purple_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "purple_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "purple_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "purple_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "purple_color" + } + ] + } + } + } + ] + }, + { + "name": "color_red", + "steps": [ + { + "type": "function", + "function_name": "color_red", + "args": [], + "store_result": "red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + } + ] + }, + { + "name": "color_rosy_brown", + "steps": [ + { + "type": "function", + "function_name": "color_rosy_brown", + "args": [], + "store_result": "rosy_brown_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 188 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "rosy_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 143 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "rosy_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 143 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "rosy_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "rosy_brown_color" + } + ] + } + } + } + ] + }, + { + "name": "color_royal_blue", + "steps": [ + { + "type": "function", + "function_name": "color_royal_blue", + "args": [], + "store_result": "royal_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 65 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "royal_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 105 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "royal_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 225 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "royal_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "royal_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_saddle_brown", + "steps": [ + { + "type": "function", + "function_name": "color_saddle_brown", + "args": [], + "store_result": "saddle_brown_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "saddle_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 69 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "saddle_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 19 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "saddle_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "saddle_brown_color" + } + ] + } + } + } + ] + }, + { + "name": "color_salmon", + "steps": [ + { + "type": "function", + "function_name": "color_salmon", + "args": [], + "store_result": "salmon_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 114 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "salmon_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "salmon_color" + } + ] + } + } + } + ] + }, + { + "name": "color_sandy_brown", + "steps": [ + { + "type": "function", + "function_name": "color_sandy_brown", + "args": [], + "store_result": "sandy_brown_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 244 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "sandy_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 164 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "sandy_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 96 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "sandy_brown_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "sandy_brown_color" + } + ] + } + } + } + ] + }, + { + "name": "color_sea_green", + "steps": [ + { + "type": "function", + "function_name": "color_sea_green", + "args": [], + "store_result": "sea_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 46 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 139 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 87 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "sea_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "sea_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_sea_shell", + "steps": [ + { + "type": "function", + "function_name": "color_sea_shell", + "args": [], + "store_result": "sea_shell_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "sea_shell_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "sea_shell_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 238 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "sea_shell_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "sea_shell_color" + } + ] + } + } + } + ] + }, + { + "name": "color_sienna", + "steps": [ + { + "type": "function", + "function_name": "color_sienna", + "args": [], + "store_result": "sienna_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 160 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "sienna_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 82 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "sienna_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 45 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "sienna_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "sienna_color" + } + ] + } + } + } + ] + }, + { + "name": "color_silver", + "steps": [ + { + "type": "function", + "function_name": "color_silver", + "args": [], + "store_result": "silver_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 192 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "silver_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 192 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "silver_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 192 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "silver_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "silver_color" + } + ] + } + } + } + ] + }, + { + "name": "color_sky_blue", + "steps": [ + { + "type": "function", + "function_name": "color_sky_blue", + "args": [], + "store_result": "sky_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 135 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 206 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 235 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "sky_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "sky_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_slate_blue", + "steps": [ + { + "type": "function", + "function_name": "color_slate_blue", + "args": [], + "store_result": "slate_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 106 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 90 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "slate_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "slate_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_slate_gray", + "steps": [ + { + "type": "function", + "function_name": "color_slate_gray", + "args": [], + "store_result": "slate_gray_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 112 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 144 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "slate_gray_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "slate_gray_color" + } + ] + } + } + } + ] + }, + { + "name": "color_snow", + "steps": [ + { + "type": "function", + "function_name": "color_snow", + "args": [], + "store_result": "snow_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "snow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "snow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "snow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "snow_color" + } + ] + } + } + } + ] + }, + { + "name": "color_spring_green", + "steps": [ + { + "type": "function", + "function_name": "color_spring_green", + "args": [], + "store_result": "spring_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "spring_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "spring_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "spring_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "spring_green_color" + } + ] + } + } + } + ] + }, + { + "name": "color_steel_blue", + "steps": [ + { + "type": "function", + "function_name": "color_steel_blue", + "args": [], + "store_result": "steel_blue_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 70 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "steel_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 130 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "steel_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 180 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "steel_blue_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "steel_blue_color" + } + ] + } + } + } + ] + }, + { + "name": "color_swinburne_red", + "steps": [ + { + "type": "function", + "function_name": "color_swinburne_red", + "args": [], + "store_result": "swinburne_red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 237 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "swinburne_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 36 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "swinburne_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 25 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "swinburne_red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "swinburne_red_color" + } + ] + } + } + } + ] + }, + { + "name": "color_tan", + "steps": [ + { + "type": "function", + "function_name": "color_tan", + "args": [], + "store_result": "tan_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 210 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "tan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 180 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "tan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 140 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "tan_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "tan_color" + } + ] + } + } + } + ] + }, + { + "name": "color_teal", + "steps": [ + { + "type": "function", + "function_name": "color_teal", + "args": [], + "store_result": "teal_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "teal_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "teal_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "teal_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "teal_color" + } + ] + } + } + } + ] + }, + { + "name": "color_thistle", + "steps": [ + { + "type": "function", + "function_name": "color_thistle", + "args": [], + "store_result": "thistle_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 216 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "thistle_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 191 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "thistle_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 216 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "thistle_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "thistle_color" + } + ] + } + } + } + ] + }, + { + "name": "color_to_string", + "steps": [ + { + "type": "function", + "function_name": "color_red", + "args": [], + "store_result": "red_color" + }, + { + "type": "function", + "function_name": "color_to_string", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ], + "store_result": "red_color_string" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "#ff0000ff" + }, + "value2": { + "type": "variable", + "variable_name": "red_color_string" + } + } + }, + { + "type": "function", + "function_name": "color_transparent", + "args": [], + "store_result": "transparent_color" + }, + { + "type": "function", + "function_name": "color_to_string", + "args": [ + { + "type": "variable", + "variable_name": "transparent_color" + } + ], + "store_result": "transparent_color_string" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "#ffffffff" + }, + "value2": { + "type": "variable", + "variable_name": "transparent_color_string" + } + } + } + ] + }, + { + "name": "color_tomato", + "steps": [ + { + "type": "function", + "function_name": "color_tomato", + "args": [], + "store_result": "tomato_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "tomato_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 99 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "tomato_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 71 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "tomato_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "tomato_color" + } + ] + } + } + } + ] + }, + { + "name": "color_transparent", + "steps": [ + { + "type": "function", + "function_name": "color_transparent", + "args": [], + "store_result": "transparent_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "transparent_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "transparent_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "transparent_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "transparent_color" + } + ] + } + } + } + ] + }, + { + "name": "color_turquoise", + "steps": [ + { + "type": "function", + "function_name": "color_turquoise", + "args": [], + "store_result": "turquoise_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 64 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 224 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 208 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "turquoise_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "turquoise_color" + } + ] + } + } + } + ] + }, + { + "name": "color_violet", + "steps": [ + { + "type": "function", + "function_name": "color_violet", + "args": [], + "store_result": "violet_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 238 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 130 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 238 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "violet_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "violet_color" + } + ] + } + } + } + ] + }, + { + "name": "color_wheat", + "steps": [ + { + "type": "function", + "function_name": "color_wheat", + "args": [], + "store_result": "wheat_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "wheat_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 222 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "wheat_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 179 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "wheat_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "wheat_color" + } + ] + } + } + } + ] + }, + { + "name": "color_white", + "steps": [ + { + "type": "function", + "function_name": "color_white", + "args": [], + "store_result": "white_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "white_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "white_color" + } + ] + } + } + } + ] + }, + { + "name": "color_white_smoke", + "steps": [ + { + "type": "function", + "function_name": "color_white_smoke", + "args": [], + "store_result": "white_smoke_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "white_smoke_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "white_smoke_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 245 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "white_smoke_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "white_smoke_color" + } + ] + } + } + } + ] + }, + { + "name": "color_yellow", + "steps": [ + { + "type": "function", + "function_name": "color_yellow", + "args": [], + "store_result": "yellow_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "yellow_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "yellow_color" + } + ] + } + } + } + ] + }, + { + "name": "color_yellow_green", + "steps": [ + { + "type": "function", + "function_name": "color_yellow_green", + "args": [], + "store_result": "yellow_green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 154 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "yellow_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 205 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "yellow_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "yellow_green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "yellow_green_color" + } + ] + } + } + } + ] + }, + { + "name": "green_of", + "steps": [ + { + "type": "function", + "function_name": "color_green", + "args": [], + "store_result": "green_color" + }, + { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ], + "store_result": "green_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "variable", + "variable_name": "green_value" + } + } + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "black_color" + }, + { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "black_color" + } + ], + "store_result": "black_green_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "variable", + "variable_name": "black_green_value" + } + } + } + ] + }, + { + "name": "hsb_color", + "steps": [ + { + "type": "function", + "function_name": "HSB_color", + "args": [ + { + "type": "int", + "value": 0.0 + }, + { + "type": "int", + "value": 1.0 + }, + { + "type": "int", + "value": 1.0 + } + ], + "store_result": "red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "hue_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "function", + "function_name": "saturation_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "function", + "function_name": "brightness_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "function", + "function_name": "HSB_color", + "args": [ + { + "type": "double", + "value": 0.5 + }, + { + "type": "int", + "value": 0.0 + }, + { + "type": "double", + "value": 0.5 + } + ], + "store_result": "gray_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "saturation_of", + "args": [ + { + "type": "variable", + "variable_name": "gray_color" + } + ] + } + } + } + ] + }, + { + "name": "hue_of", + "steps": [ + { + "type": "function", + "function_name": "color_red", + "args": [], + "store_result": "red_color" + }, + { + "type": "function", + "function_name": "hue_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ], + "store_result": "hue_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable", + "variable_name": "hue_value" + } + } + }, + { + "type": "function", + "function_name": "color_blue", + "args": [], + "store_result": "blue_color" + }, + { + "type": "function", + "function_name": "hue_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_color" + } + ], + "store_result": "hue_value_blue" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.6666666666666666 + }, + "value2": { + "type": "variable", + "variable_name": "hue_value_blue" + } + } + } + ] + }, + { + "name": "random_color", + "steps": [ + { + "type": "function", + "function_name": "random_color", + "args": [], + "store_result": "random_color_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "string", + "value": "#000000FF" + }, + "value2": { + "type": "function", + "function_name": "color_to_string", + "args": [ + { + "type": "variable", + "variable_name": "random_color_result" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "random_color_result" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + }, + "value3": { + "type": "int", + "value": 255 + } + } + } + ] + }, + { + "name": "random_rgb_color", + "steps": [ + { + "type": "function", + "function_name": "random_rgb_color", + "args": [ + { + "type": "int", + "value": 255 + } + ], + "store_result": "random_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "random_color" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + }, + "value3": { + "type": "int", + "value": 255 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "random_color" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + }, + "value3": { + "type": "int", + "value": 255 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "random_color" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + }, + "value3": { + "type": "int", + "value": 255 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "random_color" + } + ] + } + } + } + ] + }, + { + "name": "red_of", + "steps": [ + { + "type": "function", + "function_name": "color_red", + "args": [], + "store_result": "red_color" + }, + { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ], + "store_result": "red_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "variable", + "variable_name": "red_value" + } + } + }, + { + "type": "function", + "function_name": "color_blue", + "args": [], + "store_result": "blue_color" + }, + { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "blue_color" + } + ], + "store_result": "blue_red_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "variable", + "variable_name": "blue_red_value" + } + } + } + ] + }, + { + "name": "rgb_color_from_double", + "steps": [ + { + "type": "function", + "function_name": "rgb_color_from_double", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "function", + "function_name": "rgb_color_from_double", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + } + ] + }, + { + "name": "rgb_color", + "steps": [ + { + "type": "function", + "function_name": "RGB_color", + "args": [ + { + "type": "int", + "value": 255 + }, + { + "type": "int", + "value": 0 + }, + { + "type": "int", + "value": 0 + } + ], + "store_result": "red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + } + ] + }, + { + "name": "rgba_color_from_double", + "steps": [ + { + "type": "function", + "function_name": "RGBA_color_from_double", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.5 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.75 + } + ], + "store_result": "test_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 127 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 191 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + } + } + } + ] + }, + { + "name": "rgba_color", + "steps": [ + { + "type": "function", + "function_name": "RGBA_color", + "args": [ + { + "type": "int", + "value": 255 + }, + { + "type": "int", + "value": 0 + }, + { + "type": "int", + "value": 0 + }, + { + "type": "int", + "value": 255 + } + ], + "store_result": "red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + } + ] + }, + { + "name": "saturation_of", + "steps": [ + { + "type": "function", + "function_name": "color_red", + "args": [], + "store_result": "red_color" + }, + { + "type": "function", + "function_name": "saturation_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ], + "store_result": "saturation_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "variable", + "variable_name": "saturation_value" + } + } + }, + { + "type": "function", + "function_name": "color_gray", + "args": [], + "store_result": "gray_color" + }, + { + "type": "function", + "function_name": "saturation_of", + "args": [ + { + "type": "variable", + "variable_name": "gray_color" + } + ], + "store_result": "saturation_value_gray" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable", + "variable_name": "saturation_value_gray" + } + } + } + ] + }, + { + "name": "string_to_color", + "steps": [ + { + "type": "function", + "function_name": "string_to_color", + "args": [ + { + "type": "string", + "value": "#FF0000FF" + } + ], + "store_result": "red_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "red_color" + } + ] + } + } + }, + { + "type": "function", + "function_name": "string_to_color", + "args": [ + { + "type": "string", + "value": "#00FF00FF" + } + ], + "store_result": "green_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 255 + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "green_color" + } + ] + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/geometry.json b/coresdk/src/test/splashkit-test-generator/data/tests/geometry.json new file mode 100644 index 00000000..4c762c5f --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/geometry.json @@ -0,0 +1,8548 @@ +{ + "group": "geometry", + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "bitmap", + "function_name": "free_all_bitmaps", + "args": [] + } + ], + "tests": [ + { + "name": "center_point_of_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "center_point_of_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "test_center_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_center_point" + }, + "value2": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "circle_at", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 1" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "circle_at", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "draw_circle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_circle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + } + ] + }, + { + "name": "circle_at_from_points", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 2" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_circle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + } + ] + }, + { + "name": "circle_radius", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "circle_radius", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "test_radius" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_radius" + } + } + } + ] + }, + { + "name": "circle_triangle_intersect", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "circle_triangle_intersect", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "circle_triangle_intersect_get_closest_point", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point", + "is_mutable": true + }, + { + "type": "function", + "function_name": "circle_triangle_intersect_get_closest_point", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_triangle" + }, + { + "type": "ref", + "variable_name": "test_point" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "circle_x", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "circle_x", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + } + ] + }, + { + "name": "circle_y", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 150.0 + }, + "value2": { + "type": "function", + "function_name": "circle_y", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + } + ] + }, + { + "name": "circles_intersect", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle1" + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle2" + }, + { + "type": "function", + "function_name": "circles_intersect", + "args": [ + { + "type": "variable", + "variable_name": "test_circle1" + }, + { + "type": "variable", + "variable_name": "test_circle2" + } + ], + "store_result": "test_result1" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "test_result1" + } + } + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle3" + }, + { + "type": "function", + "function_name": "circles_intersect", + "args": [ + { + "type": "variable", + "variable_name": "test_circle1" + }, + { + "type": "variable", + "variable_name": "test_circle3" + } + ], + "store_result": "test_result2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result2" + } + } + } + ] + }, + { + "name": "circles_intersect_using_values", + "steps": [ + { + "type": "function", + "function_name": "circles_intersect_using_values", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_intersect_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_intersect_result" + } + } + }, + { + "type": "function", + "function_name": "circles_intersect_using_values", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 11.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_not_intersect_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "test_not_intersect_result" + } + } + } + ] + }, + { + "name": "closest_point_on_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "closest_point_on_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "test_closest_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "circle_radius", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + "value2": { + "type": "function", + "function_name": "point_point_distance", + "args": [ + { + "type": "variable", + "variable_name": "test_closest_point" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ] + } + } + } + ] + }, + { + "name": "closest_point_on_line_from_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "closest_point_on_line_from_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_closest_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_on_line", + "args": [ + { + "type": "variable", + "variable_name": "test_closest_point" + }, + { + "type": "variable", + "variable_name": "test_line" + } + ] + } + } + } + ] + }, + { + "name": "closest_point_on_rect_from_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "closest_point_on_rect_from_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "test_closest_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_closest_point" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "function", + "function_name": "point_point_distance", + "args": [ + { + "type": "function", + "function_name": "center_point_of_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + { + "type": "variable", + "variable_name": "test_closest_point" + } + ], + "store_result": "test_distance" + }, + { + "type": "assertion", + "compare": { + "compare_type": "less_than_or_equal", + "value1": { + "type": "variable", + "variable_name": "test_distance" + }, + "value2": { + "type": "function", + "function_name": "circle_radius", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + } + ] + }, + { + "name": "closest_point_on_triangle_from_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "closest_point_on_triangle_from_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ], + "store_result": "test_closest_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_triangle", + "args": [ + { + "type": "variable", + "variable_name": "test_closest_point" + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + } + } + } + ] + }, + { + "name": "distant_point_on_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "distant_point_on_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "test_distant_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "point_point_distance", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_distant_point" + } + ] + } + } + } + ] + }, + { + "name": "distant_point_on_circle_heading", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 180.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_heading" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point2", + "is_mutable": true + }, + { + "type": "function", + "function_name": "distant_point_on_circle_heading", + "args": [ + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_heading" + }, + { + "type": "ref", + "variable_name": "test_point2" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_point2", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_point2", + "variable_field": "y" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "name": "ray_circle_intersect_distance", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_ray_origin" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 45.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_ray_heading" + }, + { + "type": "function", + "function_name": "ray_circle_intersect_distance", + "args": [ + { + "type": "variable", + "variable_name": "test_ray_origin" + }, + { + "type": "variable", + "variable_name": "test_ray_heading" + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "test_distance" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 91.4213562 + }, + "value2": { + "type": "variable", + "variable_name": "test_distance" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point2" + }, + { + "name": "tangent_points", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_from_pt" + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point1", + "is_mutable": true + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point2", + "is_mutable": true + }, + { + "type": "function", + "function_name": "tangent_points", + "args": [ + { + "type": "variable", + "variable_name": "test_from_pt" + }, + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "ref", + "variable_name": "test_point1" + }, + { + "type": "ref", + "variable_name": "test_point2" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "test_point1" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "test_point2" + } + } + } + ] + }, + { + "name": "widest_points", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 45.0 + }, + { + "type": "double", + "value": 45.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point1", + "is_mutable": true + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point2", + "is_mutable": true + }, + { + "type": "function", + "function_name": "widest_points", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_vector" + }, + { + "type": "ref", + "variable_name": "test_point1" + }, + { + "type": "ref", + "variable_name": "test_point2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_circle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "function", + "cast_to": "double", + "function_name": "circle_x", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + { + "type": "function", + "cast_to": "double", + "function_name": "circle_y", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + ] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_circle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "function", + "cast_to": "double", + "function_name": "circle_x", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + { + "type": "function", + "cast_to": "double", + "function_name": "circle_y", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + ] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + } + ] + }, + { + "name": "cosine", + "steps": [ + { + "type": "function", + "function_name": "cosine", + "args": [ + { + "type": "float", + "value": 0.0 + } + ], + "store_result": "test_cosine_0" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_cosine_0" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "function", + "function_name": "cosine", + "args": [ + { + "type": "float", + "value": 90.0 + } + ], + "store_result": "test_cosine_90" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_cosine_90" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "function", + "function_name": "cosine", + "args": [ + { + "type": "float", + "value": 180.0 + } + ], + "store_result": "test_cosine_180" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -1.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_cosine_180" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "name": "sine", + "steps": [ + { + "type": "function", + "function_name": "sine", + "args": [ + { + "type": "float", + "value": 0.0 + } + ], + "store_result": "test_sine_0" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_sine_0" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "function", + "function_name": "sine", + "args": [ + { + "type": "float", + "value": 90.0 + } + ], + "store_result": "test_sine_90" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_sine_90" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "function", + "function_name": "sine", + "args": [ + { + "type": "float", + "value": 180.0 + } + ], + "store_result": "test_sine_180" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_sine_180" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "function", + "function_name": "sine", + "args": [ + { + "type": "float", + "value": 270.0 + } + ], + "store_result": "test_sine_270" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -1.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_sine_270" + } + } + } + ] + }, + { + "name": "tangent", + "steps": [ + { + "type": "function", + "function_name": "tangent", + "args": [ + { + "type": "float", + "value": 45.0 + } + ], + "store_result": "test_tangent_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "variable", + "variable_name": "test_tangent_result" + }, + "value2": { + "type": "double", + "value": 1.0 + }, + "value3": { + "type": "double", + "value": 2.0 + } + } + } + ] + }, + { + "name": "closest_point_on_line", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "closest_point_on_line", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_closest_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "point_point_distance", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_closest_point" + } + ] + } + } + } + ] + }, + { + "name": "closest_point_on_lines", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_from_pt" + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": -10.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + ], + "store_result": "test_line1" + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": -10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ], + "store_result": "test_line2" + }, + { + "type": "variable", + "variable_type": "int", + "variable_name": "test_index", + "value": 0, + "is_mutable": true + }, + { + "type": "variable", + "variable_type": "list", + "target_type": "line", + "variable_name": "test_lines", + "value": [ + { + "type": "variable", + "variable_name": "test_line1" + }, + { + "type": "variable", + "variable_name": "test_line2" + } + ] + }, + { + "type": "function", + "function_name": "closest_point_on_lines", + "args": [ + { + "type": "variable", + "variable_name": "test_from_pt" + }, + { + "type": "variable", + "variable_name": "test_lines" + }, + { + "type": "ref", + "variable_name": "test_index" + } + ], + "store_result": "test_closest_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "point_point_distance", + "args": [ + { + "type": "variable", + "variable_name": "test_from_pt" + }, + { + "type": "variable", + "variable_name": "test_closest_point" + } + ] + } + } + } + ] + }, + { + "name": "line_from_point_to_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_start_point" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_end_point" + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "variable", + "variable_name": "test_start_point" + }, + { + "type": "variable", + "variable_name": "test_end_point" + } + ], + "store_result": "test_line" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 141.421356 + }, + "value2": { + "type": "function", + "function_name": "line_length", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ] + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "name": "line_from_start_with_offset", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_start_point" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 45.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_offset_vector" + }, + { + "type": "function", + "function_name": "line_from_start_with_offset", + "args": [ + { + "type": "variable", + "variable_name": "test_start_point" + }, + { + "type": "variable", + "variable_name": "test_offset_vector" + } + ], + "store_result": "test_line" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_on_line", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_line" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_on_line", + "args": [ + { + "type": "function", + "function_name": "point_offset_by", + "args": [ + { + "type": "variable", + "variable_name": "test_start_point" + }, + { + "type": "variable", + "variable_name": "test_offset_vector" + } + ] + }, + { + "type": "variable", + "variable_name": "test_line" + } + ] + } + } + } + ] + }, + { + "name": "line_from_vector", + "steps": [ + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "line_from_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ], + "store_result": "test_line" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at_origin", + "args": [] + }, + "value2": { + "type": "variable_field", + "variable_name": "test_line", + "variable_field": "start_point" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -8.682409286499023 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_line", + "variable_field": "end_point.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 49.240386962890625 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_line", + "variable_field": "end_point.y" + } + } + } + ] + }, + { + "name": "line_from", + "steps": [ + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_line" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 14.1421356 + }, + "value2": { + "type": "function", + "function_name": "line_length", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ] + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "name": "line_intersection_point", + "steps": [ + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_line1" + }, + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_line2" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point", + "is_mutable": true + }, + { + "type": "function", + "function_name": "line_intersection_point", + "args": [ + { + "type": "variable", + "variable_name": "test_line1" + }, + { + "type": "variable", + "variable_name": "test_line2" + }, + { + "type": "ref", + "variable_name": "test_point" + } + ], + "store_result": "test_intersection_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_intersection_result" + } + } + } + ] + }, + { + "name": "line_intersects_circle", + "steps": [ + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 3.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "line_intersects_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "line_intersects_lines", + "steps": [ + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_line1" + }, + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 30.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_line2" + }, + { + "type": "variable", + "variable_name": "test_lines", + "target_type": "line", + "variable_type": "list", + "value": [ + { + "type": "variable", + "variable_name": "test_line1" + }, + { + "type": "variable", + "variable_name": "test_line2" + } + ] + }, + { + "type": "function", + "function_name": "line_intersects_lines", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + }, + { + "type": "variable", + "variable_name": "test_lines" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "line_intersects_rect", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": -50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "line_intersects_rect", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + } + } + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": -50.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ], + "store_result": "test_line_outside" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "line_intersects_rect", + "args": [ + { + "type": "variable", + "variable_name": "test_line_outside" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + } + } + } + ] + }, + { + "name": "line_length", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "line_length", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_length" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_length" + } + } + } + ] + }, + { + "name": "line_length_squared", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "line_length_squared", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 25.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "line_mid_point", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "line_mid_point", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_mid_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "point_point_distance", + "args": [ + { + "type": "variable", + "variable_name": "test_mid_point" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + } + } + } + ] + }, + { + "name": "line_normal", + "steps": [ + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "line_normal", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_normal" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -0.7071067811865475 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_normal", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.7071067811865475 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_normal", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "line_to_string", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "line_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_line_string" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "string", + "value": "Line from Pt @0:0 to Pt @100:100" + }, + "value2": { + "type": "variable", + "variable_name": "test_line_string" + } + } + } + ] + }, + { + "name": "lines_from_rectangle", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "lines_from_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "test_lines" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 4 + }, + "value2": { + "type": "size", + "variable_name": "test_lines" + } + } + } + ] + }, + { + "name": "lines_from_triangle", + "steps": [ + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 86.6 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "lines_from_triangle", + "args": [ + { + "type": "variable", + "variable_name": "test_triangle" + } + ], + "store_result": "test_lines" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 3 + }, + "value2": { + "type": "size", + "variable_name": "test_lines" + } + } + } + ] + }, + { + "name": "lines_intersect", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ], + "store_result": "test_line1" + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ], + "store_result": "test_line2" + }, + { + "type": "function", + "function_name": "lines_intersect", + "args": [ + { + "type": "variable", + "variable_name": "test_line1" + }, + { + "type": "variable", + "variable_name": "test_line2" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "point_at", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 10.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 20.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "point_at_origin", + "steps": [ + { + "type": "function", + "function_name": "point_at_origin", + "args": [], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "point_in_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_circle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_circle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_circle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + } + } + } + ] + }, + { + "name": "point_in_circle_with_values", + "steps": [ + { + "type": "function", + "function_name": "point_in_circle_with_values", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_result1" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result1" + } + } + }, + { + "type": "function", + "function_name": "point_in_circle_with_values", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_result2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "test_result2" + } + } + } + ] + }, + { + "name": "point_in_quad", + "steps": [ + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 51.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + } + ] + }, + { + "name": "point_in_rectangle", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_point_inside" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_point_outside" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_point_inside" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_point_outside" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "point_in_rectangle_with_values", + "steps": [ + { + "type": "function", + "function_name": "point_in_rectangle_with_values", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_result_inside" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result_inside" + } + } + }, + { + "type": "function", + "function_name": "point_in_rectangle_with_values", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_result_outside" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "test_result_outside" + } + } + } + ] + }, + { + "name": "point_in_triangle", + "steps": [ + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_triangle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_triangle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + } + } + } + ] + }, + { + "name": "point_line_distance", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "point_line_distance", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_distance" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_distance" + } + } + } + ] + }, + { + "name": "point_offset_by", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_start_point" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_offset" + }, + { + "type": "function", + "function_name": "point_offset_by", + "args": [ + { + "type": "variable", + "variable_name": "test_start_point" + }, + { + "type": "variable", + "variable_name": "test_offset" + } + ], + "store_result": "test_result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 19.961947202682495 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 20.87155744433403 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "point_offset_from_origin", + "steps": [ + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "point_offset_from_origin", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 19.696154594421387 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.472963571548462 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "point_on_line", + "steps": [ + { + "type": "function", + "function_name": "line_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_point_on_line" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 15.0 + }, + { + "type": "double", + "value": 15.0 + } + ], + "store_result": "test_point_off_line" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_on_line", + "args": [ + { + "type": "variable", + "variable_name": "test_point_on_line" + }, + { + "type": "variable", + "variable_name": "test_line" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_on_line", + "args": [ + { + "type": "variable", + "variable_name": "test_point_off_line" + }, + { + "type": "variable", + "variable_name": "test_line" + } + ] + } + } + } + ] + }, + { + "name": "point_on_line_with_proximity", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_point_on_line" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.1 + }, + { + "type": "double", + "value": 5.1 + } + ], + "store_result": "test_point_near_line" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 15.0 + }, + { + "type": "double", + "value": 15.0 + } + ], + "store_result": "test_point_far_from_line" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_on_line_with_proximity", + "args": [ + { + "type": "variable", + "variable_name": "test_point_on_line" + }, + { + "type": "variable", + "variable_name": "test_line" + }, + { + "type": "float", + "value": 0.1 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_on_line_with_proximity", + "args": [ + { + "type": "variable", + "variable_name": "test_point_near_line" + }, + { + "type": "variable", + "variable_name": "test_line" + }, + { + "type": "float", + "value": 0.2 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_on_line_with_proximity", + "args": [ + { + "type": "variable", + "variable_name": "test_point_far_from_line" + }, + { + "type": "variable", + "variable_name": "test_line" + }, + { + "type": "float", + "value": 0.1 + } + ] + } + } + } + ] + }, + { + "name": "point_point_angle", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "function", + "function_name": "point_point_angle", + "args": [ + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_point2" + } + ], + "store_result": "test_angle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_angle" + } + } + } + ] + }, + { + "name": "point_point_distance", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "function", + "function_name": "point_point_distance", + "args": [ + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_point2" + } + ], + "store_result": "test_distance" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_distance" + } + } + } + ] + }, + { + "name": "point_to_string", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "point_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "test_string" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Pt @10.000000:20.000000" + }, + "value2": { + "type": "variable", + "variable_name": "test_string" + } + } + } + ] + }, + { + "name": "random_bitmap_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 1" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "random_bitmap_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "x" + }, + "value2": { + "type": "double", + "value": 0.0 + }, + "value3": { + "type": "function", + "cast_to": "double", + "function_name": "bitmap_width", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "y" + }, + "value2": { + "type": "double", + "value": 0.0 + }, + "value3": { + "type": "function", + "cast_to": "double", + "function_name": "bitmap_height", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "random_screen_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "random_screen_point", + "args": [], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "x" + }, + "value2": { + "type": "double", + "value": 0.0 + }, + "value3": { + "type": "function", + "function_name": "window_width", + "cast_to": "double", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "y" + }, + "value2": { + "type": "double", + "value": 0.0 + }, + "value3": { + "type": "function", + "function_name": "window_height", + "cast_to": "double", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "random_window_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 4" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "random_window_point", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "x" + }, + "value2": { + "type": "double", + "value": 0.0 + }, + "value3": { + "type": "function", + "function_name": "window_width", + "cast_to": "double", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "variable_field", + "variable_name": "test_point", + "variable_field": "y" + }, + "value2": { + "type": "double", + "value": 0.0 + }, + "value3": { + "type": "function", + "function_name": "window_height", + "cast_to": "double", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "same_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 21.0 + } + ], + "store_result": "test_point3" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "same_point", + "args": [ + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_point2" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "same_point", + "args": [ + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_point3" + } + ] + } + } + } + ] + }, + { + "name": "quad_from_points", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_p1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_p2" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_p3" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_p4" + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "variable", + "variable_name": "test_p1" + }, + { + "type": "variable", + "variable_name": "test_p2" + }, + { + "type": "variable", + "variable_name": "test_p3" + }, + { + "type": "variable", + "variable_name": "test_p4" + } + ], + "store_result": "test_quad" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 51.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + } + ] + }, + { + "name": "quad_from_rectangle", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "quad_from_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "test_quad" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 51.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + } + ] + }, + { + "name": "quad_from_rectangle_with_transformation", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "rotation_matrix", + "args": [ + { + "type": "double", + "value": 45.0 + } + ], + "store_result": "test_transform" + }, + { + "type": "function", + "function_name": "quad_from_rectangle_with_transformation", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "variable", + "variable_name": "test_transform" + } + ], + "store_result": "test_quad" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 51.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + } + ] + }, + { + "name": "quad_from", + "steps": [ + { + "type": "function", + "function_name": "quad_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_quad" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 51.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + } + ] + }, + { + "name": "quads_intersect", + "steps": [ + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_quad1" + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ], + "store_result": "test_quad2" + }, + { + "type": "function", + "function_name": "quads_intersect", + "args": [ + { + "type": "variable", + "variable_name": "test_quad1" + }, + { + "type": "variable", + "variable_name": "test_quad2" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "set_quad_point", + "steps": [ + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_quad", + "is_mutable": true + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + }, + { + "type": "function", + "function_name": "set_quad_point", + "args": [ + { + "type": "ref", + "variable_name": "test_quad" + }, + { + "type": "int", + "value": 2 + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_quad", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + } + } + } + ] + }, + { + "name": "triangles_from", + "steps": [ + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "triangles_from", + "args": [ + { + "type": "variable", + "variable_name": "test_quad" + } + ], + "store_result": "test_triangles" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "size", + "variable_name": "test_triangles" + } + } + } + ] + }, + { + "name": "inset_rectangle", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "inset_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "float", + "value": 10.0 + } + ], + "store_result": "test_inset_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_inset_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_inset_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 90.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_inset_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 90.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_inset_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "intersection", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_rect1" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_rect2" + }, + { + "type": "function", + "function_name": "intersection", + "args": [ + { + "type": "variable", + "variable_name": "test_rect1" + }, + { + "type": "variable", + "variable_name": "test_rect2" + } + ], + "store_result": "test_intersection" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_intersection" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_intersection" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_intersection" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_intersection" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_around_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "rectangle_around_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 150.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 150.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_around_line", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "rectangle_around_line", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_rectangle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_rectangle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_around_quad", + "steps": [ + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "rectangle_around_quad", + "args": [ + { + "type": "variable", + "variable_name": "test_quad" + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_around_triangle", + "steps": [ + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "rectangle_around_triangle", + "args": [ + { + "type": "variable", + "variable_name": "test_triangle" + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_bottom", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 60.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 80.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_center", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from_point_and_size", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "rectangle_center", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "test_center_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "point_point_distance", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_center_point" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_from_point_and_size", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "rectangle_from_point_and_size", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 60.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_from_points", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "function", + "function_name": "rectangle_from_points", + "args": [ + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_point2" + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_from", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 60.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_bottom", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_left", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 60.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "test_left" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_left" + } + } + } + ] + }, + { + "name": "rectangle_offset_by", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "rectangle_offset_by", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + } + ], + "store_result": "test_offset_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 30.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_offset_rectangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 40.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_offset_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_right", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 60.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 60.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_right", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + } + } + } + ] + }, + { + "name": "rectangle_to_string", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 30.0 + }, + { + "type": "double", + "value": 40.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "rectangle_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "test_string" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Rect @10,20 30x40" + }, + "value2": { + "type": "variable", + "variable_name": "test_string" + } + } + } + ] + }, + { + "name": "rectangle_top", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 60.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "test_top" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_top" + } + } + } + ] + }, + { + "name": "rectangles_intersect", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_rect1" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_rect2" + }, + { + "type": "function", + "function_name": "rectangles_intersect", + "args": [ + { + "type": "variable", + "variable_name": "test_rect1" + }, + { + "type": "variable", + "variable_name": "test_rect2" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "triangle_barycenter", + "steps": [ + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "triangle_barycenter", + "args": [ + { + "type": "variable", + "variable_name": "test_triangle" + } + ], + "store_result": "test_barycenter" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_barycenter", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 16.67 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_barycenter", + "variable_field": "y" + }, + "value3": { + "type": "precision", + "value": 0.004 + } + } + } + ] + }, + { + "name": "triangle_from", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point3" + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_point2" + }, + { + "type": "variable", + "variable_name": "test_point3" + } + ], + "store_result": "test_triangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_triangle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + } + } + } + ] + }, + { + "name": "triangle_from_coordinates", + "steps": [ + { + "type": "function", + "function_name": "triangle_from_coordinates", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_triangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "point_in_triangle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "point_in_triangle", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + } + } + } + ] + }, + { + "name": "triangle_rectangle_intersect", + "steps": [ + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "rectangle_from_point_and_size", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 40.0 + }, + { + "type": "double", + "value": 40.0 + } + ] + }, + { + "type": "double", + "value": 60.0 + }, + { + "type": "double", + "value": 60.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "triangle_rectangle_intersect", + "args": [ + { + "type": "variable", + "variable_name": "test_triangle" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "triangle_to_string", + "steps": [ + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "triangle_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_triangle" + } + ], + "store_result": "test_triangle_string" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "string", + "value": "Triangle @Pt @0:0 - Pt @100:0 - Pt @50:100" + }, + "value2": { + "type": "variable", + "variable_name": "test_triangle_string" + } + } + } + ] + }, + { + "name": "triangles_intersect", + "steps": [ + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 2.0 + } + ] + } + ], + "store_result": "test_triangle1" + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 2.0 + } + ] + } + ], + "store_result": "test_triangle2" + }, + { + "type": "function", + "function_name": "triangles_intersect", + "args": [ + { + "type": "variable", + "variable_name": "test_triangle1" + }, + { + "type": "variable", + "variable_name": "test_triangle2" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/graphics.json b/coresdk/src/test/splashkit-test-generator/data/tests/graphics.json new file mode 100644 index 00000000..2bdb3f9d --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/graphics.json @@ -0,0 +1,41138 @@ +{ + "group": "graphics", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "animation_script", + "function_name": "free_all_animation_scripts", + "args": [] + }, + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "bitmap", + "function_name": "free_all_bitmaps", + "args": [] + }, + { + "cleanup_type": "animation", + "function_name": "free_animation", + "args": [ + { + "type": "object", + "object_type": "animation", + "variable_name": "animation" + } + ] + }, + { + "cleanup_type": "font", + "function_name": "free_all_fonts", + "args": [] + } + ], + "tests": [ + { + "name": "draw_circle_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 1" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "draw_circle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_circle_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 2" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_circle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 425.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_circle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 4" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_circle_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 1" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 160.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_circle_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 2" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 160.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_circle_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 5" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_circle_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 6" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 400.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_circle_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 7" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "fill_circle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 425.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_circle_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 8" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "fill_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 425.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_circle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 9" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_circle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 425.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_circle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 10" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_circle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 425.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_circle_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 3" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_circle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 160.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_circle_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 4" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_circle_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 160.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_circle_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 11" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_circle_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 425.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_circle_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 12" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_circle_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 425.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "current_clip", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 13" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "current_clip", + "args": [], + "store_result": "test_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 800.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 600.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "current_clip_for_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 5" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "push_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "current_clip_for_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 14" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "current_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "test_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 800.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 600.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "pop_clip_for_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 15" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 250.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "push_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "test_current_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 250.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 250.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "height" + } + } + }, + { + "type": "function", + "function_name": "pop_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "test_current_clip_after_pop" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip_after_pop" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip_after_pop" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 800.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip_after_pop", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 600.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip_after_pop", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "pop_clip", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 16" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "push_clip", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle", + "args": [ + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 275.0 + }, + { + "type": "double", + "value": 275.0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "pop_clip", + "args": [] + }, + { + "type": "function", + "function_name": "fill_rectangle", + "args": [ + { + "type": "function", + "function_name": "color_green", + "args": [] + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "color_green", + "args": [], + "store_result": "test_color" + }, + { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 350.0 + } + ], + "store_result": "test_pixel" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + }, + "value2": { + "type": "function", + "function_name": "red_of", + "args": [ + { + "type": "variable", + "variable_name": "test_pixel" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + }, + "value2": { + "type": "function", + "function_name": "green_of", + "args": [ + { + "type": "variable", + "variable_name": "test_pixel" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + }, + "value2": { + "type": "function", + "function_name": "blue_of", + "args": [ + { + "type": "variable", + "variable_name": "test_pixel" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + }, + "value2": { + "type": "function", + "function_name": "alpha_of", + "args": [ + { + "type": "variable", + "variable_name": "test_pixel" + } + ] + } + } + } + ] + }, + { + "name": "pop_clip_for_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 6" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "push_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "fill_circle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "function", + "function_name": "option_draw_to_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "pop_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "push_clip_for_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 17" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "push_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "test_current_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "height" + } + } + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "name": "push_clip_for_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 7" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "push_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_current_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "push_clip", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 18" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "push_clip", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "current_clip", + "args": [], + "store_result": "test_current_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "reset_clip_for_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 8" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "push_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "reset_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "reset_clip", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 19" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "push_clip", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "reset_clip", + "args": [] + }, + { + "type": "function", + "function_name": "current_clip", + "args": [], + "store_result": "test_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 800.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 600.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "reset_clip_for_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 20" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "push_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "reset_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "test_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 800.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 600.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "set_clip", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 21" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "set_clip", + "args": [ + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "current_clip", + "args": [], + "store_result": "test_current_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "set_clip_for_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 9" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "set_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_current_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "set_clip_for_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 22" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "set_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "current_clip_for_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "test_current_clip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_left", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "rectangle_top", + "args": [ + { + "type": "variable", + "variable_name": "test_current_clip" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_current_clip", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "option_defaults", + "steps": [ + { + "type": "function", + "function_name": "option_defaults", + "args": [], + "store_result": "test_options" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 1.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "scale_x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 1.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "scale_y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "angle" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "anchor_offset_x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "anchor_offset_y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "flip_x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "flip_y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "is_part" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ] + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "part" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "drawing_dest", + "value": "draw_default" + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "camera" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "line_width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "null", + "value1": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "anim" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -1 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_options", + "variable_field": "draw_cell" + } + } + } + ] + }, + { + "name": "option_draw_to_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 10" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "option_draw_to_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_options" + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_options" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "option_draw_to_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 11" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [], + "store_result": "test_options" + }, + { + "type": "function", + "function_name": "option_draw_to_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_options" + } + ], + "store_result": "test_drawing_options" + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "variable", + "variable_name": "test_drawing_options" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "option_draw_to_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 23" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "option_draw_to_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_draw_to_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 24" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [], + "store_result": "test_options" + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "option_draw_to_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_options" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 460.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_flip_x", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 25" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 12" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_flip_x", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "option_flip_x_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 26" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 13" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_flip_x_with_options", + "args": [ + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 425.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 375.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_flip_xy", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 27" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 14" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_flip_xy", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + } + } + ] + }, + { + "name": "option_flip_xy_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 28" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 15" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_flip_xy_with_options", + "args": [ + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + } + } + ] + }, + { + "name": "option_flip_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 29" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 16" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_flip_y", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 325.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 275.0 + } + ] + } + } + } + ] + }, + { + "name": "option_flip_y_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 30" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 17" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_flip_y_with_options", + "args": [ + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 325.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 275.0 + } + ] + } + } + } + ] + }, + { + "name": "option_line_width", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 31" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "function", + "function_name": "option_line_width", + "args": [ + { + "type": "int", + "value": 5 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 140.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + }, + { + "name": "option_line_width_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 32" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "function", + "function_name": "option_line_width_with_options", + "args": [ + { + "type": "int", + "value": 5 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 145.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + }, + { + "name": "option_part_bmp", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 33" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 18" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_part_bmp", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "option_part_bmp_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 34" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 19" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_part_bmp_with_options", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "option_part_bmp_from_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 35" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 20" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "function", + "function_name": "option_part_bmp_from_rectangle", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "option_part_bmp_from_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 36" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 21" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "function", + "function_name": "option_part_bmp_from_rectangle_with_options", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "option_rotate_bmp", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 37" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 22" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_rotate_bmp", + "args": [ + { + "type": "double", + "value": 90.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + } + } + ] + }, + { + "name": "option_rotate_bmp_with_anchor", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 38" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 23" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_rotate_bmp_with_anchor", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_rotate_bmp_with_anchor_and_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 39" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 24" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_rotate_bmp_with_anchor_and_options", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_rotate_bmp_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 40" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 25" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_rotate_bmp_with_options", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + } + } + ] + }, + { + "name": "option_scale_bmp", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 41" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 26" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_scale_bmp", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 2.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 451.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_scale_bmp_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 42" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 27" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_scale_bmp_with_options", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 2.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 451.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_to_screen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 43" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "option_to_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 451.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_to_screen_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 44" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "option_to_screen_with_options", + "args": [ + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "option_to_world", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 45" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "move_camera_to", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "option_to_world", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 375.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "option_to_world_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 46" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "move_camera_to", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "option_to_world_with_options", + "args": [ + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 375.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "option_with_animation", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 47" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 1" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "kermit_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "kermit_script", + "value": "Test Animation 1" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "load_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 28" + }, + { + "type": "string", + "value": "frog.png" + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 73 + }, + { + "type": "int", + "value": 105 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 16 + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_close_requested", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: option_with_animation. Should be moving. Close when done." + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "update_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "option_with_animation_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 48" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 2" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "kermit_script" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_animation", + "args": [ + { + "type": "variable", + "variable_name": "kermit_script", + "value": "Test Animation 2" + }, + { + "type": "string", + "value": "moonwalkback" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "cleanup_type": "animation", + "store_result": "cleanup_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "load_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 29" + }, + { + "type": "string", + "value": "frog.png" + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 73 + }, + { + "type": "int", + "value": 105 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 16 + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_close_requested", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_with_animation_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: option_with_animation_with_options. Should be moving. Close when done." + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "update_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_animation" + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "option_with_bitmap_cell", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 49" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 30" + }, + { + "type": "int", + "value": 64 + }, + { + "type": "int", + "value": 64 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 32 + }, + { + "type": "int", + "value": 32 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 4 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_with_bitmap_cell", + "args": [ + { + "type": "int", + "value": 1 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 116.0 + }, + { + "type": "double", + "value": 116.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 84.0 + }, + { + "type": "double", + "value": 84.0 + } + ] + } + } + } + ] + }, + { + "name": "option_with_bitmap_cell_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 50" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 31" + }, + { + "type": "int", + "value": 64 + }, + { + "type": "int", + "value": 64 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 32 + }, + { + "type": "int", + "value": 32 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 4 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_with_bitmap_cell_with_options", + "args": [ + { + "type": "int", + "value": 1 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 116.0 + }, + { + "type": "double", + "value": 116.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 84.0 + }, + { + "type": "double", + "value": 84.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_within_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 51" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse_within_rectangle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_within_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 52" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse_within_rectangle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 53" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 54" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_on_bitmap_within_rectangle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 32" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "rect" + }, + { + "type": "function", + "function_name": "draw_ellipse_on_bitmap_within_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "rect" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_on_bitmap_within_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 33" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse_on_bitmap_within_rectangle_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 34" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 160.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 35" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 30.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 160.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_on_window_within_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 55" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "rect" + }, + { + "type": "function", + "function_name": "draw_ellipse_on_window_within_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "rect" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_on_window_within_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 56" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "rect" + }, + { + "type": "function", + "function_name": "draw_ellipse_on_window_within_rectangle_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "rect" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 57" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_ellipse_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 58" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_ellipse_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 325.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_within_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 59" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_within_rectangle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_within_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 60" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_within_rectangle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 61" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 325.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 62" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 325.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_on_bitmap_within_rectangle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 36" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_on_bitmap_within_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_on_bitmap_within_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 37" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_on_bitmap_within_rectangle_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 38" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 39" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_on_window_within_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 63" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_on_window_within_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_on_window_within_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 64" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_on_window_within_rectangle_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 65" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 325.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_ellipse_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 66" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_ellipse_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 325.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 500.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "clear_screen_to_white", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 67" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "draw_pixel", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "clear_screen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 68" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "draw_pixel", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "clear_screen", + "args": [ + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + } + ] + }, + { + "name": "display_details", + "steps": [ + { + "type": "function", + "function_name": "number_of_displays", + "args": [], + "store_result": "displays" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "displays" + }, + "value2": { + "type": "int", + "value": 0 + } + } + }, + { + "type": "function", + "function_name": "display_details", + "args": [ + { + "type": "unsigned_int", + "value": 0 + } + ], + "store_result": "test_display" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_display" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "display_width", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "display_height", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_empty", + "value1": { + "type": "function", + "function_name": "display_name", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "display_height", + "steps": [ + { + "type": "function", + "function_name": "display_details", + "args": [ + { + "type": "unsigned_int", + "value": 0 + } + ], + "store_result": "test_display" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "display_height", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + } + } + } + ] + }, + { + "name": "display_name", + "steps": [ + { + "type": "function", + "function_name": "display_details", + "args": [ + { + "type": "unsigned_int", + "value": 0 + } + ], + "store_result": "test_display" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_empty", + "value1": { + "type": "function", + "function_name": "display_name", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_empty", + "value1": { + "type": "function", + "function_name": "display_name", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "display_width", + "steps": [ + { + "type": "function", + "function_name": "display_details", + "args": [ + { + "type": "unsigned_int", + "value": 0 + } + ], + "store_result": "test_display" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "display_width", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + } + } + } + ] + }, + { + "name": "display_x", + "steps": [ + { + "type": "function", + "function_name": "display_details", + "args": [ + { + "type": "unsigned_int", + "value": 0 + } + ], + "store_result": "test_display" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "display_x", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + } + } + } + ] + }, + { + "name": "display_y", + "steps": [ + { + "type": "function", + "function_name": "display_details", + "args": [ + { + "type": "unsigned_int", + "value": 0 + } + ], + "store_result": "test_display" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "display_y", + "args": [ + { + "type": "variable", + "variable_name": "test_display" + } + ] + } + } + } + ] + }, + { + "name": "number_of_displays", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "number_of_displays", + "args": [] + }, + "value2": { + "type": "int", + "value": 0 + } + } + } + ] + }, + { + "name": "refresh_screen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 69" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "name": "refresh_screen_with_target_fps", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 70" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen_with_target_fps", + "args": [ + { + "type": "unsigned_int", + "value": 60 + } + ] + } + ] + }, + { + "name": "save_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 40" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "save_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "Test Bitmap 40" + } + ] + } + ] + }, + { + "name": "screen_height", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 71" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 600 + }, + "value2": { + "type": "function", + "function_name": "screen_height", + "args": [] + } + } + } + ] + }, + { + "name": "screen_width", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 72" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 800 + }, + "value2": { + "type": "function", + "function_name": "screen_width", + "args": [] + } + } + } + ] + }, + { + "name": "take_screenshot", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 73" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "function", + "function_name": "take_screenshot", + "args": [ + { + "type": "string", + "value": "test_screenshot" + } + ] + } + ] + }, + { + "name": "take_screenshot_of_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 74" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "function", + "function_name": "take_screenshot_of_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "string", + "value": "test_screenshot" + } + ] + } + ] + }, + { + "name": "bitmap_bounding_circle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 41" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "bitmap_bounding_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "bounding_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_point" + }, + "value2": { + "type": "function", + "function_name": "center_point_of_circle", + "args": [ + { + "type": "variable", + "variable_name": "bounding_circle" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "circle_radius", + "args": [ + { + "type": "variable", + "variable_name": "bounding_circle" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_bounding_rectangle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 42" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_bounding_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "bounding_rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "bounding_rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "bounding_rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "bounding_rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "bounding_rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "bitmap_bounding_rectangle_at_location", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 43" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_bounding_rectangle_at_location", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "bounding_rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "bounding_rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "bounding_rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "bounding_rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "bounding_rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "bitmap_cell_center", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 44" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_cell_center", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "center" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "center", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "center", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "bitmap_cell_circle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 45" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 4 + } + ] + }, + { + "type": "function", + "function_name": "bitmap_cell_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "radius" + } + } + } + ] + }, + { + "name": "bitmap_cell_circle_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 46" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 4 + } + ] + }, + { + "type": "function", + "function_name": "bitmap_cell_circle_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "radius" + } + } + } + ] + }, + { + "name": "bitmap_cell_circle_at_point_with_scale", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 47" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 2 + }, + { + "type": "int", + "value": 4 + } + ] + }, + { + "type": "function", + "function_name": "bitmap_cell_circle_at_point_with_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "radius" + } + } + } + ] + }, + { + "name": "bitmap_cell_columns", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 48" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 25 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_columns", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_cell_count", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 49" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 25 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 25 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_count", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_cell_height", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 50" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 25 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_height", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_cell_offset", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 51" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 16 + } + ] + }, + { + "type": "function", + "function_name": "bitmap_cell_offset", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 5 + } + ], + "store_result": "offset" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "offset", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "offset", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "bitmap_cell_rectangle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 52" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 16 + } + ] + }, + { + "type": "function", + "function_name": "bitmap_cell_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "bitmap_cell_rectangle_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 53" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 16 + } + ] + }, + { + "type": "function", + "function_name": "bitmap_cell_rectangle_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ], + "store_result": "rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "bitmap_cell_rows", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 54" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 25 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_rows", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_cell_width", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 55" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 16 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 25 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_width", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_center", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 56" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_center", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_center" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_center", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_center", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "bitmap_filename", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 57" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "function", + "function_name": "bitmap_filename", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_height", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 58" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "bitmap_height", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_height_of_bitmap_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 59" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "bitmap_height_of_bitmap_named", + "args": [ + { + "type": "string", + "value": "Test Bitmap 59" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_name", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 60" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Bitmap 60" + }, + "value2": { + "type": "function", + "function_name": "bitmap_name", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 61" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "function", + "function_name": "bitmap_named", + "args": [ + { + "type": "string", + "value": "Test Bitmap 61" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "Python pointer registry creates an instance if None instead of returning None" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "null", + "value1": { + "type": "function", + "function_name": "bitmap_named", + "args": [ + { + "type": "string", + "value": "nonexistent_bitmap" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_rectangle_of_cell", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 62" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 25 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 4 + }, + { + "type": "int", + "value": 16 + } + ] + }, + { + "type": "function", + "function_name": "bitmap_rectangle_of_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 5 + } + ], + "store_result": "rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "bitmap_set_cell_details", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 63" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 25 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_width", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_height", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_columns", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_rows", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 25 + }, + "value2": { + "type": "function", + "function_name": "bitmap_cell_count", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_valid", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 64" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_valid", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_valid", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_width", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 65" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "bitmap_width", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "bitmap_width_of_bitmap_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 66" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "bitmap_width_of_bitmap_named", + "args": [ + { + "type": "string", + "value": "Test Bitmap 66" + } + ] + } + } + } + ] + }, + { + "name": "clear_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 67" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "clear_bitmap_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 68" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "clear_bitmap_named", + "args": [ + { + "type": "string", + "value": "Test Bitmap 68" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "create_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 69" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_bitmap" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "bitmap_width", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "bitmap_height", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Bitmap 69" + }, + "value2": { + "type": "function", + "function_name": "bitmap_name", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + } + } + } + ] + }, + { + "name": "draw_bitmap", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 75" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 70" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 76" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 71" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_bitmap_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 77" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 72" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_named", + "args": [ + { + "type": "string", + "value": "Test Bitmap 72" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_bitmap_named_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 78" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 73" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_named_with_options", + "args": [ + { + "type": "string", + "value": "Test Bitmap 73" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_bitmap_on_bitmap_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 74" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "dest_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 75" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "source_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "dest_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "source_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_on_bitmap_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "dest_bitmap" + }, + { + "type": "variable", + "variable_name": "source_bitmap" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "dest_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "dest_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_bitmap_on_bitmap_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 76" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "dest_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 77" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "source_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "dest_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "source_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_on_bitmap_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "dest_bitmap" + }, + { + "type": "variable", + "variable_name": "source_bitmap" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "dest_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "dest_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_bitmap_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 79" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 78" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_bitmap_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 80" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 79" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_bitmap_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "free_all_bitmaps", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 80" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "bitmap1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 81" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "bitmap2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_valid", + "args": [ + { + "type": "variable", + "variable_name": "bitmap1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_valid", + "args": [ + { + "type": "variable", + "variable_name": "bitmap2" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_all_bitmaps", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_valid", + "args": [ + { + "type": "variable", + "variable_name": "bitmap1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_valid", + "args": [ + { + "type": "variable", + "variable_name": "bitmap2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 82" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_valid", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_valid", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 83" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 83" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 83" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "load_bitmap", + "steps": [ + { + "type": "function", + "function_name": "load_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 84" + }, + { + "type": "string", + "value": "frog.png" + } + ], + "store_result": "loaded_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "loaded_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "pixel_drawn_at_point_pt", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 85" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "pixel_drawn_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 86" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "pixel_drawn_at_point_in_cell_pt", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 87" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 1 + }, + { + "type": "int", + "value": 1 + }, + { + "type": "int", + "value": 1 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "pixel_drawn_at_point_in_cell", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 88" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "bitmap_set_cell_details", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 1 + }, + { + "type": "int", + "value": 1 + }, + { + "type": "int", + "value": 1 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "setup_collision_mask", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 81" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 89" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "bitmap_circle_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "collision_before_mask" + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "bitmap_circle_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ], + "store_result": "collision_after_mask" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "collision_before_mask" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "collision_after_mask" + } + } + } + ] + }, + { + "name": "draw_line_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 82" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 83" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "option_line_width_with_options", + "args": [ + { + "type": "int", + "value": 3 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_point_to_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 84" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_point_to_point", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_point_to_point_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 85" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_point_to_point_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 86" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 87" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_bitmap_record", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 90" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_bitmap_record", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 95.0 + }, + { + "type": "double", + "value": 95.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_bitmap_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 91" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_bitmap_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 95.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_bitmap_point_to_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 92" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_bitmap_point_to_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_bitmap_point_to_point_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 93" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_bitmap_point_to_point_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 94" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 95.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 95" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_window_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 88" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "draw_line_on_window_record", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "arg": [] + }, + { + "type": "variable", + "variable_name": "test_line" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_window_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 89" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "draw_line_on_window_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "arg": [] + }, + { + "type": "variable", + "variable_name": "test_line" + }, + { + "type": "function", + "function_name": "option_defaults", + "arg": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_window_point_to_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 90" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_window_point_to_point", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_window_point_to_point_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 91" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_window_point_to_point_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 92" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_line_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 93" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_line_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_at_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 94" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_at_point", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_at_point_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 95" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_at_point_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 96" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 97" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_on_bitmap_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 96" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_on_bitmap_at_point_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 97" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap_at_point_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 98" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 51.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 99" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 51.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_on_window_at_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 98" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_window_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_on_window_at_point_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 99" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_window_at_point_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 100" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_pixel_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 101" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "get_pixel_from_bitmap_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 100" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 49.0 + }, + { + "type": "double", + "value": 49.0 + } + ] + } + ] + } + } + } + ] + }, + { + "name": "get_pixel_from_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 101" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 49.0 + }, + { + "type": "double", + "value": 49.0 + } + ] + } + } + } + ] + }, + { + "name": "get_pixel_at_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 102" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_at_point", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "get_pixel", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 103" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "get_pixel_from_window_at_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 104" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_at_point", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + ] + } + } + } + ] + }, + { + "name": "get_pixel_from_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 105" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "get_pixel_from_window_at_point_from_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 106" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_at_point", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window_at_point_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window_at_point_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + ] + } + } + } + ] + }, + { + "name": "get_pixel_from_window_from_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 107" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 99.0 + }, + { + "type": "double", + "value": 99.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_quad", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 108" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "draw_quad", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_quad_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 109" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "draw_quad_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_quad_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 102" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "draw_quad_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_quad_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 103" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "draw_quad_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_quad_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 110" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "draw_quad_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_quad_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 111" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "draw_quad_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 112" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "draw_rectangle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 301.0 + }, + { + "type": "double", + "value": 251.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 113" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "draw_rectangle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 114" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_rectangle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 301.0 + }, + { + "type": "double", + "value": 251.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 115" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_rectangle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "function", + "function_name": "option_line_width_with_options", + "args": [ + { + "type": "int", + "value": 3 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 101.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 301.0 + }, + { + "type": "double", + "value": 251.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_on_bitmap_record", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 104" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "draw_rectangle_on_bitmap_record", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 80.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_on_bitmap_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 105" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "draw_rectangle_on_bitmap_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 106" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 20.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 107" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_rectangle_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "double", + "value": 20.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_on_window_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 116" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "draw_rectangle_on_window_record", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_on_window_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 117" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "draw_rectangle_on_window_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 118" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_rectangle_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_rectangle_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 119" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_rectangle_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_quad", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 120" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "fill_quad", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 400.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_quad_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 121" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "fill_quad_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 400.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_quad_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 108" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "fill_quad_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_quad_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 109" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "fill_quad_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 95.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_quad_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 122" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "fill_quad_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_quad_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 123" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ], + "store_result": "test_quad" + }, + { + "type": "function", + "function_name": "fill_quad_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_quad" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 250.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 124" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "fill_rectangle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 275.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 125" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "fill_rectangle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 275.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 126" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 301.0 + }, + { + "type": "double", + "value": 251.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 127" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 301.0 + }, + { + "type": "double", + "value": 251.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_on_bitmap_record", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 110" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap_record", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_on_bitmap_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 111" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 112" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 113" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_on_window_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 128" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "fill_rectangle_on_window_record", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 275.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_on_window_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 129" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "fill_rectangle_on_window_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 275.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 130" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_rectangle_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 131" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_rectangle_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 175.0 + }, + { + "type": "double", + "value": 175.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_font_as_string", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 132" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_font_as_string", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_with_options_font_as_string", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 133" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_with_options_font_as_string", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_no_font_no_size", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 134" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 105.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_no_font_no_size_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 135" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size_with_options", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 105.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 136" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "font_named", + "args": [ + { + "type": "string", + "value": "hara" + } + ] + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 137" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_with_options", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "font_named", + "args": [ + { + "type": "string", + "value": "hara" + } + ] + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_bitmap_font_as_string", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 114" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_on_bitmap_font_as_string", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_bitmap_with_options_font_as_string", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 115" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_on_bitmap_with_options_font_as_string", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_bitmap_no_font_no_size", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 116" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_on_bitmap_no_font_no_size", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 105.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_bitmap_no_font_no_size_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 117" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_on_bitmap_no_font_no_size_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 105.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 118" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "font_named", + "args": [ + { + "type": "string", + "value": "hara" + } + ] + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 119" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "function", + "function_name": "font_named", + "args": [ + { + "type": "string", + "value": "hara" + } + ] + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_window_font_as_string", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 138" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_on_window_font_as_string", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_window_with_options_font_as_string", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 139" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_on_window_with_options_font_as_string", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_window_no_font_no_size", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 140" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_on_window_no_font_no_size", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 105.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_window_no_font_no_size_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 141" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_on_window_no_font_no_size_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 105.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 142" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_named", + "args": [ + { + "type": "string", + "value": "hara" + } + ], + "store_result": "test_font" + }, + { + "type": "function", + "function_name": "font_load_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_text_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 143" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "font_has_size_name_as_string", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_load_size_name_as_string", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 12 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "font_has_size_name_as_string", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 12 + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "Should show Asking if font has size on invalid font. warning:" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "font_has_size_name_as_string", + "args": [ + { + "type": "string", + "value": "nonexistent_font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "font_has_size", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_load_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "font_has_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "font_has_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 999 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "font_load_size_name_as_string", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_load_size_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "font_has_size_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "font_load_size", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_load_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "font_has_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "font_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 144" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_named", + "args": [ + { + "type": "string", + "value": "hara" + } + ], + "store_result": "test_font" + }, + { + "type": "function", + "function_name": "draw_text", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_font" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 110.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + } + } + } + ] + }, + { + "name": "free_all_fonts", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_font_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_all_fonts", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_font_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_font", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_font", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_font", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_font", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "get_font_style_name_as_string", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "get_font_style_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + } + ], + "store_result": "style" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "font_style", + "value": "bold_font" + }, + "value2": { + "type": "variable", + "variable_name": "style" + } + } + } + ] + }, + { + "name": "get_font_style", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "get_font_style", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ], + "store_result": "style" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "font_style", + "value": "bold_font" + }, + "value2": { + "type": "variable", + "variable_name": "style" + } + } + } + ] + }, + { + "name": "get_system_font", + "steps": [ + { + "type": "function", + "function_name": "get_system_font", + "args": [], + "store_result": "system_font" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "system_font" + }, + "value2": null + } + } + ] + }, + { + "name": "has_font", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_font", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_font", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_font", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_font_name_as_string", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_font_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_font_name_as_string", + "args": [ + { + "type": "string", + "value": "nonexistent_font" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "load_font", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 145" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "draw_text_with_options", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_font_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 105.0 + }, + { + "type": "double", + "value": 105.0 + } + ] + } + } + } + ] + }, + { + "name": "set_font_style_name_as_string", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "set_font_style_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "enum", + "enum_type": "font_style", + "value": "bold_font" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "font_style", + "value": "bold_font" + }, + "value2": { + "type": "function", + "function_name": "get_font_style_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + } + ] + } + } + } + ] + }, + { + "name": "set_font_style", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "set_font_style", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "enum", + "enum_type": "font_style", + "value": "bold_font" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "font_style", + "value": "bold_font" + }, + "value2": { + "type": "function", + "function_name": "get_font_style", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ] + } + } + } + ] + }, + { + "name": "text_height_font_named", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_load_size_name_as_string", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "int", + "value": 24 + } + ] + }, + { + "type": "function", + "function_name": "text_height_font_named", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "string", + "value": "Test Font" + }, + { + "type": "int", + "value": 24 + } + ], + "store_result": "height" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "height" + }, + "value2": { + "type": "int", + "value": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than_or_equal", + "value1": { + "type": "variable", + "variable_name": "height" + }, + "value2": { + "type": "int", + "value": 24 + } + } + } + ] + }, + { + "name": "text_height", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_load_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + } + ] + }, + { + "type": "function", + "function_name": "text_height", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + } + ], + "store_result": "height" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "height" + }, + "value2": { + "type": "int", + "value": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than_or_equal", + "value1": { + "type": "variable", + "variable_name": "height" + }, + "value2": { + "type": "int", + "value": 24 + } + } + } + ] + }, + { + "name": "text_width_font_named", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_load_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + { + "type": "function", + "function_name": "text_width_font_named", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 24 + } + ], + "store_result": "width" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "width" + }, + "value2": { + "type": "int", + "value": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than_or_equal", + "value1": { + "type": "variable", + "variable_name": "width" + }, + "value2": { + "type": "function", + "function_name": "text_height_font_named", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "string", + "value": "hara" + }, + { + "type": "int", + "value": 24 + } + ] + } + } + } + ] + }, + { + "name": "text_width", + "steps": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "Test Font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "font_load_size", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 12 + } + ] + }, + { + "type": "function", + "function_name": "text_width", + "args": [ + { + "type": "string", + "value": "Test Text" + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + } + ], + "store_result": "width" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "width" + }, + "value2": { + "type": "int", + "value": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than_or_equal", + "value1": { + "type": "variable", + "variable_name": "width" + }, + "value2": { + "type": "function", + "function_name": "text_height", + "args": [ + { + "type": "string", + "value": "Text Height" + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 24 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 146" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "draw_triangle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 147" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "draw_triangle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 148" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_triangle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 149" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_triangle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_on_bitmap_record", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 120" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "draw_triangle_on_bitmap_record", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_on_bitmap_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 121" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "draw_triangle_on_bitmap_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 122" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_triangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 123" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_triangle_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_on_window_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 150" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "draw_triangle_on_window_record", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_on_window_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 151" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 250.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "draw_triangle_on_window_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 152" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_triangle_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_triangle_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 153" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_triangle_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 154" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "fill_triangle_record", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 155" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "fill_triangle_record_with_options", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 156" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_triangle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 157" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_triangle_with_options", + "args": [ + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_red", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_on_bitmap_record", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 124" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "fill_triangle_on_bitmap_record", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_on_bitmap_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 125" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "fill_triangle_on_bitmap_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_on_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 126" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_triangle_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_on_bitmap_with_options", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 127" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_triangle_on_bitmap_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_on_window_record", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 158" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "fill_triangle_on_window_record", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_on_window_record_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 159" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ], + "store_result": "test_triangle" + }, + { + "type": "function", + "function_name": "fill_triangle_on_window_record_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_triangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_on_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 160" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_triangle_on_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + } + } + ] + }, + { + "name": "fill_triangle_on_window_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 161" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "fill_triangle_on_window_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 350.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/input.json b/coresdk/src/test/splashkit-test-generator/data/tests/input.json new file mode 100644 index 00000000..0b63b7b6 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/input.json @@ -0,0 +1,10419 @@ +{ + "group": "input", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "font", + "function_name": "free_all_fonts", + "args": [] + } + ], + "tests": [ + { + "name": "process_events", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 1" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_typed", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: process_events" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press A to test events" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Typed: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_typed", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "mouse_clicked", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: process_events" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click left mouse button to test events" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Clicked: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_clicked", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "quit_requested", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 2" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "quit_requested", + "args": [] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: quit_requested" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Close window to test quit requested" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Quit Requested: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "quit_requested", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "reset_quit", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "quit_requested", + "args": [] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: reset_quit" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Close window to test reset quit" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Quit Requested: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "quit_requested", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "reset_quit", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: reset_quit" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test after reset quit" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Down: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "any_key_pressed", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 4" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "any_key_pressed", + "args": [] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: any_key_pressed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press any key to test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Any Key Pressed: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "any_key_pressed", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "any_key_pressed", + "args": [] + } + } + } + ] + }, + { + "name": "deregister_callback_on_key_down", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "callbacks", + "class_name": "key_callbacks", + "args": [] + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 5" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "register_callback_on_key_down", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_down" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_down" + }, + "value2": { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: deregister_callback_on_key_down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press A to test callback" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Down: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_down" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "deregister_callback_on_key_down", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_down" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: deregister_callback_on_key_down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press B to test deregistered callback on key down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Down: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "b_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_down" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "deregister_callback_on_key_typed", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "callbacks", + "class_name": "key_callbacks", + "args": [] + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 6" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "register_callback_on_key_typed", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_typed" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_typed" + }, + "value2": { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: deregister_callback_on_key_typed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press A to test callback" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Typed: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_typed", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_typed" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "deregister_callback_on_key_typed", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_typed" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: deregister_callback_on_key_typed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press B to test deregistered callback on key typed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Typed: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_typed", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "b_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_typed" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "deregister_callback_on_key_up", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "callbacks", + "class_name": "key_callbacks", + "args": [] + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 7" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "register_callback_on_key_up", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_up" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_up" + }, + "value2": { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: deregister_callback_on_key_up" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press and release A to test callback" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Up: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_up", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_up" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "deregister_callback_on_key_up", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_up" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: deregister_callback_on_key_up" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press and release B to test deregistered callback on key up" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Up: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_up", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "b_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_up" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "key_down", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 8" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: key_down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press and hold A" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Down: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: key_down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Release A" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Down: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "key_name", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "callbacks", + "class_name": "key_callbacks", + "args": [] + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 9" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "register_callback_on_key_typed", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_typed" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: key_name" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press A to test key name" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Name: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_typed" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: key_name" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Enter to test key name" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Name: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_typed" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "deregister_callback_on_key_typed", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_typed" + } + ] + } + ] + }, + { + "name": "key_released", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 10" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_released", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: key_released" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press and release A" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Released: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_released", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "key_typed", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 11" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_typed", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: key_typed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press A to test key typed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Typed: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_typed", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "key_up", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 12" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_up", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: key_up" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press and release A" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Up: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_up", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "register_callback_on_key_down", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "callbacks", + "class_name": "key_callbacks", + "args": [] + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 13" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "register_callback_on_key_down", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_down" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_down" + }, + "value2": { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: register_callback_on_key_down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press A to test callback on key down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Down: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_down" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "deregister_callback_on_key_down", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_down" + } + ] + } + ] + }, + { + "name": "register_callback_on_key_typed", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "callbacks", + "class_name": "key_callbacks", + "args": [] + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 14" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "register_callback_on_key_typed", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_typed" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_typed" + }, + "value2": { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: register_callback_on_key_typed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press A to test callback on key typed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Typed: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_typed", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_typed" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "deregister_callback_on_key_typed", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_typed" + } + ] + } + ] + }, + { + "name": "register_callback_on_key_up", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "callbacks", + "class_name": "key_callbacks", + "args": [] + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 15" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "register_callback_on_key_up", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_up" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_up" + }, + "value2": { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: register_callback_on_key_up" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press and release A to test callback on key up" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Key Up: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_up", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "a_key" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Callback received: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "key_name", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "get_key_up" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "deregister_callback_on_key_up", + "args": [ + { + "type": "method_call", + "variable_name": "callbacks", + "method_name": "on_key_up" + } + ] + } + ] + }, + { + "name": "hide_mouse", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 16" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "h_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: hide_mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press H to hide mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Shown: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "hide_mouse", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: hide_mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Shown: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "show_mouse", + "args": [] + } + ] + }, + { + "name": "mouse_clicked", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 17" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "mouse_clicked", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_clicked" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click left mouse button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Clicked: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_clicked", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "mouse_down", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 18" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "mouse_down", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press and hold left mouse button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Down: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_down", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "function", + "function_name": "mouse_down", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_down" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Release left mouse button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Down: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_down", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "mouse_movement", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 19" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "mouse_movement", + "args": [], + "store_result": "movement" + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_movement" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Move mouse to test movement" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Movement: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "variable_field", + "variable_name": "movement", + "variable_field": "x" + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "variable_field", + "variable_name": "movement", + "variable_field": "y" + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "mouse_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 20" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "mouse_position", + "args": [], + "store_result": "position" + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Move mouse to test position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Position: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "x" + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "y" + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "mouse_position_vector", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 21" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "mouse_position_vector", + "args": [], + "store_result": "position" + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_position_vector" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Move mouse to test position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Position: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "x" + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "y" + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "mouse_shown", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 22" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "h_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_shown" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press H to hide mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Shown: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "hide_mouse", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "s_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_shown" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press S to show mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Shown: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "show_mouse", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + } + ] + }, + { + "name": "mouse_up", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 23" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "mouse_up", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_up" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click and release left mouse button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Up: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_up", + "args": [ + { + "type": "enum", + "enum_type": "mouse_button", + "value": "left_button" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "mouse_wheel_scroll", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 24" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "mouse_wheel_scroll", + "args": [], + "store_result": "scroll" + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_wheel_scroll" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Scroll mouse wheel to test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Scroll Value: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "variable_field", + "variable_name": "scroll", + "variable_field": "x" + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "variable_field", + "variable_name": "scroll", + "variable_field": "y" + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "mouse_x", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 25" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_x" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Move mouse to test X position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Position: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_x", + "args": [] + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_y", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "mouse_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 26" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: mouse_y" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Move mouse to test Y position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Position: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_x", + "args": [] + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_y", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "move_mouse", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 27" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "m_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: move_mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press M to move mouse to center" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Position: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_x", + "args": [] + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_y", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: move_mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Mouse moved to center" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Position: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_x", + "args": [] + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_y", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "move_mouse", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "move_mouse_to_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 28" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "m_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: move_mouse_to_point" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press M to move mouse to center" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Position: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_x", + "args": [] + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_y", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: move_mouse_to_point" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Mouse moved to center" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Position: X=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_x", + "args": [] + } + }, + { + "type": "text", + "value": ", Y=" + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_y", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "move_mouse_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "show_mouse", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 29" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "hide_mouse", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "s_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: show_mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press S to show mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Shown: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "show_mouse", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: show_mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Shown: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "show_mouse_with_boolean", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 30" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "h_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: show_mouse_with_boolean" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press H to hide mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Shown: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "show_mouse_with_boolean", + "args": [ + { + "type": "bool", + "value": false + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "s_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: show_mouse_with_boolean" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press S to show mouse" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Mouse Shown: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "show_mouse_with_boolean", + "args": [ + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "mouse_shown", + "args": [] + } + } + } + ] + }, + { + "name": "draw_collected_text", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 31" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "test_font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "start_reading_text", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: draw_collected_text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_collected_text", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 18 + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text", + "args": [] + } + ] + }, + { + "name": "end_reading_text", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 32" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "start_reading_text", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: end_reading_text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Reading Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: end_reading_text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Text input ended" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Reading Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "end_reading_text_in_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 33" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "start_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: end_reading_text_in_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Reading Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: end_reading_text_in_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Text input ended" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Reading Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "reading_text", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 34" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "start_reading_text", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: reading_text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Reading Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + } + ] + }, + { + "name": "reading_text_in_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 35" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "start_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: reading_text_in_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Reading Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "start_reading_text", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 36" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "start_reading_text", + "args": [ + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_reading_text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Current Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "text_input", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + } + ] + }, + { + "name": "start_reading_text_with_initial_text", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 37" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "start_reading_text_with_initial_text", + "args": [ + { + "type": "variable", + "variable_name": "test_rect" + }, + { + "type": "string", + "value": "Initial Text" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_reading_text_with_initial_text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Current Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "text_input", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + } + ] + }, + { + "name": "start_reading_text_in_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 38" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "start_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_reading_text_in_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Current Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "text_input_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + } + ] + }, + { + "name": "start_reading_text_in_window_with_initial_text", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 39" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "start_reading_text_in_window_with_initial_text", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rect" + }, + { + "type": "string", + "value": "Initial Text" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_reading_text_in_window_with_initial_text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Current Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "text_input_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "reading_text", + "args": [] + } + } + } + ] + }, + { + "name": "text_entry_cancelled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 40" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "start_reading_text", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: text_entry_cancelled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Escape to cancel text entry" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Text Entry Cancelled: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "text_entry_cancelled", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text", + "args": [] + } + ] + }, + { + "name": "text_entry_cancelled_in_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 41" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "start_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: text_entry_cancelled_in_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press Escape to cancel text entry" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Text Entry Cancelled: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "text_entry_cancelled_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + ] + }, + { + "name": "text_input", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 42" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "start_reading_text", + "args": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: text_input" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Current Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "text_input", + "args": [] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text", + "args": [] + } + ] + }, + { + "name": "text_input_in_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 43" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "start_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "return_key" + } + ] + }, + "value2": { + "type": "bool", + "value": false + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: text_input_in_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Type some text, press Enter when done" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "interpolated_string", + "parts": [ + { + "type": "text", + "value": "Current Text: " + }, + { + "type": "interpolation", + "expression": { + "type": "function", + "function_name": "text_input_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + ] + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "end_reading_text_in_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/interface.json b/coresdk/src/test/splashkit-test-generator/data/tests/interface.json new file mode 100644 index 00000000..6aae8f94 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/interface.json @@ -0,0 +1,17145 @@ +{ + "group": "interface", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "bitmap", + "function_name": "free_all_bitmaps", + "args": [] + }, + { + "cleanup_type": "font", + "function_name": "free_all_fonts", + "args": [] + }, + { + "cleanup_type": "layout", + "function_name": "reset_layout", + "args": [] + }, + { + "cleanup_type": "interface_font", + "function_name": "set_interface_font", + "args": [] + } + ], + "tests": [ + { + "name": "add_column", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 1" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: add_column" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Two columns - first 100px wide, second fills remaining space" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 1" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_custom_layout", + "args": [] + }, + { + "type": "function", + "function_name": "add_column", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "add_column", + "args": [ + { + "type": "int", + "value": -1 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Left Column" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Right Column" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 1" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "add_column_relative", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 2" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: add_column_relative" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Two equal-width columns (50% each)" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 2" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_custom_layout", + "args": [] + }, + { + "type": "function", + "function_name": "add_column_relative", + "args": [ + { + "type": "double", + "value": 0.5 + } + ] + }, + { + "type": "function", + "function_name": "add_column_relative", + "args": [ + { + "type": "double", + "value": 0.5 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Left Column" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Right Column" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 2" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "bitmap_button", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 1" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: bitmap_button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A clickable button with a red bitmap image" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 3" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "set_layout_height", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "bitmap_button", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 3" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_button_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 4" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 2" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: bitmap_button_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A red bitmap button at position (100,100)" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "bitmap_button_at_position", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_button_at_position_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 5" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 3" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: bitmap_button_at_position_with_options" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A red bitmap button at position (100,100) with default options" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "bitmap_button_at_position_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_button_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 6" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 4" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [], + "store_result": "test_options1" + }, + { + "type": "function", + "function_name": "option_scale_bmp_with_options", + "args": [ + { + "type": "double", + "value": 0.5 + }, + { + "type": "double", + "value": 0.5 + }, + { + "type": "variable", + "variable_name": "test_options1" + } + ], + "store_result": "test_options2" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: bitmap_button_with_options" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A red bitmap button scaled to 50% size" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 4" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "set_layout_height", + "args": [ + { + "type": "int", + "value": 50 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "bitmap_button_with_options", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_options2" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 4" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_button_labeled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 7" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 5" + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 20 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: bitmap_button_labeled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A red bitmap button with label Click Me" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 5" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "bitmap_button_labeled", + "args": [ + { + "type": "string", + "value": "Click Me" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 5" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_button_labeled_with_options", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 8" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 6" + }, + { + "type": "int", + "value": 20 + }, + { + "type": "int", + "value": 20 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "option_defaults", + "args": [], + "store_result": "test_options1" + }, + { + "type": "function", + "function_name": "option_scale_bmp_with_options", + "args": [ + { + "type": "double", + "value": 0.5 + }, + { + "type": "double", + "value": 0.5 + }, + { + "type": "variable", + "variable_name": "test_options1" + } + ], + "store_result": "test_options2" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: bitmap_button_labeled_with_options" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A red bitmap button scaled to 50% with label Click Me" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 6" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "bitmap_button_labeled_with_options", + "args": [ + { + "type": "string", + "value": "Click Me" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_options2" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 6" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "button_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 9" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: button_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A button with text Click Me at position (100,100) with size 200x50" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "button_at_position", + "args": [ + { + "type": "string", + "value": "Click Me" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "button", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 10" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A button with text Click Me using default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 7" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Click Me" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 7" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "button_labeled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 11" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: button_labeled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A button with text Click Me and label Label: in a two-column layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 8" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "button_labeled", + "args": [ + { + "type": "string", + "value": "Label:" + }, + { + "type": "string", + "value": "Click Me" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 8" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "checkbox_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 12" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "initial_checkbox_result", + "value": false + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_checkbox_result", + "value": "initial_checkbox_result", + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "current_checkbox_result" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: checkbox_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A checkbox with text Test Checkbox at position (100,100) with size 200x50" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the checkbox to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_checkbox_result", + "function_name": "checkbox_at_position", + "args": [ + { + "type": "string", + "value": "Test Checkbox" + }, + { + "type": "variable", + "variable_name": "current_checkbox_result" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "current_checkbox_result" + }, + "value2": null + } + } + ] + }, + { + "name": "checkbox", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 13" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "initial_checkbox_result", + "value": false + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_checkbox_result", + "value": "initial_checkbox_result", + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "current_checkbox_result" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: checkbox" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A checkbox with text Test Checkbox using default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the checkbox to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 9" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_checkbox_result", + "function_name": "checkbox", + "args": [ + { + "type": "string", + "value": "Test Checkbox" + }, + { + "type": "variable", + "variable_name": "current_checkbox_result" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 9" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "current_checkbox_result" + }, + "value2": null + } + } + ] + }, + { + "name": "checkbox_labeled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 14" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "initial_checkbox_result", + "value": false + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_checkbox_result", + "value": "initial_checkbox_result", + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "current_checkbox_result" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: checkbox_labeled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A checkbox with text Check me and label Test Checkbox in a two-column layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the checkbox to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 10" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 110 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_checkbox_result", + "function_name": "checkbox_labeled", + "args": [ + { + "type": "string", + "value": "Test Checkbox" + }, + { + "type": "string", + "value": "Check me" + }, + { + "type": "variable", + "variable_name": "current_checkbox_result" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 10" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "current_checkbox_result" + }, + "value2": null + } + } + ] + }, + { + "name": "color_slider_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 15" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "initial_color" + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_color", + "value": "initial_color", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: color_slider_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A color slider using RGBA controls at position (100,100) with size 400x24" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the color and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_color", + "function_name": "color_slider_at_position", + "args": [ + { + "type": "variable", + "variable_name": "current_color" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 24.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "current_color" + }, + "value2": { + "type": "variable", + "variable_name": "initial_color" + } + } + } + ] + }, + { + "name": "color_slider", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 16" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "initial_color" + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_color", + "value": "initial_color", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: color_slider" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A color slider with RGBA controls using default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the color and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 11" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_color", + "function_name": "color_slider", + "args": [ + { + "type": "variable", + "variable_name": "current_color" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 11" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "quit_requested", + "args": [] + } + } + } + ] + }, + { + "name": "color_slider_labeled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 17" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "initial_color" + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_color", + "value": "initial_color", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: color_slider_labeled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A color slider with label Test Color Slider in a two-column layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the color and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 120 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 12" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_color", + "function_name": "color_slider_labeled", + "args": [ + { + "type": "string", + "value": "Test Color Slider" + }, + { + "type": "variable", + "variable_name": "current_color" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 12" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_color" + }, + "value2": { + "type": "variable", + "variable_name": "current_color" + } + } + } + ] + }, + { + "name": "disable_interface", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 18" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "interface_enabled", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "disable_interface", + "args": [] + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: disable_interface" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A button that is disabled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button and press space to verify that the button is disabled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 13" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Try to click me" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 13" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "interface_enabled", + "args": [] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "enable_interface", + "args": [] + } + ] + }, + { + "name": "draw_interface", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 19" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: draw_interface" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel at position (100,100) with size 200x200" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 14" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 14" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "enable_interface", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 20" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "disable_interface", + "args": [] + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: enable_interface" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Button should be disabled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to continue" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 15" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 15" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "interface_enabled", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "enable_interface", + "args": [] + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: enable_interface" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Button should be enabled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 16" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "button_clicked", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 16" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "interface_enabled", + "args": [] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "end_inset", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 21" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: end_inset" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: An inset with height 60 pixels containing a button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 17" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_inset", + "args": [ + { + "type": "string", + "value": "Test Inset" + }, + { + "type": "int", + "value": 60 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_inset", + "args": [ + { + "type": "string", + "value": "Test Inset" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 17" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "end_panel", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 22" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: end_panel" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel at position (100,100) with size 200x200 containing a button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 18" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 18" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "end_popup", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 23" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: end_popup" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Click the button to show a popup with a label" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 19" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Open Popup" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "open_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "start_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "single_line_layout", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "Test Label" + } + ] + }, + { + "type": "function", + "function_name": "end_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 19" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "end_treenode", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 24" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: end_treenode" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel containing a collapsible tree node with a button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 20" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "start_treenode", + "args": [ + { + "type": "string", + "value": "Test Node" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_treenode", + "args": [ + { + "type": "string", + "value": "Test Node" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 20" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "enter_column", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 25" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: enter_column" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel with a 100-pixel wide column containing a button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test Button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 21" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "add_column", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "enter_column", + "args": [] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "leave_column", + "args": [] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 21" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "get_interface_label_width", + "steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "get_interface_label_width", + "args": [], + "store_result": "test_label_width" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "variable", + "variable_name": "test_label_width" + } + } + } + ] + }, + { + "name": "header", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 26" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: header" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A collapsible header labeled Test Header with a button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 22" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "header", + "args": [ + { + "type": "string", + "value": "Test Header" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 22" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "hsb_color_slider_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 27" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "initial_color" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 24.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_color", + "value": "initial_color", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: hsb_color_slider_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A HSB color slider at position (100,100) with size 400x24" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the color and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_color", + "function_name": "hsb_color_slider_at_position", + "args": [ + { + "type": "variable", + "variable_name": "current_color" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "current_color" + }, + "value2": { + "type": "variable", + "variable_name": "initial_color" + } + } + } + ] + }, + { + "name": "hsb_color_slider", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 28" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "initial_color" + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_color", + "value": "initial_color", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: hsb_color_slider" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A HSB color slider using default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the color and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 23" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_color", + "function_name": "hsb_color_slider", + "args": [ + { + "type": "variable", + "variable_name": "current_color" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 23" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "current_color" + }, + "value2": { + "type": "variable", + "variable_name": "initial_color" + } + } + } + ] + }, + { + "name": "hsb_color_slider_labeled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 29" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "initial_color" + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "current_color", + "value": "initial_color", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: hsb_color_slider_labeled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A HSB color slider with label Color Slider in a two-column layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the color and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 24" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_color", + "function_name": "hsb_color_slider_labeled", + "args": [ + { + "type": "string", + "value": "Color Slider" + }, + { + "type": "variable", + "variable_name": "current_color" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 24" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "current_color" + }, + "value2": { + "type": "variable", + "variable_name": "initial_color" + } + } + } + ] + }, + { + "name": "interface_enabled", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "interface_enabled", + "args": [], + "store_result": "initial_state" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "initial_state" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "disable_interface", + "args": [] + }, + { + "type": "function", + "function_name": "interface_enabled", + "args": [], + "store_result": "disabled_state" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "variable", + "variable_name": "disabled_state" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "enable_interface", + "args": [] + }, + { + "type": "function", + "function_name": "interface_enabled", + "args": [], + "store_result": "enabled_state" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "enabled_state" + }, + "value2": null + } + } + ] + }, + { + "name": "interface_style_panel", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 30" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ], + "store_result": "panel_rectangle" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: interface_style_panel" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel with controls to adjust the interface style" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Adjust the style and press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "interface_style_panel", + "args": [ + { + "type": "variable", + "variable_name": "panel_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "label_element", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 31" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: label_element" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A label with text Test Label using default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 25" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "Test Label" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 25" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "label_element_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 32" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: label_element_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A label with text Test Label at position (100,100)" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "label_element_at_position", + "args": [ + { + "type": "string", + "value": "Test Label" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "last_element_changed", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 33" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "float", + "variable_name": "initial_value", + "value": 0.0, + "is_mutable": false + }, + { + "type": "variable", + "variable_type": "float", + "variable_name": "current_value", + "value": 0.0, + "is_mutable": true + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "element_changed", + "value": false, + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: last_element_changed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A slider that detects value changes" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Move the slider and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 26" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "current_value", + "function_name": "slider_labeled", + "args": [ + { + "type": "string", + "value": "Test Slider" + }, + { + "type": "variable", + "variable_name": "current_value" + }, + { + "type": "float", + "value": 0.0 + }, + { + "type": "float", + "value": 100.0 + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "last_element_changed", + "args": [] + } + }, + "then_steps": [ + { + "type": "reassignment", + "variable_name": "element_changed", + "reassignment_type": "bool", + "value": true + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 26" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "current_value" + }, + "value2": { + "type": "variable", + "variable_name": "initial_value" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "element_changed" + }, + "value2": null + } + } + ] + }, + { + "name": "last_element_confirmed", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 34" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "button_clicked", + "value": false, + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: last_element_confirmed" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A button that detects when clicked" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Click the button and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 27" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "last_element_confirmed", + "args": [] + } + }, + "then_steps": [ + { + "type": "reassignment", + "variable_name": "button_clicked", + "reassignment_type": "bool", + "value": true + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 27" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "button_clicked" + }, + "value2": null + } + } + ] + }, + { + "name": "leave_column", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 35" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: leave_column" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A button that appears after leaving a column with a width of 100" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 28" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_custom_layout", + "args": [] + }, + { + "type": "function", + "function_name": "add_column", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "add_column", + "args": [ + { + "type": "int", + "value": -1 + } + ] + }, + { + "type": "function", + "function_name": "enter_column", + "args": [] + }, + { + "type": "function", + "function_name": "leave_column", + "args": [] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 28" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "number_box_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 36" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "variable", + "variable_type": "float", + "variable_name": "test_result", + "value": 5.0, + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: number_box_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A number box at position (100,100) with size 200x30" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the number and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "test_result", + "function_name": "number_box_at_position", + "args": [ + { + "type": "variable", + "variable_name": "test_result" + }, + { + "type": "float", + "value": 1.0 + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "float", + "value": 5.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "number_box", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 37" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "float", + "variable_name": "test_result", + "value": 5.0, + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: number_box" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A number box with step size 1.0 using the default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the number and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 29" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "test_result", + "function_name": "number_box", + "args": [ + { + "type": "variable", + "variable_name": "test_result" + }, + { + "type": "float", + "value": 1.0 + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 29" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "float", + "value": 5.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "number_box_labeled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 38" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "float", + "variable_name": "test_result", + "value": 5.0, + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: number_box_labeled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A labeled number box with step size 1.0 using the default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the number and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 30" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "test_result", + "function_name": "number_box_labeled", + "args": [ + { + "type": "string", + "value": "Test Value" + }, + { + "type": "variable", + "variable_name": "test_result" + }, + { + "type": "float", + "value": 1.0 + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 30" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "float", + "value": 5.0 + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "open_popup", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 39" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: open_popup" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Click the button to show a popup with a label" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 31" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Open Popup" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "open_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "start_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "single_line_layout", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "Test Label" + } + ] + }, + { + "type": "function", + "function_name": "end_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 31" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "paragraph", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 40" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_font", + "args": [ + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "interface_font", + "store_result": "cleanup_interface_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "set_interface_font_size", + "args": [ + { + "type": "int", + "value": 12 + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: paragraph" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A paragraph of text that wraps correctly within the panel" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 32" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "paragraph", + "args": [ + { + "type": "string", + "value": "This is a test paragraph to check if the text wraps correctly. weguy YGWE FYw eiuofhWEOF wue fuhwbeuf WUEFU wue" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 32" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font_size", + "args": [ + { + "type": "int", + "value": 13 + } + ] + } + ] + }, + { + "name": "paragraph_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 41" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: paragraph_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A paragraph at position (100,100) with size 200x100" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "paragraph_at_position", + "args": [ + { + "type": "string", + "value": "This is a test paragraph to check if the text wraps correctly. weguy YGWE FYw eiuofhWEOF wue fuhwbeuf WUEFU wue" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "reset_layout", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 42" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: reset_layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: The second button should not be confined to the created columns after reset" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 33" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_custom_layout", + "args": [] + }, + { + "type": "function", + "function_name": "add_column", + "args": [ + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "add_column", + "args": [ + { + "type": "int", + "value": -1 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 1" + } + ] + }, + { + "type": "function", + "function_name": "reset_layout", + "args": [] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 2" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 33" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_accent_color", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 43" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_accent_color", + "args": [ + { + "type": "function", + "function_name": "color_red", + "args": [] + }, + { + "type": "float", + "value": 0.5 + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_accent_color" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A button with red accent color at 50% contrast" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 34" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 34" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_border_color", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 44" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_border_color", + "args": [ + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_border_color" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel and button with red borders" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 35" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 35" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_colors_auto", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 45" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_colors_auto", + "args": [ + { + "type": "function", + "function_name": "color_white", + "args": [] + }, + { + "type": "function", + "function_name": "color_blue", + "args": [] + }, + { + "type": "float", + "value": 0.5 + }, + { + "type": "float", + "value": 0.7 + }, + { + "type": "float", + "value": 0.3 + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_colors_auto" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel with white main color and blue accent color" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 36" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 36" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_element_color", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 46" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_element_color", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "float", + "value": 0.5 + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_element_color" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel with black element color at 50% contrast" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 37" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 37" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_element_shadows", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 47" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_element_shadows", + "args": [ + { + "type": "int", + "value": 10 + }, + { + "type": "function", + "function_name": "color_blue", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_element_shadows" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Elements with blue shadow (radius: 10, offset: 5,5)" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 38" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 38" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_font_font_as_string", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 48" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "interface_font", + "store_result": "cleanup_interface_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "demolition" + }, + { + "type": "string", + "value": "demolition.otf" + } + ] + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_font_font_as_string" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font_font_as_string", + "args": [ + { + "type": "string", + "value": "hara" + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Hara Font" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text uses Hara font" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Hara Font" + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font_font_as_string", + "args": [ + { + "type": "string", + "value": "demolition" + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Demolition Font" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 180.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text uses Demolition font" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Demolition Font" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_font", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 49" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "hara" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "hara_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "interface_font", + "store_result": "cleanup_interface_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "demolition" + }, + { + "type": "string", + "value": "demolition.otf" + } + ], + "store_result": "demolition_font" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_font" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font", + "args": [ + { + "type": "variable", + "variable_name": "hara_font" + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Hara Font" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text uses Hara font" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Hara Font" + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font", + "args": [ + { + "type": "variable", + "variable_name": "demolition_font" + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Demolition Font" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 180.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text uses Demolition font" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Demolition Font" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_font_size", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 50" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_font_size" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font_size", + "args": [ + { + "type": "int", + "value": 12 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Small Font" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text uses 12pt font size" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Small Font" + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font_size", + "args": [ + { + "type": "int", + "value": 16 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Medium Font" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 180.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text uses 16pt font size" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Medium Font" + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font_size", + "args": [ + { + "type": "int", + "value": 24 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Large Font" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 290.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text uses 24pt font size" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Large Font" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "set_interface_font_size", + "args": [ + { + "type": "int", + "value": 13 + } + ] + } + ] + }, + { + "name": "set_interface_label_width", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 51" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "get_interface_label_width", + "args": [] + } + } + } + ] + }, + { + "name": "set_interface_panel_shadows", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 52" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_panel_shadows", + "args": [ + { + "type": "int", + "value": 10 + }, + { + "type": "function", + "function_name": "color_blue", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_panel_shadows" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel with blue shadow (10px radius, 5px offset)" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 39" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 39" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_root_text_color", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 53" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_root_text_color", + "args": [ + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_root_text_color" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Text outside panels should be red, text inside panels unchanged" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "label_element_at_position", + "args": [ + { + "type": "string", + "value": "This text should be red (outside panel)" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 20.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 40" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 120.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text should be normal (inside panel)" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 40" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_shadows", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 54" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_shadows", + "args": [ + { + "type": "int", + "value": 10 + }, + { + "type": "function", + "function_name": "color_blue", + "args": [] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_shadows" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Panel and button with blue shadows (10px radius, 5px offset)" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 41" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 41" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_spacing", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 55" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_interface_spacing", + "args": [ + { + "type": "int", + "value": 10 + }, + { + "type": "int", + "value": 5 + } + ] + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_spacing" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Panel with buttons spaced 10px apart and 5px padding" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 42" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 1" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 2" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 42" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_style", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 56" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_style", + "args": [ + { + "type": "enum", + "enum_type": "interface_style", + "value": "bubble_multicolored" + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_style" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Panel and button with bubble multicolored style theme" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 43" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 43" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_style_with_color", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 57" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_style_with_color", + "args": [ + { + "type": "enum", + "enum_type": "interface_style", + "value": "shaded_dark_style" + }, + { + "type": "function", + "function_name": "color_blue", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_style_with_color" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Panel and button with shaded dark style theme in blue" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 44" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 44" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_interface_text_color", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 58" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_text_color", + "args": [ + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_interface_text_color" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Panel with red text inside" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 45" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "This text should be red" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 45" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "set_layout_height", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 59" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: set_layout_height" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Button with 100px height" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 46" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "set_layout_height", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 46" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "single_line_layout", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 60" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: single_line_layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Two buttons arranged horizontally in a single line" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 47" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "single_line_layout", + "args": [] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 1" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 2" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 47" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "slider_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 61" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "variable", + "variable_type": "float", + "variable_name": "initial_value", + "value": 50.0 + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "slider_result", + "value": "initial_value", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: slider_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Slider with initial value 50, range 0-100 at position (100,100)" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the value and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "slider_result", + "function_name": "slider_at_position", + "args": [ + { + "type": "variable", + "variable_name": "slider_result" + }, + { + "type": "float", + "value": 0.0 + }, + { + "type": "float", + "value": 100.0 + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_value" + }, + "value2": { + "type": "variable", + "variable_name": "slider_result" + } + } + } + ] + }, + { + "name": "slider", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 62" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "float", + "variable_name": "initial_value", + "value": 50.0 + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "slider_result", + "value": "initial_value", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: slider" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Slider with initial value 50, range 0-100 using default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the value and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 48" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "slider_result", + "function_name": "slider", + "args": [ + { + "type": "variable", + "variable_name": "slider_result" + }, + { + "type": "float", + "value": 0.0 + }, + { + "type": "float", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 48" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_value" + }, + "value2": { + "type": "variable", + "variable_name": "slider_result" + } + } + } + ] + }, + { + "name": "slider_labeled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 63" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "float", + "variable_name": "initial_value", + "value": 50.0 + }, + { + "type": "variable", + "variable_type": "reference", + "variable_name": "slider_result", + "value": "initial_value", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: slider_labeled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Labeled slider with initial value 50, range 0-100 using default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the value and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 49" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "slider_result", + "function_name": "slider_labeled", + "args": [ + { + "type": "string", + "value": "Test Slider" + }, + { + "type": "variable", + "variable_name": "slider_result" + }, + { + "type": "float", + "value": 0.0 + }, + { + "type": "float", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 49" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_value" + }, + "value2": { + "type": "variable", + "variable_name": "slider_result" + } + } + } + ] + }, + { + "name": "split_into_columns", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 64" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: split_into_columns" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Three buttons arranged in equal columns" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 50" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_custom_layout", + "args": [] + }, + { + "type": "function", + "function_name": "split_into_columns", + "args": [ + { + "type": "int", + "value": 3 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 1" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 2" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 3" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 50" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "split_into_columns_with_last_width", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 65" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: split_into_columns_with_last_width" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Three buttons with last column width 200px" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 51" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_custom_layout", + "args": [] + }, + { + "type": "function", + "function_name": "split_into_columns_with_last_width", + "args": [ + { + "type": "int", + "value": 3 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 1" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 2" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 3" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 51" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "split_into_columns_relative_with_last_width", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 66" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: split_into_columns_relative_with_last_width" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Three buttons with last column 50% of panel width" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 52" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_custom_layout", + "args": [] + }, + { + "type": "function", + "function_name": "split_into_columns_relative_with_last_width", + "args": [ + { + "type": "int", + "value": 3 + }, + { + "type": "double", + "value": 0.5 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 1" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 2" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Button 3" + } + ] + }, + { + "type": "function", + "function_name": "reset_layout", + "args": [] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 52" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "start_custom_layout", + "steps": [ + { + "type": "cleanup", + "args": [], + "cleanup_type": "layout", + "store_result": "cleanup_layout" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 67" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_custom_layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Button in 200px wide column" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 53" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_custom_layout", + "args": [] + }, + { + "type": "function", + "function_name": "add_column", + "args": [ + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 53" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "start_inset_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 68" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_inset_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: An inset at position (10,70) containing a button using default layout" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_inset_at_position", + "args": [ + { + "type": "string", + "value": "test_inset" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_inset", + "args": [ + { + "type": "string", + "value": "test_inset" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "start_inset", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 69" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_inset" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: An inset with height 60 pixels containing a button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 54" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "start_inset", + "args": [ + { + "type": "string", + "value": "Test Inset" + }, + { + "type": "int", + "value": 60 + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_inset", + "args": [ + { + "type": "string", + "value": "Test Inset" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 54" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "start_panel", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 70" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_panel" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Panel with button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 55" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 55" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "start_popup", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 71" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_popup" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Click the button to show a popup with a label" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 56" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 800.0 + }, + { + "type": "double", + "value": 530.0 + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Open Popup" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "open_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "start_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "single_line_layout", + "args": [] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "label_element", + "args": [ + { + "type": "string", + "value": "Test Label" + } + ] + }, + { + "type": "function", + "function_name": "end_popup", + "args": [ + { + "type": "string", + "value": "Test Popup" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 56" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "start_treenode", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 72" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: start_treenode" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: A panel containing a collapsible tree node with a button" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Press space to end test" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 57" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "if", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "start_treenode", + "args": [ + { + "type": "string", + "value": "Test Node" + } + ] + } + }, + "then_steps": [ + { + "type": "function", + "function_name": "button", + "args": [ + { + "type": "string", + "value": "Test Button" + } + ] + }, + { + "type": "function", + "function_name": "end_treenode", + "args": [ + { + "type": "string", + "value": "Test Node" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 57" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + } + ] + }, + { + "name": "text_box", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 73" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "string", + "variable_name": "initial_text", + "value": "Initial Text" + }, + { + "type": "variable", + "variable_type": "string_ref", + "variable_name": "text_result", + "value": "initial_text", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: text_box" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Text box with editable text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the text and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 58" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "text_result", + "function_name": "text_box", + "args": [ + { + "type": "variable", + "variable_name": "text_result" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 58" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_text" + }, + "value2": { + "type": "variable", + "variable_name": "text_result" + } + } + } + ] + }, + { + "name": "text_box_at_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 74" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 30.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "variable", + "variable_type": "string", + "variable_name": "initial_text", + "value": "Initial Text" + }, + { + "type": "variable", + "variable_type": "string_ref", + "variable_name": "text_result", + "value": "initial_text", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: text_box_at_position" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Text box at position (10,70) with size 300x30" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the text and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "text_result", + "function_name": "text_box_at_position", + "args": [ + { + "type": "variable", + "variable_name": "text_result" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_text" + }, + "value2": { + "type": "variable", + "variable_name": "text_result" + } + } + } + ] + }, + { + "name": "text_box_labeled", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 75" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "variable", + "variable_type": "string", + "variable_name": "initial_text", + "value": "Initial Text" + }, + { + "type": "variable", + "variable_type": "string_ref", + "variable_name": "text_result", + "value": "initial_text", + "is_mutable": true + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "key_down", + "args": [ + { + "type": "enum", + "enum_type": "key_code", + "value": "space_key" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: text_box_labeled" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Expected: Labeled text box with editable text" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 30.0 + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Change the text and press space to pass" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "start_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 59" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 70.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "set_interface_label_width", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "reassignment", + "reassignment_type": "function", + "variable_name": "text_result", + "function_name": "text_box_labeled", + "args": [ + { + "type": "string", + "value": "Test Text Box" + }, + { + "type": "variable", + "variable_name": "text_result" + } + ] + }, + { + "type": "function", + "function_name": "end_panel", + "args": [ + { + "type": "string", + "value": "Test Panel 59" + } + ] + }, + { + "type": "function", + "function_name": "draw_interface", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_text" + }, + "value2": { + "type": "variable", + "variable_name": "text_result" + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/json.json b/coresdk/src/test/splashkit-test-generator/data/tests/json.json new file mode 100644 index 00000000..f2c5ea15 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/json.json @@ -0,0 +1,2669 @@ +{ + "group": "json", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "json", + "function_name": "free_all_json", + "args": [] + } + ], + "tests": [ + { + "name": "create_json", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_json" + } + } + } + ] + }, + { + "name": "create_json_from_string", + "steps": [ + { + "type": "function", + "function_name": "create_json_from_string", + "args": [ + { + "type": "string", + "value": "{\\\"name\\\":\\\"John\\\",\\\"age\\\":30,\\\"city\\\":\\\"New York\\\"}" + } + ], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "json_has_key", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "name" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "John" + }, + "value2": { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "name" + } + ] + } + } + } + ] + }, + { + "name": "free_all_json", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json2" + }, + + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json1" + }, + { + "type": "string", + "value": "key" + }, + { + "type": "string", + "value": "value" + } + ] + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json2" + }, + { + "type": "string", + "value": "key" + }, + { + "type": "string", + "value": "value" + } + ] + }, + { + "type": "function", + "function_name": "json_count_keys", + "args": [ + { + "type": "variable", + "variable_name": "test_json1" + } + ], + "store_result": "count1" + }, + { + "type": "function", + "function_name": "json_count_keys", + "args": [ + { + "type": "variable", + "variable_name": "test_json2" + } + ], + "store_result": "count2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "variable", + "variable_name": "count1" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "variable", + "variable_name": "count2" + } + } + }, + { + "type": "function", + "function_name": "free_all_json", + "args": [] + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "Should show Invalid json object passed to json_count_keys warning" + } + ] + }, + { + "type": "function", + "function_name": "json_count_keys", + "args": [ + { + "type": "variable", + "variable_name": "test_json1" + } + ], + "store_result": "count1_after_free" + }, + { + "type": "function", + "function_name": "json_count_keys", + "args": [ + { + "type": "variable", + "variable_name": "test_json2" + } + ], + "store_result": "count2_after_free" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "variable", + "variable_name": "count1_after_free" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "variable", + "variable_name": "count2_after_free" + } + } + } + ] + }, + { + "name": "free_json", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "key" + }, + { + "type": "string", + "value": "value" + } + ] + }, + { + "type": "function", + "function_name": "free_json", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "json_has_key", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "key" + } + ] + } + } + } + ] + }, + { + "name": "json_count_keys", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "key1" + }, + { + "type": "string", + "value": "value1" + } + ] + }, + { + "type": "function", + "function_name": "json_set_number_integer", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "key2" + }, + { + "type": "int", + "value": 42 + } + ] + }, + { + "type": "function", + "function_name": "json_count_keys", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + } + ], + "store_result": "key_count" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "variable", + "variable_name": "key_count" + } + } + } + ] + }, + { + "name": "json_from_color", + "steps": [ + { + "type": "function", + "function_name": "color_bright_green", + "args": [], + "store_result": "test_color" + }, + { + "type": "function", + "function_name": "json_from_color", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ], + "store_result": "test_json" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "json_has_key", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "color" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "#00ff00ff" + }, + "value2": { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "color" + } + ] + } + } + } + ] + }, + { + "name": "json_from_file", + "steps": [ + { + "type": "function", + "function_name": "json_from_file", + "args": [ + { + "type": "string", + "value": "person.json" + } + ], + "store_result": "test_json" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_json" + } + } + }, + { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "firstName" + } + ], + "store_result": "test_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "John" + }, + "value2": { + "type": "variable", + "variable_name": "test_value" + } + } + } + ] + }, + { + "name": "json_from_string", + "steps": [ + { + "type": "function", + "function_name": "json_from_string", + "args": [ + { + "type": "string", + "value": "{\\\"name\\\":\\\"John\\\",\\\"age\\\":30,\\\"city\\\":\\\"New York\\\"}" + } + ], + "store_result": "test_json" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "John" + }, + "value2": { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "name" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 30 + }, + "value2": { + "type": "function", + "function_name": "json_read_number_as_int", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "age" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "New York" + }, + "value2": { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "city" + } + ] + } + } + } + ] + }, + { + "name": "json_has_key", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "key1" + }, + { + "type": "string", + "value": "value1" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "json_has_key", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "key1" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "json_has_key", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "key2" + } + ] + } + } + } + ] + }, + { + "name": "json_read_array_of_double", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_array_of_double", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "numbers" + }, + { + "type": "list", + "target_type": "double", + "value": [ + { + "type": "double", + "value": 1.1 + }, + { + "type": "double", + "value": 2.2 + }, + { + "type": "double", + "value": 3.3 + } + ] + } + ] + }, + { + "type": "variable", + "variable_name": "out_result", + "target_type": "double", + "variable_type": "list", + "value": [], + "is_mutable": true + }, + { + "type": "function", + "function_name": "json_read_array_of_double", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "numbers" + }, + { + "type": "ref", + "variable_name": "out_result" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 1.1 + }, + "value2": { + "type": "array_access", + "array_name": "out_result", + "index": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 2.2 + }, + "value2": { + "type": "array_access", + "array_name": "out_result", + "index": 1 + } + } + } + ] + }, + { + "name": "json_read_array_of_json", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json1" + }, + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json2" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json1" + }, + { + "type": "string", + "value": "key1" + }, + { + "type": "string", + "value": "value1" + } + ] + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json2" + }, + { + "type": "string", + "value": "key2" + }, + { + "type": "string", + "value": "value2" + } + ] + }, + { + "type": "variable", + "variable_name": "test_json_array", + "target_type": "json", + "variable_type": "list", + "value": [ + { + "type": "variable", + "variable_name": "test_json1" + }, + { + "type": "variable", + "variable_name": "test_json2" + } + ] + }, + { + "type": "function", + "function_name": "json_set_array_of_json", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "array_key" + }, + { + "type": "variable", + "variable_name": "test_json_array" + } + ] + }, + { + "type": "variable", + "variable_name": "out_result", + "target_type": "json", + "variable_type": "list", + "value": [], + "is_mutable": true + }, + { + "type": "function", + "function_name": "json_read_array_of_json", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "array_key" + }, + { + "type": "ref", + "variable_name": "out_result" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "size", + "variable_name": "out_result" + } + } + } + ] + }, + { + "name": "json_read_array_of_string", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_array_of_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_array" + }, + { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "item1" + }, + { + "type": "string", + "value": "item2" + }, + { + "type": "string", + "value": "item3" + } + ] + } + ] + }, + { + "type": "variable", + "variable_name": "out_result", + "target_type": "string", + "variable_type": "list", + "value": [], + "is_mutable": true + }, + { + "type": "function", + "function_name": "json_read_array_of_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_array" + }, + { + "type": "ref", + "variable_name": "out_result" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 3 + }, + "value2": { + "type": "size", + "variable_name": "out_result" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "item1" + }, + "value2": { + "type": "array_access", + "array_name": "out_result", + "index": 0 + } + } + } + ] + }, + { + "name": "json_read_array_of_bool", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_array_of_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "list", + "target_type": "bool", + "value": [ + { + "type": "bool", + "value": true + }, + { + "type": "bool", + "value": false + }, + { + "type": "bool", + "value": true + } + ] + } + ] + }, + { + "type": "variable", + "variable_name": "out_result", + "target_type": "bool", + "variable_type": "list", + "value": [], + "is_mutable": true + }, + { + "type": "function", + "function_name": "json_read_array_of_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "ref", + "variable_name": "out_result" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 3 + }, + "value2": { + "type": "size", + "variable_name": "out_result" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "array_access", + "array_name": "out_result", + "index": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "array_access", + "array_name": "out_result", + "index": 1 + } + } + } + ] + }, + { + "name": "json_read_bool", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "json_read_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ] + } + } + }, + { + "type": "function", + "function_name": "json_set_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "bool", + "value": false + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "json_read_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ] + } + } + } + ] + }, + { + "name": "json_read_number", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_number_float", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "float", + "value": 42.5 + } + ] + }, + { + "type": "function", + "function_name": "json_read_number", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 42.5 + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "json_read_number_as_double", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_number_double", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "double", + "value": 3.14 + } + ] + }, + { + "type": "function", + "function_name": "json_read_number_as_double", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.14 + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "json_read_number_as_int", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_number_integer", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "int", + "value": 42 + } + ] + }, + { + "type": "function", + "function_name": "json_read_number_as_int", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 42 + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + } + ] + }, + { + "name": "json_read_object", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "nested_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "nested_json" + }, + { + "type": "string", + "value": "test" + }, + { + "type": "string", + "value": "value" + } + ] + }, + { + "type": "function", + "function_name": "json_set_object", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "nestedObject" + }, + { + "type": "variable", + "variable_name": "nested_json" + } + ] + }, + { + "type": "function", + "function_name": "json_read_object", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "nestedObject" + } + ], + "store_result": "read_json" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "read_json" + } + } + } + ] + }, + { + "name": "json_read_string", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "string", + "value": "test_value" + } + ] + }, + { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ], + "store_result": "read_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "test_value" + }, + "value2": { + "type": "variable", + "variable_name": "read_value" + } + } + } + ] + }, + { + "name": "json_set_array_of_string", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_array_of_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "value1" + }, + { + "type": "string", + "value": "value2" + }, + { + "type": "string", + "value": "value3" + } + ] + } + ] + }, + { + "type": "variable", + "variable_name": "out_result", + "target_type": "string", + "variable_type": "list", + "value": [], + "is_mutable": true + }, + { + "type": "function", + "function_name": "json_read_array_of_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "ref", + "variable_name": "out_result" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "value1" + }, + { + "type": "string", + "value": "value2" + }, + { + "type": "string", + "value": "value3" + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "out_result" + } + } + } + ] + }, + { + "name": "json_set_array_of_double", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_array_of_double", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "numbers" + }, + { + "type": "list", + "target_type": "double", + "value": [ + { + "type": "double", + "value": 1.1 + }, + { + "type": "double", + "value": 2.2 + }, + { + "type": "double", + "value": 3.3 + } + ] + } + ] + }, + { + "type": "variable", + "variable_name": "out_result", + "target_type": "double", + "variable_type": "list", + "value": [], + "is_mutable": true + }, + { + "type": "function", + "function_name": "json_read_array_of_double", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "numbers" + }, + { + "type": "ref", + "variable_name": "out_result" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "double", + "value": [ + { + "type": "double", + "value": 1.1 + }, + { + "type": "double", + "value": 2.2 + }, + { + "type": "double", + "value": 3.3 + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "out_result" + } + } + } + ] + }, + { + "name": "json_set_array_of_bool", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_array_of_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "list", + "target_type": "bool", + "value": [ + { + "type": "bool", + "value": true + }, + { + "type": "bool", + "value": false + } + ] + } + ] + }, + { + "type": "variable", + "variable_name": "out_result", + "target_type": "bool", + "variable_type": "list", + "value": [], + "is_mutable": true + }, + { + "type": "function", + "function_name": "json_read_array_of_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "ref", + "variable_name": "out_result" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "bool", + "value": [ + { + "type": "bool", + "value": true + }, + { + "type": "bool", + "value": false + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "out_result" + } + } + } + ] + }, + { + "name": "json_set_array_of_json", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json1" + }, + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json2" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json1" + }, + { + "type": "string", + "value": "key1" + }, + { + "type": "string", + "value": "value1" + } + ] + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json2" + }, + { + "type": "string", + "value": "key2" + }, + { + "type": "string", + "value": "value2" + } + ] + }, + { + "type": "variable", + "variable_name": "test_json_array", + "variable_type": "list", + "target_type": "json", + "value": [ + { + "type": "variable", + "variable_name": "test_json1" + }, + { + "type": "variable", + "variable_name": "test_json2" + } + ] + }, + { + "type": "function", + "function_name": "json_set_array_of_json", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "array_key" + }, + { + "type": "variable", + "variable_name": "test_json_array" + } + ] + }, + { + "type": "variable", + "variable_name": "out_result", + "variable_type": "list", + "target_type": "json", + "value": [], + "is_mutable": true + }, + { + "type": "function", + "function_name": "json_read_array_of_json", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "array_key" + }, + { + "type": "ref", + "variable_name": "out_result" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "value1" + }, + "value2": { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "array_access", + "array_name": "out_result", + "index": 0 + }, + { + "type": "string", + "value": "key1" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "value2" + }, + "value2": { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "array_access", + "array_name": "out_result", + "index": 1 + }, + { + "type": "string", + "value": "key2" + } + ] + } + } + } + ] + }, + { + "name": "json_set_bool", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "json_has_key", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "json_read_bool", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ] + } + } + } + ] + }, + { + "name": "json_set_number_integer", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_number_integer", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "age" + }, + { + "type": "int", + "value": 30 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 30 + }, + "value2": { + "type": "function", + "function_name": "json_read_number_as_int", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "age" + } + ] + } + } + } + ] + }, + { + "name": "json_set_number_double", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_number_double", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "double", + "value": 3.14 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.14 + }, + "value2": { + "type": "function", + "function_name": "json_read_number_as_double", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ] + } + } + } + ] + }, + { + "name": "json_set_number_float", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_number_float", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "float", + "value": 3.14 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.140000104904175 + }, + "value2": { + "type": "function", + "function_name": "json_read_number", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ] + } + } + } + ] + }, + { + "name": "json_set_object", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_nested_json" + }, + { + "type": "function", + "function_name": "json_set_object", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "nested" + }, + { + "type": "variable", + "variable_name": "test_nested_json" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "json_has_key", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "nested" + } + ] + } + } + } + ] + }, + { + "name": "json_set_string", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + }, + { + "type": "string", + "value": "test_value" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "test_value" + }, + "value2": { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test_key" + } + ] + } + } + } + ] + }, + { + "name": "json_to_color", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "color" + }, + { + "type": "string", + "value": "#ff0000ff" + } + ] + }, + { + "type": "function", + "function_name": "json_to_color", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + } + ], + "store_result": "test_color" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "#ff0000ff" + }, + "value2": { + "type": "function", + "function_name": "color_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_color" + } + ] + } + } + } + ] + }, + { + "name": "json_to_file", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "testKey" + }, + { + "type": "string", + "value": "testValue" + } + ] + }, + { + "type": "function", + "function_name": "json_to_file", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "test.json" + } + ] + }, + { + "type": "function", + "function_name": "json_from_file", + "args": [ + { + "type": "string", + "value": "test.json" + } + ], + "store_result": "loaded_json" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "testValue" + }, + "value2": { + "type": "function", + "function_name": "json_read_string", + "args": [ + { + "type": "variable", + "variable_name": "loaded_json" + }, + { + "type": "string", + "value": "testKey" + } + ] + } + } + } + ] + }, + { + "name": "json_to_string", + "steps": [ + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "key" + }, + { + "type": "string", + "value": "value" + } + ] + }, + { + "type": "function", + "function_name": "json_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + } + ], + "store_result": "test_json_string" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "variable", + "variable_name": "test_json_string" + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/logging.json b/coresdk/src/test/splashkit-test-generator/data/tests/logging.json new file mode 100644 index 00000000..ac34894e --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/logging.json @@ -0,0 +1,279 @@ +{ + "group": "logging", + "cleanup": [ + { + "cleanup_type": "logger", + "function_name": "close_log_process", + "args": [] + } + ], + "tests": [ + { + "name": "close_log_process", + "steps": [ + { + "type": "function", + "function_name": "init_custom_logger_name_override_mode", + "args": [ + { + "type": "string", + "value": "test_logging1" + }, + { + "type": "bool", + "value": true + }, + { + "type": "enum", + "enum_type": "log_mode", + "value": "log_console_and_file" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "logger", + "store_result": "cleanup_logger" + }, + { + "type": "function", + "function_name": "log", + "args": [ + { + "type": "enum", + "enum_type": "log_level", + "value": "info" + }, + { + "type": "string", + "value": "This message should appear in both console and file." + } + ] + }, + { + "type": "function", + "function_name": "close_log_process", + "args": [] + } + ] + }, + { + "name": "init_custom_logger", + "steps": [ + { + "type": "function", + "function_name": "init_custom_logger", + "args": [ + { + "type": "enum", + "enum_type": "log_mode", + "value": "log_console" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "logger", + "store_result": "cleanup_logger" + }, + { + "type": "function", + "function_name": "log", + "args": [ + { + "type": "enum", + "enum_type": "log_level", + "value": "info" + }, + { + "type": "string", + "value": "This message should appear in the console." + } + ] + }, + { + "type": "function", + "function_name": "log", + "args": [ + { + "type": "enum", + "enum_type": "log_level", + "value": "info" + }, + { + "type": "string", + "value": "This message should appear in the console." + } + ] + }, + { + "type": "function", + "function_name": "init_custom_logger", + "args": [ + { + "type": "enum", + "enum_type": "log_mode", + "value": "log_file_only" + } + ] + }, + { + "type": "function", + "function_name": "log", + "args": [ + { + "type": "enum", + "enum_type": "log_level", + "value": "info" + }, + { + "type": "string", + "value": "This message should only appear in the log file." + } + ] + }, + { + "type": "function", + "function_name": "log", + "args": [ + { + "type": "enum", + "enum_type": "log_level", + "value": "info" + }, + { + "type": "string", + "value": "This message should only appear in the log file." + } + ] + } + ] + }, + { + "name": "init_custom_logger_name_override_mode", + "steps": [ + { + "type": "function", + "function_name": "init_custom_logger_name_override_mode", + "args": [ + { + "type": "string", + "value": "test_logging2" + }, + { + "type": "bool", + "value": true + }, + { + "type": "enum", + "enum_type": "log_mode", + "value": "log_console_and_file" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "logger", + "store_result": "cleanup_logger" + }, + { + "type": "function", + "function_name": "log", + "args": [ + { + "type": "enum", + "enum_type": "log_level", + "value": "info" + }, + { + "type": "string", + "value": "This message should appear in both console and file." + } + ] + }, + { + "type": "function", + "function_name": "init_custom_logger_name_override_mode", + "args": [ + { + "type": "string", + "value": "test_logging3" + }, + { + "type": "bool", + "value": false + }, + { + "type": "enum", + "enum_type": "log_mode", + "value": "log_file_only" + } + ] + }, + { + "type": "function", + "function_name": "log", + "args": [ + { + "type": "enum", + "enum_type": "log_level", + "value": "info" + }, + { + "type": "string", + "value": "This message should only appear in the file." + } + ] + } + ] + }, + { + "name": "log", + "steps": [ + { + "type": "function", + "function_name": "init_custom_logger_name_override_mode", + "args": [ + { + "type": "string", + "value": "test_logging4" + }, + { + "type": "bool", + "value": true + }, + { + "type": "enum", + "enum_type": "log_mode", + "value": "log_console_and_file" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "logger", + "store_result": "cleanup_logger" + }, + { + "type": "function", + "function_name": "log", + "args": [ + { + "type": "enum", + "enum_type": "log_level", + "value": "info" + }, + { + "type": "string", + "value": "This message should appear in both console and file." + } + ] + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/networking.json b/coresdk/src/test/splashkit-test-generator/data/tests/networking.json new file mode 100644 index 00000000..67266dcf --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/networking.json @@ -0,0 +1,10243 @@ +{ + "group": "networking", + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "server", + "function_name": "close_all_servers", + "args": [] + }, + { + "cleanup_type": "connection", + "function_name": "close_all_connections", + "args": [] + }, + { + "cleanup_type": "json", + "function_name": "free_all_json", + "args": [] + } + ], + "tests": [ + { + "name": "accept_all_new_connections", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "accept_all_new_connections", + "args": [], + "store_result": "connections_accepted" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "connections_accepted" + }, + "value2": null + } + } + ] + }, + { + "name": "accept_new_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "accept_new_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "connection_accepted" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "connection_accepted" + }, + "value2": null + } + } + ] + }, + { + "name": "broadcast_message", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection1" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection2" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection2" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "broadcast_message", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "broadcast_message_to_all", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection2" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection2" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "broadcast_message_to_all", + "args": [ + { + "type": "string", + "value": "Test Message" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "broadcast_message_to_server_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "broadcast_message_to_server_named", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "string", + "value": "Test Server" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "check_network_activity", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_new_connections", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "clear_messages_from_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "clear_messages_from_name", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "clear_messages_from_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "clear_messages_from_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "clear_messages_from_server", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "clear_messages_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_messages_on_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "close_all_connections", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_all_connections", + "args": [] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "close_all_servers", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server 1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server 2" + }, + { + "type": "unsigned_short", + "value": 5001 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server 1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server 2" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_all_servers", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server 1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server 2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "close_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "close_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ], + "store_result": "close_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "close_result" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "close_connection_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_connection_named", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ], + "store_result": "close_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "close_result" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "close_message", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "read_message", + "args": [], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_message" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_messages", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "close_server_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "close_server_named", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ], + "store_result": "close_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "close_result" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "close_server", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "close_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "close_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "close_result" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "connection_count_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "connection_count_named", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + } + } + } + ] + }, + { + "name": "connection_count", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "connection_count", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + } + } + ] + }, + { + "name": "connection_ip", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "connection_ip", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ], + "store_result": "test_ip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 2130706433 + }, + "value2": { + "type": "variable", + "variable_name": "test_ip" + } + } + } + ] + }, + { + "name": "connection_ip_from_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "connection_ip_from_name", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ], + "store_result": "test_ip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 2130706433 + }, + "value2": { + "type": "variable", + "variable_name": "test_ip" + } + } + } + ] + }, + { + "name": "connection_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "connection_named", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ], + "store_result": "retrieved_connection" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "retrieved_connection" + }, + "value2": null + } + } + ] + }, + { + "name": "connection_port", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "connection_port", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ], + "store_result": "test_port" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5000 + }, + "value2": { + "type": "variable", + "variable_name": "test_port" + } + } + } + ] + }, + { + "name": "connection_port_from_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "connection_port_from_name", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ], + "store_result": "test_port" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5000 + }, + "value2": { + "type": "variable", + "variable_name": "test_port" + } + } + } + ] + }, + { + "name": "create_server_with_port", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_server" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "create_server_with_port_and_protocol", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port_and_protocol", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + }, + { + "type": "enum", + "enum_type": "connection_type", + "value": "tcp" + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_server" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "dec_to_hex", + "steps": [ + { + "type": "function", + "function_name": "dec_to_hex", + "args": [ + { + "type": "unsigned_int", + "value": 2130706433 + } + ], + "store_result": "test_hex_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "0x7F000001" + }, + "value2": { + "type": "variable", + "variable_name": "test_hex_result" + } + } + } + ] + }, + { + "name": "fetch_new_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "fetch_new_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "new_connection" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "new_connection" + }, + "value2": null + } + } + ] + }, + { + "name": "has_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_messages", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_messages", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "test_message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "has_messages_on_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_messages_on_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_name", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_messages_on_server", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_messages_on_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_new_connections", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_new_connections", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "has_server", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "hex_str_to_ipv4", + "steps": [ + { + "type": "function", + "function_name": "hex_str_to_ipv4", + "args": [ + { + "type": "string", + "value": "0x7F000001" + } + ], + "store_result": "test_ipv4" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "127.0.0.1" + }, + "value2": { + "type": "variable", + "variable_name": "test_ipv4" + } + } + }, + { + "type": "function", + "function_name": "hex_str_to_ipv4", + "args": [ + { + "type": "string", + "value": "7F000001" + } + ], + "store_result": "test_ipv4_no_prefix" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "127.0.0.1" + }, + "value2": { + "type": "variable", + "variable_name": "test_ipv4_no_prefix" + } + } + } + ] + }, + { + "name": "hex_to_dec_string", + "steps": [ + { + "type": "function", + "function_name": "hex_to_dec_string", + "args": [ + { + "type": "string", + "value": "7F" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "127" + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + }, + { + "type": "function", + "function_name": "hex_to_dec_string", + "args": [ + { + "type": "string", + "value": "0x7F" + } + ], + "store_result": "test_result_with_prefix" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "127" + }, + "value2": { + "type": "variable", + "variable_name": "test_result_with_prefix" + } + } + } + ] + }, + { + "name": "ipv4_to_dec", + "steps": [ + { + "type": "function", + "function_name": "ipv4_to_dec", + "args": [ + { + "type": "string", + "value": "127.0.0.1" + } + ], + "store_result": "test_result1" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 2130706433 + }, + "value2": { + "type": "variable", + "variable_name": "test_result1" + } + } + }, + { + "type": "function", + "function_name": "ipv4_to_dec", + "args": [ + { + "type": "string", + "value": "192.168.1.1" + } + ], + "store_result": "test_result2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 3232235777 + }, + "value2": { + "type": "variable", + "variable_name": "test_result2" + } + } + } + ] + }, + { + "name": "ipv4_to_hex", + "steps": [ + { + "type": "function", + "function_name": "ipv4_to_hex", + "args": [ + { + "type": "string", + "value": "127.0.0.1" + } + ], + "store_result": "test_ipv4_hex" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "0x7F000001" + }, + "value2": { + "type": "variable", + "variable_name": "test_ipv4_hex" + } + } + } + ] + }, + { + "name": "ipv4_to_str", + "steps": [ + { + "type": "function", + "function_name": "ipv4_to_str", + "args": [ + { + "type": "unsigned_int", + "value": 2130706433 + } + ], + "store_result": "test_ip_str" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "127.0.0.1" + }, + "value2": { + "type": "variable", + "variable_name": "test_ip_str" + } + } + } + ] + }, + { + "name": "is_connection_open", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "is_connection_open_from_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_connection_open_from_name", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_connection_open_from_name", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "last_connection_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "last_connection_named", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ], + "store_result": "test_last_connection" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_connection" + }, + "value2": { + "type": "variable", + "variable_name": "test_last_connection" + } + } + } + ] + }, + { + "name": "last_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "last_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_last_connection" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_connection" + }, + "value2": { + "type": "variable", + "variable_name": "test_last_connection" + } + } + } + ] + }, + { + "name": "message_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_connection" + }, + "value2": { + "type": "function", + "function_name": "message_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "message_count_on_server", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "message_count_on_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + } + } + ] + }, + { + "name": "message_count_on_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "message_count_on_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": { + "type": "int", + "value": 0 + } + } + } + ] + }, + { + "name": "message_count_from_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "message_count_on_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + } + } + ] + }, + { + "name": "message_data", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Message" + }, + "value2": { + "type": "function", + "function_name": "message_data", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "message_data_bytes", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_message" + }, + { + "type": "function", + "function_name": "message_data_bytes", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ], + "store_result": "test_message_bytes" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_empty", + "value1": { + "type": "variable", + "variable_name": "test_message_bytes" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "message_host", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "127.0.0.1" + }, + "value2": { + "type": "function", + "function_name": "message_host", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "message_port", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5000 + }, + "value2": { + "type": "function", + "function_name": "message_port", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "message_protocol", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port_and_protocol", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + }, + { + "type": "enum", + "enum_type": "connection_type", + "value": "udp" + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection_with_protocol", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + }, + { + "type": "enum", + "enum_type": "connection_type", + "value": "udp" + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "connection_type", + "value": "udp" + }, + "value2": { + "type": "function", + "function_name": "message_protocol", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "my_ip", + "steps": [ + { + "type": "function", + "function_name": "my_ip", + "args": [], + "store_result": "test_ip" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "127.0.0.1" + }, + "value2": { + "type": "variable", + "variable_name": "test_ip" + } + } + } + ] + }, + { + "name": "name_for_connection", + "steps": [ + { + "type": "function", + "function_name": "name_for_connection", + "args": [ + { + "type": "string", + "value": "localhost" + }, + { + "type": "unsigned_int", + "value": 8080 + } + ], + "store_result": "test_connection_name" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "localhost:8080" + }, + "value2": { + "type": "variable", + "variable_name": "test_connection_name" + } + } + } + ] + }, + { + "name": "new_connection_count", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "new_connection_count", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + } + } + ] + }, + { + "name": "open_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_connection" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "open_connection_with_protocol", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port_and_protocol", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + }, + { + "type": "enum", + "enum_type": "connection_type", + "value": "tcp" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection_with_protocol", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + }, + { + "type": "enum", + "enum_type": "connection_type", + "value": "tcp" + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_connection" + }, + "value2": null + } + } + ] + }, + { + "name": "read_message", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message", + "args": [], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Message" + }, + "value2": { + "type": "function", + "function_name": "message_data", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "read_message_from_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Message" + }, + "value2": { + "type": "function", + "function_name": "message_data", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "read_message_from_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_name", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Message" + }, + "value2": { + "type": "function", + "function_name": "message_data", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "read_message_from_server", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "read_message_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_message" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Message" + }, + "value2": { + "type": "function", + "function_name": "message_data", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + } + }, + { + "type": "function", + "function_name": "close_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "close_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + { + "type": "function", + "function_name": "close_message", + "args": [ + { + "type": "variable", + "variable_name": "test_message" + } + ] + } + ] + }, + { + "name": "read_message_data_from_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Message" + }, + "value2": { + "type": "function", + "function_name": "read_message_data_from_name", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + } + } + } + ] + }, + { + "name": "read_message_data_from_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Message" + }, + "value2": { + "type": "function", + "function_name": "read_message_data_from_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + } + } + } + ] + }, + { + "name": "read_message_data_from_server", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Message" + }, + "value2": { + "type": "function", + "function_name": "read_message_data_from_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + } + } + ] + }, + { + "name": "reconnect", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "close_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "reconnect", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "reconnect_from_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "close_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_connection_open", + "args": [ + { + "type": "variable", + "variable_name": "test_connection" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "reconnect_from_name", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_connection_open_from_name", + "args": [ + { + "type": "string", + "value": "test_connection" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "release_all_connections", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection1" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection2" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_connection", + "args": [ + { + "type": "string", + "value": "test_connection1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_connection", + "args": [ + { + "type": "string", + "value": "test_connection2" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "release_all_connections", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_connection", + "args": [ + { + "type": "string", + "value": "test_connection1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_connection", + "args": [ + { + "type": "string", + "value": "test_connection2" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_server", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "reset_new_connection_count", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "new_connection_count", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + } + }, + { + "type": "function", + "function_name": "reset_new_connection_count", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "new_connection_count", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + } + } + ] + }, + { + "name": "retrieve_connection_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "retrieve_connection_named", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "int", + "value": 0 + } + ], + "store_result": "retrieved_connection" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_connection" + }, + "value2": { + "type": "variable", + "variable_name": "retrieved_connection" + } + } + } + ] + }, + { + "name": "retrieve_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "retrieve_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + }, + { + "type": "int", + "value": 0 + } + ], + "store_result": "retrieved_connection" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_connection" + }, + "value2": { + "type": "variable", + "variable_name": "retrieved_connection" + } + } + } + ] + }, + { + "name": "send_message_to_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_connection" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_connection", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "variable", + "variable_name": "test_connection" + } + ], + "store_result": "send_result" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "send_result" + }, + "value2": null + } + } + ] + }, + { + "name": "send_message_to_name", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "function", + "function_name": "send_message_to_name", + "args": [ + { + "type": "string", + "value": "Test Message" + }, + { + "type": "string", + "value": "test_connection" + } + ], + "store_result": "send_result" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "send_result" + }, + "value2": null + } + } + ] + }, + { + "name": "server_has_new_connection_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "server_has_new_connection_named", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "server_has_new_connection", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "open_connection", + "args": [ + { + "type": "string", + "value": "test_connection" + }, + { + "type": "string", + "value": "127.0.0.1" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "connection", + "store_result": "cleanup_connection" + }, + { + "type": "function", + "function_name": "check_network_activity", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "server_has_new_connection", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "server_named", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 5000 + } + ], + "store_result": "test_server" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "server_named", + "args": [ + { + "type": "string", + "value": "Test Server" + } + ], + "store_result": "retrieved_server" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_server" + }, + "value2": { + "type": "variable", + "variable_name": "retrieved_server" + } + } + } + ] + }, + { + "name": "set_udp_packet_size", + "steps": [ + { + "type": "function", + "function_name": "set_udp_packet_size", + "args": [ + { + "type": "unsigned_int", + "value": 1024 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 1024 + }, + "value2": { + "type": "function", + "function_name": "udp_packet_size", + "args": [] + } + } + } + ] + }, + { + "name": "udp_packet_size", + "steps": [ + { + "type": "function", + "function_name": "udp_packet_size", + "args": [], + "store_result": "test_packet_size" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "test_packet_size" + }, + "value2": { + "type": "int", + "value": 0 + } + } + } + ] + }, + { + "name": "download_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "download_bitmap", + "args": [ + { + "type": "string", + "value": "test_image" + }, + { + "type": "string", + "value": "http://localhost:8080/test/resources/images/frog.png" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_bitmap" + }, + "value2": null + } + } + ] + }, + { + "name": "download_font", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "download_font", + "args": [ + { + "type": "string", + "value": "test_font" + }, + { + "type": "string", + "value": "http://localhost:8080/test/resources/fonts/hara.ttf" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_font" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_font" + }, + "value2": null + } + } + ] + }, + { + "name": "download_music", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "download_music", + "args": [ + { + "type": "string", + "value": "test_music" + }, + { + "type": "string", + "value": "http://localhost:8080/test/resources/music/280.mp3" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_music" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_music" + }, + "value2": null + } + } + ] + }, + { + "name": "download_sound_effect", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "download_sound_effect", + "args": [ + { + "type": "string", + "value": "test_sound" + }, + { + "type": "string", + "value": "http://localhost:8080/test/resources/sounds/breakdance.wav" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_sound_effect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sound_effect" + }, + "value2": null + } + } + ] + }, + { + "name": "free_response", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_response" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "null", + "value1": { + "type": "variable", + "variable_name": "test_response" + } + } + } + ] + }, + { + "name": "http_get", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_response" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "http_response_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ], + "store_result": "response_text" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_empty", + "value1": { + "type": "variable", + "variable_name": "response_text" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + } + ] + }, + { + "name": "http_post_with_headers", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "variable", + "variable_name": "headers", + "variable_type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "Content-Type: application/json" + }, + { + "type": "string", + "value": "Accept: application/json" + } + ] + }, + { + "type": "function", + "function_name": "http_post_with_headers", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + }, + { + "type": "string", + "value": "Test Body" + }, + { + "type": "variable", + "variable_name": "headers" + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_response" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "http_response_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ], + "store_result": "response_text" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "contains", + "args": [ + { + "type": "variable", + "variable_name": "response_text" + }, + { + "type": "string", + "value": "Test Body" + } + ] + } + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + } + ] + }, + { + "name": "http_post", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "http_post", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + }, + { + "type": "string", + "value": "Test Body" + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_response" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "http_response_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ], + "store_result": "response_text" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "contains", + "args": [ + { + "type": "variable", + "variable_name": "response_text" + }, + { + "type": "string", + "value": "Test Body" + } + ] + } + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + } + ] + }, + { + "name": "http_response_to_string", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "http_response_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ], + "store_result": "response_text" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_empty", + "value1": { + "type": "variable", + "variable_name": "response_text" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + } + ] + }, + { + "name": "save_response_to_file", + "steps": [ + { + "type": "function", + "function_name": "create_server_with_port", + "args": [ + { + "type": "string", + "value": "Test Server" + }, + { + "type": "unsigned_short", + "value": 8080 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "server", + "store_result": "cleanup_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "variable", + "variable_type": "string", + "variable_name": "test_file", + "value": "test_output.txt" + }, + { + "type": "function", + "function_name": "save_response_to_file", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + }, + { + "type": "variable", + "variable_name": "test_file" + } + ] + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + } + ] + }, + { + "name": "has_incoming_requests", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "is_delete_request_for", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_delete_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "/test" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "is_get_request_for", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_get_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "/test" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "is_options_request_for", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_options_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "/test" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "is_post_request_for", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_post", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test_path" + }, + { + "type": "unsigned_short", + "value": 80 + }, + { + "type": "string", + "value": "test=123" + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_post_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "/test_path" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "is_put_request_for", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_put_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "/test" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "is_request_for", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_method", + "value": "http_get_method" + }, + { + "type": "string", + "value": "/test" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "is_trace_request_for", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_trace_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "/test" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "next_web_request", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "null", + "value1": { + "type": "variable", + "variable_name": "test_request" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "request_body", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_post", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + }, + { + "type": "string", + "value": "test body" + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "test body" + }, + "value2": { + "type": "function", + "function_name": "request_body", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + } + ] + } + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "request_has_query_parameter", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test?param1=value1" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "request_has_query_parameter", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "param1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "request_has_query_parameter", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "nonexistent_param" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "request_headers", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_empty", + "value1": { + "type": "function", + "function_name": "request_headers", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "request_method", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "http_method", + "value": "http_get_method" + }, + "value2": { + "type": "function", + "function_name": "request_method", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + } + ] + } + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "request_query_parameter", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test?param1=value1" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "request_query_parameter", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "param1" + }, + { + "type": "string", + "value": "default_value" + } + ], + "store_result": "test_result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "value1" + }, + "value2": { + "type": "variable", + "variable_name": "test_result" + } + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "request_query_string", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test?param1=value1" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "request_query_string", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + } + ], + "store_result": "test_query_string" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "param1=value1" + }, + "value2": { + "type": "variable", + "variable_name": "test_query_string" + } + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "request_uri", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "request_uri", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + } + ], + "store_result": "test_uri" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "/test" + }, + "value2": { + "type": "variable", + "variable_name": "test_uri" + } + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "request_uri_stubs", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test/path" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "request_uri_stubs", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + } + ], + "store_result": "test_stubs" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "test" + }, + { + "type": "string", + "value": "path" + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "test_stubs" + } + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_css_file_response", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test.css" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_css_file_response", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "test.css" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_method", + "value": "http_get_method" + }, + { + "type": "string", + "value": "/test.css" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_file_response", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test.txt" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_file_response", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "test.txt" + }, + { + "type": "string", + "value": "text/plain" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_method", + "value": "http_get_method" + }, + { + "type": "string", + "value": "/test.txt" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_html_file_response", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test.html" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_html_file_response", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "test.html" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_method", + "value": "http_get_method" + }, + { + "type": "string", + "value": "/test.html" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_javascript_file_response", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test.js" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_javascript_file_response", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "test.js" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_request_for", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_method", + "value": "http_get_method" + }, + { + "type": "string", + "value": "/test.js" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_response_empty", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_response_empty", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + } + ] + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_response", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_response", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "string", + "value": "Test Message" + } + ] + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_response_json_with_status", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_response_json_with_status", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_status_code", + "value": "http_status_ok" + } + ] + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_response_with_status", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_response_with_status", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_status_code", + "value": "http_status_ok" + }, + { + "type": "string", + "value": "Test Message" + } + ] + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_response_with_status_and_content_type", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_response_with_status_and_content_type", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_status_code", + "value": "http_status_ok" + }, + { + "type": "string", + "value": "Test Message" + }, + { + "type": "string", + "value": "text/plain" + } + ] + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_response_with_status_and_content_type_and_headers", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "send_response_with_status_and_content_type_and_headers", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "enum", + "enum_type": "http_status_code", + "value": "http_status_ok" + }, + { + "type": "string", + "value": "Test Message" + }, + { + "type": "string", + "value": "text/plain" + }, + { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "Header1: Value1" + }, + { + "type": "string", + "value": "Header2: Value2" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "send_response_json", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "function", + "function_name": "next_web_request", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ], + "store_result": "test_request" + }, + { + "type": "function", + "function_name": "create_json", + "args": [], + "store_result": "test_json" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "json", + "store_result": "cleanup_json" + }, + { + "type": "function", + "function_name": "json_set_string", + "args": [ + { + "type": "variable", + "variable_name": "test_json" + }, + { + "type": "string", + "value": "message" + }, + { + "type": "string", + "value": "Test Message" + } + ] + }, + { + "type": "function", + "function_name": "send_response_json", + "args": [ + { + "type": "variable", + "variable_name": "test_request" + }, + { + "type": "variable", + "variable_name": "test_json" + } + ] + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "split_uri_stubs", + "steps": [ + { + "type": "function", + "function_name": "split_uri_stubs", + "args": [ + { + "type": "string", + "value": "/names/0" + } + ], + "store_result": "test_stubs" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "names" + }, + { + "type": "string", + "value": "0" + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "test_stubs" + } + } + }, + { + "type": "function", + "function_name": "split_uri_stubs", + "args": [ + { + "type": "string", + "value": "/" + } + ], + "store_result": "test_stubs_empty" + }, + { + "type": "assertion", + "compare": { + "compare_type": "empty", + "value1": { + "type": "variable", + "variable_name": "test_stubs_empty" + }, + "value2": null + } + } + ] + }, + { + "name": "start_web_server_with_default_port", + "steps": [ + { + "type": "function", + "function_name": "start_web_server_with_default_port", + "args": [], + "store_result": "test_server" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_server" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "start_web_server", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_server" + } + } + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + }, + { + "name": "stop_web_server", + "steps": [ + { + "type": "function", + "function_name": "start_web_server", + "args": [ + { + "type": "unsigned_short", + "value": 8080 + } + ], + "store_result": "test_server" + }, + { + "type": "function", + "function_name": "http_get", + "args": [ + { + "type": "string", + "value": "http://localhost:8080/test" + }, + { + "type": "unsigned_short", + "value": 80 + } + ], + "store_result": "test_response" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_incoming_requests", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_response", + "args": [ + { + "type": "variable", + "variable_name": "test_response" + } + ] + }, + { + "type": "function", + "function_name": "stop_web_server", + "args": [ + { + "type": "variable", + "variable_name": "test_server" + } + ] + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/physics.json b/coresdk/src/test/splashkit-test-generator/data/tests/physics.json new file mode 100644 index 00000000..3fac3cb9 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/physics.json @@ -0,0 +1,7595 @@ +{ + "group": "physics", + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "bitmap", + "function_name": "free_all_bitmaps", + "args": [] + }, + { + "cleanup_type": "sprite", + "function_name": "free_all_sprites", + "args": [] + } + ], + "tests": [ + { + "name": "bitmap_circle_collision_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 1" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_circle_collision_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_circle_collision", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 2" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_circle_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_circle_collision_for_cell_with_translation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 3" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_translation" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_circle_collision_for_cell_with_translation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "test_translation" + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_circle_collision_for_cell_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 4" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_circle_collision_for_cell_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_circle_collision_for_cell", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 5" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_circle_collision_for_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "variable", + "variable_name": "test_circle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_collision", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 6" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 7" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap2" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + } + ] + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_collision_for_cells", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_collision_for_cells", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_collision_at_points", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 8" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 9" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap2" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + } + ] + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_collision_at_points", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "variable", + "variable_name": "test_point2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_collision_for_cells_with_translations", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 10" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 11" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap2" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + } + ] + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + } + ] + }, + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "matrix1" + }, + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "matrix2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_collision_for_cells_with_translations", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "matrix1" + }, + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "matrix2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_collision_for_cells_at_points", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 12" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "test_bitmap1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 13" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "test_bitmap2" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + } + ] + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 125.0 + }, + { + "type": "double", + "value": 125.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_collision_for_cells_at_points", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "test_point1" + }, + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "test_point2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_collision_for_cells", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 14" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 15" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap2" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_collision_for_cells", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_collision_for_cells", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_point_collision_with_translation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 16" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_translation" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_with_translation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_translation" + }, + { + "type": "variable", + "variable_name": "test_point1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_with_translation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_translation" + }, + { + "type": "variable", + "variable_name": "test_point2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_point_collision_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 17" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_bmp_point" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 101.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_bmp_point" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_bmp_point" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 201.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_point_collision", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 18" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_point_collision_for_cell_with_translation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 19" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_translation" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_point1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ], + "store_result": "test_point2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_for_cell_with_translation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "test_translation" + }, + { + "type": "variable", + "variable_name": "test_point1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_for_cell_with_translation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "test_translation" + }, + { + "type": "variable", + "variable_name": "test_point2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_point_collision_for_cell_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 20" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_for_cell_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_for_cell_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_point_collision_for_cell", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 21" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "rgba_color", + "args": [ + { + "type": "int", + "value": 0 + }, + { + "type": "int", + "value": 0 + }, + { + "type": "int", + "value": 0 + }, + { + "type": "int", + "value": 0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "draw_pixel_on_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_for_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "bitmap_point_collision_for_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 51.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_rectangle_collision_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 22" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_rectangle_collision_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_rectangle_collision", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 23" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_rectangle_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_rectangle_collision_for_cell_with_translation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 24" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_translation" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_rectangle_collision_for_cell_with_translation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "test_translation" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_rectangle_collision_for_cell_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 25" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_rectangle_collision_for_cell_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "bitmap_rectangle_collision_for_cell", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 26" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "bitmap_rectangle_collision_for_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_bitmap_collision", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 27" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 1" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_bitmap_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_bitmap_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_bitmap_collision_with_cell_at_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 28" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 2" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_bitmap_collision_with_cell_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_bitmap_collision_with_cell", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 29" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 3" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_bitmap_collision_with_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_collision", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 30" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "test_bitmap1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 31" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "test_bitmap2" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + } + ] + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1", + "value": "Test Sprite 4" + } + ], + "store_result": "test_sprite1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2", + "value": "Test Sprite 5" + } + ], + "store_result": "test_sprite2" + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "variable", + "variable_name": "test_sprite2" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "variable", + "variable_name": "test_sprite2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_point_collision", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 32" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 6" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_point_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 76.0 + }, + { + "type": "double", + "value": 75.0 + } + ] + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_point_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_rectangle_collision", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 33" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 7" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + } + ] + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rectangle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_rectangle_collision", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_rectangle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "apply_matrix_to_quad", + "steps": [ + { + "type": "function", + "function_name": "identity_matrix", + "args": [], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "quad_from_points", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ], + "store_result": "test_quad", + "is_mutable": true + }, + { + "type": "function", + "function_name": "apply_matrix_to_quad", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "ref", + "variable_name": "test_quad" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "array_access_field", + "variable_name": "test_quad", + "array_name": "points", + "index": 0, + "field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100.0 + }, + "value2": { + "type": "array_access_field", + "variable_name": "test_quad", + "array_name": "points", + "index": 0, + "field": "y" + } + } + } + ] + }, + { + "name": "apply_matrix_to_triangle", + "steps": [ + { + "type": "function", + "function_name": "triangle_from", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 1.0 + } + ] + } + ], + "store_result": "test_triangle", + "is_mutable": true + }, + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "apply_matrix_to_triangle", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "ref", + "variable_name": "test_triangle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "array_access_field", + "variable_name": "test_triangle", + "array_name": "points", + "index": 0, + "field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "array_access_field", + "variable_name": "test_triangle", + "array_name": "points", + "index": 0, + "field": "y" + } + } + } + ] + }, + { + "name": "identity_matrix", + "steps": [ + { + "type": "function", + "function_name": "identity_matrix", + "args": [], + "store_result": "test_matrix" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "test_matrix", + "field": "elements", + "row": 0, + "col": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "test_matrix", + "field": "elements", + "row": 1, + "col": 1 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "test_matrix", + "field": "elements", + "row": 0, + "col": 1 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "test_matrix", + "field": "elements", + "row": 1, + "col": 0 + } + } + } + ] + }, + { + "name": "matrix_inverse", + "steps": [ + { + "type": "function", + "function_name": "scale_rotate_translate_matrix", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 2.0 + } + ] + }, + { + "type": "double", + "value": 45.0 + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "matrix_inverse", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + } + ], + "store_result": "inverse_matrix" + }, + { + "type": "function", + "function_name": "matrix_multiply_matrix", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "inverse_matrix" + } + ], + "store_result": "result_matrix" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "result_matrix", + "field": "elements", + "row": 0, + "col": 0 + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "result_matrix", + "field": "elements", + "row": 1, + "col": 1 + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "name": "matrix_multiply_point", + "steps": [ + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "matrix_multiply_point", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 20.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 30.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "matrix_multiply_matrix", + "steps": [ + { + "type": "function", + "function_name": "scale_matrix", + "args": [ + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "test_matrix1" + }, + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_matrix2" + }, + { + "type": "function", + "function_name": "matrix_multiply_matrix", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix2" + }, + { + "type": "variable", + "variable_name": "test_matrix1" + } + ], + "store_result": "result_matrix" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "result_matrix", + "field": "elements", + "row": 0, + "col": 0 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 20.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "result_matrix", + "field": "elements", + "row": 0, + "col": 2 + } + } + } + ] + }, + { + "name": "matrix_multiply_vector", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "scale_matrix", + "args": [ + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "matrix_multiply_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_vector" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "matrix_to_string", + "steps": [ + { + "type": "function", + "function_name": "identity_matrix", + "args": [], + "store_result": "test_matrix" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": " ------------------------------\\n| 1 0 0 |\\n| 0 1 0 |\\n| 0 0 1 |\\n ------------------------------" + }, + "value2": { + "type": "function", + "function_name": "matrix_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + } + ] + } + } + } + ] + }, + { + "name": "rotation_matrix", + "steps": [ + { + "type": "function", + "function_name": "rotation_matrix", + "args": [ + { + "type": "double", + "value": 90.0 + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "matrix_multiply_point", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 1.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "name": "scale_matrix_from_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 3.0 + } + ], + "store_result": "test_scale" + }, + { + "type": "function", + "function_name": "scale_matrix_from_point", + "args": [ + { + "type": "variable", + "variable_name": "test_scale" + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "matrix_multiply_point", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 2.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "scale_matrix", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.5 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "scale_matrix", + "args": [ + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "matrix_multiply_point", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 2.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "scale_matrix_from_vector", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 3.0 + } + ], + "store_result": "test_scale" + }, + { + "type": "function", + "function_name": "scale_matrix_from_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_scale" + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "matrix_multiply_point", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 2.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "scale_rotate_translate_matrix", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "test_scale" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_translate" + }, + { + "type": "function", + "function_name": "scale_rotate_translate_matrix", + "args": [ + { + "type": "variable", + "variable_name": "test_scale" + }, + { + "type": "double", + "value": 90.0 + }, + { + "type": "variable", + "variable_name": "test_translate" + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "matrix_multiply_point", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 10.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 11.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "translation_matrix_to_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "translation_matrix_to_point", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "matrix_multiply_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_vector" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 15.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 25.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "translation_matrix_from_vector", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "translation_matrix_from_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "matrix_multiply_point", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 10.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 20.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "translation_matrix", + "steps": [ + { + "type": "function", + "function_name": "translation_matrix", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 20.0 + } + ], + "store_result": "test_matrix" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "matrix_multiply_point", + "args": [ + { + "type": "variable", + "variable_name": "test_matrix" + }, + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 10.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 20.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "angle_between", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_vector1" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_vector2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 90.0 + }, + "value2": { + "type": "function", + "function_name": "angle_between", + "args": [ + { + "type": "variable", + "variable_name": "test_vector1" + }, + { + "type": "variable", + "variable_name": "test_vector2" + } + ] + } + } + } + ] + }, + { + "name": "dot_product", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector1" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "test_vector2" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 11.0 + }, + "value2": { + "type": "function", + "function_name": "dot_product", + "args": [ + { + "type": "variable", + "variable_name": "test_vector1" + }, + { + "type": "variable", + "variable_name": "test_vector2" + } + ] + } + } + } + ] + }, + { + "name": "is_zero_vector", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_zero_vector" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_non_zero_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_zero_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_zero_vector" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_zero_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_non_zero_vector" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "ray_intersection_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_from_pt" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_heading" + }, + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 2.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 2.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "intersection_point", + "is_mutable": true + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "ray_intersection_point", + "args": [ + { + "type": "variable", + "variable_name": "test_from_pt" + }, + { + "type": "variable", + "variable_name": "test_heading" + }, + { + "type": "variable", + "variable_name": "test_line" + }, + { + "type": "ref", + "variable_name": "intersection_point" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 1.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "intersection_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 1.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "intersection_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "unit_vector", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "unit_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ], + "store_result": "test_unit_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.6 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_unit_vector", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.8 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_unit_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_add", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "test_vector1" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector2" + }, + { + "type": "function", + "function_name": "vector_add", + "args": [ + { + "type": "variable", + "variable_name": "test_vector1" + }, + { + "type": "variable", + "variable_name": "test_vector2" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 6.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_angle", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 45.0 + }, + "value2": { + "type": "function", + "function_name": "vector_angle", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ] + } + } + } + ] + }, + { + "name": "vector_from_angle", + "steps": [ + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 1.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_from_line", + "steps": [ + { + "type": "function", + "function_name": "line_from_point_to_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ] + } + ], + "store_result": "test_line" + }, + { + "type": "function", + "function_name": "vector_from_line", + "args": [ + { + "type": "variable", + "variable_name": "test_line" + } + ], + "store_result": "test_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_from_point_to_rect", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "vector_from_point_to_rect", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ], + "store_result": "test_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_in_rect", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_vector_inside" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "test_vector_outside" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "vector_in_rect", + "args": [ + { + "type": "variable", + "variable_name": "test_vector_inside" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "vector_in_rect", + "args": [ + { + "type": "variable", + "variable_name": "test_vector_outside" + }, + { + "type": "variable", + "variable_name": "test_rect" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "vector_invert", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "vector_invert", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ], + "store_result": "inverted_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "inverted_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "inverted_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_limit", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 6.0 + }, + { + "type": "double", + "value": 8.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "vector_limit", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "limited_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "limited_vector", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "limited_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_magnitude", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "vector_magnitude", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ] + } + } + } + ] + }, + { + "name": "vector_magnitude_squared", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 25.0 + }, + "value2": { + "type": "function", + "function_name": "vector_magnitude_squared", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ] + } + } + } + ] + }, + { + "name": "vector_multiply", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "vector_multiply", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + }, + { + "type": "double", + "value": 2.0 + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 6.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 8.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_normal", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "function", + "function_name": "vector_normal", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ], + "store_result": "normal_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -0.8 + }, + "value2": { + "type": "variable_field", + "variable_name": "normal_vector", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.6 + }, + "value2": { + "type": "variable_field", + "variable_name": "normal_vector", + "variable_field": "y" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "name": "vector_out_of_circle_from_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_circle_src" + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 8.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_circle_bounds" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_velocity" + }, + { + "type": "function", + "function_name": "vector_out_of_circle_from_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_circle_src" + }, + { + "type": "variable", + "variable_name": "test_circle_bounds" + }, + { + "type": "variable", + "variable_name": "test_velocity" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -3.42 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_out_of_circle_from_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 10.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_velocity" + }, + { + "type": "function", + "function_name": "vector_out_of_circle_from_point", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_velocity" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -11.42 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_out_of_rect_from_circle", + "steps": [ + { + "type": "function", + "function_name": "circle_at_from_points", + "args": [ + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 25.0 + } + ], + "store_result": "test_circle" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_velocity" + }, + { + "type": "function", + "function_name": "vector_out_of_rect_from_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_circle" + }, + { + "type": "variable", + "variable_name": "test_rect" + }, + { + "type": "variable", + "variable_name": "test_velocity" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -101.42 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_out_of_rect_from_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_rect" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_velocity" + }, + { + "type": "function", + "function_name": "vector_out_of_rect_from_point", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + }, + { + "type": "variable", + "variable_name": "test_rect" + }, + { + "type": "variable", + "variable_name": "test_velocity" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -76.4 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_out_of_rect_from_rect", + "steps": [ + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 75.0 + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ], + "store_result": "test_src_rect" + }, + { + "type": "function", + "function_name": "rectangle_from", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "test_bounds_rect" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_velocity" + }, + { + "type": "function", + "function_name": "vector_out_of_rect_from_rect", + "args": [ + { + "type": "variable", + "variable_name": "test_src_rect" + }, + { + "type": "variable", + "variable_name": "test_bounds_rect" + }, + { + "type": "variable", + "variable_name": "test_velocity" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -126.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_point_to_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ], + "store_result": "test_start_point" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_end_point" + }, + { + "type": "function", + "function_name": "vector_point_to_point", + "args": [ + { + "type": "variable", + "variable_name": "test_start_point" + }, + { + "type": "variable", + "variable_name": "test_end_point" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_subtract", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector1" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ], + "store_result": "test_vector2" + }, + { + "type": "function", + "function_name": "vector_subtract", + "args": [ + { + "type": "variable", + "variable_name": "test_vector1" + }, + { + "type": "variable", + "variable_name": "test_vector2" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 2.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_to_point", + "steps": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_point" + }, + { + "type": "function", + "function_name": "vector_to_point", + "args": [ + { + "type": "variable", + "variable_name": "test_point" + } + ], + "store_result": "result_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "result_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_to", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 3.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 4.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_to_string", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Vec -> 3.000000:4.000000" + }, + "value2": { + "type": "function", + "function_name": "vector_to_string", + "args": [ + { + "type": "variable", + "variable_name": "test_vector" + } + ] + } + } + } + ] + }, + { + "name": "vectors_equal", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector1" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector2" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_vector3" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "vectors_equal", + "args": [ + { + "type": "variable", + "variable_name": "test_vector1" + }, + { + "type": "variable", + "variable_name": "test_vector2" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "vectors_equal", + "args": [ + { + "type": "variable", + "variable_name": "test_vector1" + }, + { + "type": "variable", + "variable_name": "test_vector3" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "vectors_not_equal", + "steps": [ + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector1" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ], + "store_result": "test_vector2" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 5.0 + } + ], + "store_result": "test_vector3" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "vectors_not_equal", + "args": [ + { + "type": "variable", + "variable_name": "test_vector1" + }, + { + "type": "variable", + "variable_name": "test_vector2" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "vectors_not_equal", + "args": [ + { + "type": "variable", + "variable_name": "test_vector1" + }, + { + "type": "variable", + "variable_name": "test_vector3" + } + ] + }, + "value2": null + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/raspberry.json b/coresdk/src/test/splashkit-test-generator/data/tests/raspberry.json new file mode 100644 index 00000000..3db4d3fc --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/raspberry.json @@ -0,0 +1,782 @@ +{ + "group": "raspberry", + "cleanup": [ + { + "cleanup_type": "raspberry", + "function_name": "raspberry_cleanup", + "args": [] + } + ], + "tests": [ + { + "name": "has_gpio", + "steps": [ + { + "type": "function", + "function_name": "has_gpio", + "args": [], + "store_result": "test_gpio_capability" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "test_gpio_capability" + }, + "value2": null + } + } + ] + }, + { + "name": "raspi_cleanup", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + } + ] + }, + { + "type": "function", + "function_name": "raspi_write", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_values", + "value": "gpio_high" + } + ] + }, + { + "type": "function", + "function_name": "raspi_cleanup", + "args": [] + }, + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_input" + }, + "value2": { + "type": "function", + "function_name": "raspi_get_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_values", + "value": "gpio_low" + }, + "value2": { + "type": "function", + "function_name": "raspi_read", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ] + } + } + } + ] + }, + { + "name": "raspi_get_mode", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + } + ] + }, + { + "type": "function", + "function_name": "raspi_get_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ], + "store_result": "test_mode" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + }, + "value2": { + "type": "variable", + "variable_name": "test_mode" + } + } + } + ] + }, + { + "name": "raspi_init", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_gpio", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "raspi_read", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + } + ] + }, + { + "type": "function", + "function_name": "raspi_write", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_values", + "value": "gpio_high" + } + ] + }, + { + "type": "function", + "function_name": "raspi_read", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ], + "store_result": "test_read_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_values", + "value": "gpio_high" + }, + "value2": { + "type": "variable", + "variable_name": "test_read_value" + } + } + } + ] + }, + { + "name": "raspi_set_mode", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + }, + "value2": { + "type": "function", + "function_name": "raspi_get_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ] + } + } + } + ] + }, + { + "name": "raspi_set_pull_up_down", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_input" + } + ] + }, + { + "type": "function", + "function_name": "raspi_set_pull_up_down", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pull_up_down", + "value": "pud_up" + } + ] + }, + { + "type": "function", + "function_name": "raspi_read", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ], + "store_result": "test_pin_value_up" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_values", + "value": "gpio_high" + }, + "value2": { + "type": "variable", + "variable_name": "test_pin_value_up" + } + } + }, + { + "type": "function", + "function_name": "raspi_set_pull_up_down", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pull_up_down", + "value": "pud_down" + } + ] + }, + { + "type": "function", + "function_name": "raspi_read", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ], + "store_result": "test_pin_value_down" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_values", + "value": "gpio_low" + }, + "value2": { + "type": "variable", + "variable_name": "test_pin_value_down" + } + } + } + ] + }, + { + "name": "raspi_set_pwm_dutycycle", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_18" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + } + ] + }, + { + "type": "function", + "function_name": "raspi_set_pwm_dutycycle", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_18" + }, + { + "type": "int", + "value": 50 + } + ] + }, + { + "type": "function", + "function_name": "raspi_get_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_18" + } + ], + "store_result": "mode" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + }, + "value2": { + "type": "variable", + "variable_name": "mode" + } + } + } + ] + }, + { + "name": "raspi_set_pwm_frequency", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_18" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_alt5" + } + ] + }, + { + "type": "function", + "function_name": "raspi_set_pwm_frequency", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_18" + }, + { + "type": "int", + "value": 1000 + } + ] + }, + { + "type": "function", + "function_name": "raspi_get_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_18" + } + ], + "store_result": "mode" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_alt5" + }, + "value2": { + "type": "variable", + "variable_name": "mode" + } + } + } + ] + }, + { + "name": "raspi_set_pwm_range", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + } + ] + }, + { + "type": "function", + "function_name": "raspi_set_pwm_range", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "int", + "value": 1024 + } + ] + }, + { + "type": "function", + "function_name": "raspi_set_pwm_dutycycle", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "int", + "value": 512 + } + ] + }, + { + "type": "function", + "function_name": "raspi_get_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ], + "store_result": "mode" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + }, + "value2": { + "type": "variable", + "variable_name": "mode" + } + } + } + ] + }, + { + "name": "raspi_write", + "steps": [ + { + "type": "function", + "function_name": "raspi_init", + "args": [] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "raspberry", + "store_result": "cleanup_raspberry" + }, + { + "type": "function", + "function_name": "raspi_set_mode", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_modes", + "value": "gpio_output" + } + ] + }, + { + "type": "function", + "function_name": "raspi_write", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + }, + { + "type": "enum", + "enum_type": "pin_values", + "value": "gpio_high" + } + ] + }, + { + "type": "function", + "function_name": "raspi_read", + "args": [ + { + "type": "enum", + "enum_type": "pins", + "value": "pin_11" + } + ], + "store_result": "test_pin_value" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "pin_values", + "value": "gpio_high" + }, + "value2": { + "type": "variable", + "variable_name": "test_pin_value" + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/resource_bundles.json b/coresdk/src/test/splashkit-test-generator/data/tests/resource_bundles.json new file mode 100644 index 00000000..0b4d00e7 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/resource_bundles.json @@ -0,0 +1,405 @@ +{ + "group": "resource_bundles", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "resource", + "function_name": "free_resource_bundle", + "args": [ + { + "type": "object", + "object_type": "string", + "variable_name": "bundle_name" + } + ] + } + ], + "tests": [ + { + "name": "free_resource_bundle", + "steps": [ + { + "type": "function", + "function_name": "load_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + }, + { + "type": "string", + "value": "test.txt" + } + ] + }, + { + "type": "cleanup", + "cleanup_type": "resource", + "store_result": "cleanup_resource", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_bitmap", + "args": [ + { + "type": "string", + "value": "FrogBmp" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_font_name_as_string", + "args": [ + { + "type": "string", + "value": "hara" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_resource_bundle", + "steps": [ + { + "type": "function", + "function_name": "load_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + }, + { + "type": "string", + "value": "test.txt" + } + ] + }, + { + "type": "cleanup", + "cleanup_type": "resource", + "store_result": "cleanup_resource", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_resource_bundle", + "args": [ + { + "type": "string", + "value": "nonexistent" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "load_resource_bundle", + "steps": [ + { + "type": "function", + "function_name": "load_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + }, + { + "type": "string", + "value": "test.txt" + } + ] + }, + { + "type": "cleanup", + "cleanup_type": "resource", + "store_result": "cleanup_resource", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_animation_script", + "args": [ + { + "type": "string", + "value": "WalkingScript" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_bitmap", + "args": [ + { + "type": "string", + "value": "FrogBmp" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_font_name_as_string", + "args": [ + { + "type": "string", + "value": "hara" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sound_effect", + "args": [ + { + "type": "string", + "value": "error" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "my timer" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_resource_bundle", + "args": [ + { + "type": "string", + "value": "blah" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_resource_bundle", + "args": [ + { + "type": "string", + "value": "Test Resource Bundle" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_resource_bundle", + "args": [ + { + "type": "string", + "value": "test_bundle" + } + ] + }, + "value2": null + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/resources.json b/coresdk/src/test/splashkit-test-generator/data/tests/resources.json new file mode 100644 index 00000000..03f22678 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/resources.json @@ -0,0 +1,439 @@ +{ + "group": "resources", + "cleanup": [ + { + "cleanup_type": "bitmap", + "function_name": "free_all_bitmaps", + "args": [] + } + ], + "tests": [ + { + "name": "deregister_free_notifier", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "free_notifier", + "class_name": "notifier_tracker", + "args": [] + }, + { + "type": "function", + "function_name": "register_free_notifier", + "args": [ + { + "type": "method_call", + "variable_name": "free_notifier", + "method_name": "on_free" + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 1" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "free_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap1" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "method_call", + "variable_name": "free_notifier", + "method_name": "was_notified" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "deregister_free_notifier", + "args": [ + { + "type": "method_call", + "variable_name": "free_notifier", + "method_name": "on_free" + } + ] + }, + { + "type": "method_call", + "variable_name": "free_notifier", + "method_name": "reset" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 2" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap2" + }, + { + "type": "function", + "function_name": "free_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "method_call", + "variable_name": "free_notifier", + "method_name": "was_notified" + }, + "value2": null + } + } + ] + }, + { + "name": "path_to_resource", + "steps": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "resources" + } + ] + }, + { + "type": "function", + "function_name": "path_to_resource", + "args": [ + { + "type": "string", + "value": "test_image.png" + }, + { + "type": "enum", + "enum_type": "resource_kind", + "value": "image_resource" + } + ], + "store_result": "image_path" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "resources/images/test_image.png" + }, + "value2": { + "type": "variable", + "variable_name": "image_path" + } + } + } + ] + }, + { + "name": "path_to_resources", + "steps": [ + { + "type": "function", + "function_name": "path_to_resources", + "args": [], + "store_result": "resource_path" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_empty", + "value1": { + "type": "variable", + "variable_name": "resource_path" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "/new/resources" + } + ] + }, + { + "type": "function", + "function_name": "path_to_resources", + "args": [], + "store_result": "new_resource_path" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "/new/resources" + }, + "value2": { + "type": "variable", + "variable_name": "new_resource_path" + } + } + } + ] + }, + { + "name": "path_to_resources_for_kind", + "steps": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "resources" + } + ] + }, + { + "type": "function", + "function_name": "path_to_resources_for_kind", + "args": [ + { + "type": "enum", + "enum_type": "resource_kind", + "value": "image_resource" + } + ], + "store_result": "image_path" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "resources/images/" + }, + "value2": { + "type": "variable", + "variable_name": "image_path" + } + } + }, + { + "type": "function", + "function_name": "path_to_resources_for_kind", + "args": [ + { + "type": "enum", + "enum_type": "resource_kind", + "value": "sound_resource" + } + ], + "store_result": "sound_path" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "resources/sounds/" + }, + "value2": { + "type": "variable", + "variable_name": "sound_path" + } + } + } + ] + }, + { + "name": "register_free_notifier", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "free_notifier", + "class_name": "notifier_tracker", + "args": [] + }, + { + "type": "function", + "function_name": "register_free_notifier", + "args": [ + { + "type": "method_call", + "variable_name": "free_notifier", + "method_name": "on_free" + } + ] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 3" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "free_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "method_call", + "variable_name": "free_notifier", + "method_name": "was_notified" + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "deregister_free_notifier", + "args": [ + { + "type": "method_call", + "variable_name": "free_notifier", + "method_name": "on_free" + } + ] + } + ] + }, + { + "name": "set_resources_path", + "steps": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "/resources" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "/resources" + }, + "value2": { + "type": "function", + "function_name": "path_to_resources", + "args": [] + } + } + }, + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "/new/resources" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "/new/resources" + }, + "value2": { + "type": "function", + "function_name": "path_to_resources", + "args": [] + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/sprites.json b/coresdk/src/test/splashkit-test-generator/data/tests/sprites.json new file mode 100644 index 00000000..07be4d5a --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/sprites.json @@ -0,0 +1,17287 @@ +{ + "group": "sprites", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "bitmap", + "function_name": "free_all_bitmaps", + "args": [] + }, + { + "cleanup_type": "sprite", + "function_name": "free_all_sprites", + "args": [] + }, + { + "cleanup_type": "animation_script", + "function_name": "free_all_animation_scripts", + "args": [] + }, + { + "cleanup_type": "sprite_pack", + "function_name": "free_sprite_pack", + "args": [ + { + "type": "object", + "object_type": "string", + "variable_name": "sprite_pack_name" + } + ] + } + ], + "tests": [ + { + "name": "call_for_all_sprites_with_value", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "test_sprite_delegates", + "class_name": "sprite_delegates", + "args": [] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 1" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 1" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 2" + } + ] + }, + { + "type": "function", + "function_name": "call_for_all_sprites_with_value", + "args": [ + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_float_function" + }, + { + "type": "float", + "value": 300.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "float_function_call_count" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "event_called" + } + } + } + ] + }, + { + "name": "call_for_all_sprites", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "test_sprite_delegates", + "class_name": "sprite_delegates", + "args": [] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 2" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 3" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 4" + } + ] + }, + { + "type": "function", + "function_name": "call_for_all_sprites", + "args": [ + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_function" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "function_call_count" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "event_called" + } + } + } + ] + }, + { + "name": "center_point_of_sprite", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 3" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 5" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "center_point_of_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "test_center_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 150.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_center_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 150.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_center_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "create_sprite", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 4" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 6" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sprite" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "function", + "function_name": "sprite_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "create_sprite_with_animation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 5" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 1" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 7" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sprite" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "function", + "function_name": "sprite_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "create_sprite_with_bitmap_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 6" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite_with_bitmap_named", + "args": [ + { + "type": "string", + "value": "Test Bitmap 6" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sprite" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "function", + "function_name": "sprite_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "create_sprite_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 7" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 1" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sprite" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Sprite 1" + }, + "value2": { + "type": "function", + "function_name": "sprite_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "create_sprite_named_with_animation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 8" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 2" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_named_with_animation", + "args": [ + { + "type": "string", + "value": "Test Sprite 2" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sprite" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Sprite 2" + }, + "value2": { + "type": "function", + "function_name": "sprite_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "create_sprite_with_bitmap_and_animation_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 9" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 3" + }, + { + "type": "string", + "value": "kermit.txt" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_bitmap_and_animation_named", + "args": [ + { + "type": "string", + "value": "Test Bitmap 9" + }, + { + "type": "string", + "value": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_sprite" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "function", + "function_name": "sprite_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "create_sprite_pack", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 1" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "create_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 1" + } + ] + }, + { + "type": "cleanup", + "cleanup_type": "sprite_pack", + "store_result": "cleanup_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 1" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 1" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "current_sprite_pack", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "default" + }, + "value2": { + "type": "function", + "function_name": "current_sprite_pack", + "args": [] + } + } + }, + { + "type": "function", + "function_name": "create_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 2" + } + ] + }, + { + "type": "cleanup", + "cleanup_type": "sprite_pack", + "store_result": "cleanup_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 2" + } + ] + }, + { + "type": "function", + "function_name": "select_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Sprite Pack 2" + }, + "value2": { + "type": "function", + "function_name": "current_sprite_pack", + "args": [] + } + } + } + ] + }, + { + "name": "draw_all_sprites", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 1" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 10" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 14" + } + ], + "store_result": "test_sprite1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 15" + } + ], + "store_result": "test_sprite2" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "clear_screen", + "args": [ + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_all_sprites", + "args": [] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_sprite_offset_x_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 2" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 11" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 16" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "clear_screen", + "args": [ + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_sprite_offset_x_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_sprite_offset_by", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 12" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 17" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "clear_screen", + "args": [ + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_sprite_offset_by", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "function", + "function_name": "color_white", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 450.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + } + } + ] + }, + { + "name": "draw_sprite", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 4" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 13" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "clear_screen", + "args": [ + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "function", + "function_name": "get_pixel_from_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + } + } + ] + }, + { + "name": "free_all_sprites", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 14" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 3" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_sprite_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 4" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 3" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 4" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_all_sprites", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 3" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 4" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_sprite", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 15" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 5" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 5" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 5" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_sprite_pack", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "default" + }, + "value2": { + "type": "function", + "function_name": "current_sprite_pack", + "args": [] + } + } + }, + { + "type": "function", + "function_name": "create_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 3" + } + ] + }, + { + "type": "cleanup", + "cleanup_type": "sprite_pack", + "store_result": "cleanup_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 3" + } + ] + }, + { + "type": "function", + "function_name": "select_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 3" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 3" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Sprite Pack 3" + }, + "value2": { + "type": "function", + "function_name": "current_sprite_pack", + "args": [] + } + } + }, + { + "type": "function", + "function_name": "free_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 3" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 3" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "default" + }, + "value2": { + "type": "function", + "function_name": "current_sprite_pack", + "args": [] + } + } + } + ] + }, + { + "name": "has_sprite", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 16" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 6" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "create_sprite_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 6" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 6" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite", + "args": [ + { + "type": "string", + "value": "Test Sprite 6" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_sprite_pack", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 4" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "create_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 4" + } + ] + }, + { + "type": "cleanup", + "cleanup_type": "sprite_pack", + "store_result": "cleanup_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 4" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 4" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 4" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 4" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "move_sprite", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 17" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ], + "store_result": "start_position" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "start_position" + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "move_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 110.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 110.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "move_sprite_by_vector", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 18" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "move_sprite_by_vector", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 150.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 150.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "move_sprite_by_vector_percent", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 19" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "move_sprite_by_vector_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "float", + "value": 0.5 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 125.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 125.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "move_sprite_percent", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 20" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "move_sprite_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 0.5 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 105.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 105.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "move_sprite_to", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 21" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "move_sprite_to", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 400.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 300.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "select_sprite_pack", + "steps": [ + { + "type": "function", + "function_name": "create_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 5" + } + ] + }, + { + "type": "cleanup", + "cleanup_type": "sprite_pack", + "store_result": "cleanup_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 5" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "default" + }, + "value2": { + "type": "function", + "function_name": "current_sprite_pack", + "args": [] + } + } + }, + { + "type": "function", + "function_name": "select_sprite_pack", + "args": [ + { + "type": "string", + "value": "Test Sprite Pack 5" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Sprite Pack 5" + }, + "value2": { + "type": "function", + "function_name": "current_sprite_pack", + "args": [] + } + } + } + ] + }, + { + "name": "sprite_add_layer", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 22" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 23" + }, + { + "type": "int", + "value": 50 + }, + { + "type": "int", + "value": 50 + } + ], + "store_result": "new_layer_bitmap" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "new_layer_bitmap" + }, + { + "type": "string", + "value": "Test Bitmap 23" + } + ], + "store_result": "layer_index" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "variable", + "variable_name": "layer_index" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_add_to_velocity", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 24" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_add_to_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "velocity" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 10.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "velocity", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 10.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "velocity", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "sprite_add_value", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 25" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_value_with_default", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + }, + { + "type": "float", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_has_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + } + ] + } + } + } + ] + }, + { + "name": "sprite_add_value_with_default", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 26" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_value_with_default", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + }, + { + "type": "float", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_has_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 100.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + } + ] + } + } + } + ] + }, + { + "name": "sprite_anchor_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 27" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "anchor_point" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "anchor_point", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "anchor_point", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "sprite_anchor_position", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 28" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_anchor_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "anchor_position" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 150.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "anchor_position", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 150.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "anchor_position", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "sprite_animation_has_ended", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 29" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 4" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "loop", + "iterations": 5, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_animation_name", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 30" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 5" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "sprite_animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_at", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 31" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 400.0 + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 300.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_at", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 451.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_at", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 600.0 + }, + { + "type": "double", + "value": 500.0 + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_bring_layer_to_front", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 32" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_index" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_index" + } + ] + }, + { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_index" + } + ], + "store_result": "visible_index" + }, + { + "type": "function", + "function_name": "sprite_bring_layer_to_front", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "visible_index" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_index_of_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + } + } + } + ] + }, + { + "name": "sprite_bring_layer_forward", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 33" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_index" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_index" + } + ] + }, + { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_index" + } + ], + "store_result": "visible_index" + }, + { + "type": "function", + "function_name": "sprite_bring_layer_forward", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "visible_index" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_index" + } + ] + } + } + } + ] + }, + { + "name": "call_on_sprite_event", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "test_sprite_delegates", + "class_name": "sprite_delegates", + "args": [] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 34" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 6" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "call_on_sprite_event", + "args": [ + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_event_handler" + } + ] + }, + { + "type": "function", + "function_name": "update_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "function", + "function_name": "stop_calling_on_sprite_event", + "args": [ + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_event_handler" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "event_called" + } + } + } + ] + }, + { + "name": "call_on_sprite_event", + "steps": [ + { + "type": "function", + "function_name": "create_sprite_with_bitmap_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 43" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "variable", + "variable_type": "bool", + "variable_name": "handler_called", + "initial_value": false + }, + { + "type": "function", + "function_name": "call_on_sprite_event", + "args": [ + { + "type": "event_handler", + "handler_type": "sprite_event_handler", + "updates_variable": "handler_called", + "new_value": true + } + ] + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": 0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "handler_called" + } + } + } + ] + }, + { + "name": "sprite_call_on_event", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "test_sprite_delegates", + "class_name": "sprite_delegates", + "args": [] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 35" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_call_on_event", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_event_handler" + } + ] + }, + { + "type": "function", + "function_name": "update_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "function", + "function_name": "stop_calling_on_sprite_event", + "args": [ + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_event_handler" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "event_called" + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_circle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 36" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "radius" + } + } + } + ] + }, + { + "name": "sprite_collision_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 37" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_collision_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "collision_bitmap" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_bitmap" + }, + "value2": { + "type": "variable", + "variable_name": "collision_bitmap" + } + } + } + ] + }, + { + "name": "sprite_collision_circle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 38" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_collision_circle", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "radius" + } + } + } + ] + }, + { + "name": "sprite_collision_kind", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 39" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + }, + "value2": { + "type": "function", + "function_name": "sprite_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "aabb_collisions" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "aabb_collisions" + }, + "value2": { + "type": "function", + "function_name": "sprite_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_collision_rectangle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 40" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_collision_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "sprite_current_cell", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 41" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 7" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "sprite_current_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "update_sprite_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_current_cell", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_current_cell_rectangle", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 42" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_current_cell_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "sprite_dx", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 43" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_dx", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_dx", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 5.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_dx", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_dy", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 44" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_dy", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_dy", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 5.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_dy", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_has_value", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 45" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_has_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "sprite_add_value_with_default", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + }, + { + "type": "float", + "value": 100.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_has_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_has_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "mana" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_heading", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 46" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 90.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_heading", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 1.0 + }, + { + "type": "double", + "value": 1.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 45.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_heading", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_height", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 47" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_height", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_hide_layer_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 48" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "function", + "function_name": "sprite_show_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_hide_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_hide_layer", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 49" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_hide_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 50" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_bitmap" + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_at_index", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 51" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_bitmap" + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_at_index", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_circle_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 52" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_layer_circle_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "radius" + } + } + } + ] + }, + { + "name": "sprite_layer_circle_at_index", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 53" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_layer_circle_at_index", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ], + "store_result": "test_circle" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "center.y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 50.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "test_circle", + "variable_field": "radius" + } + } + } + ] + }, + { + "name": "sprite_layer_count", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 54" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "variable", + "variable_name": "layer_idx" + } + } + } + ] + }, + { + "name": "sprite_layer_height_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 55" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_height_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_height_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_height", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 56" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_height", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_height", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_index", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 57" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_index", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "layer_idx" + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_index", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_name", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 58" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "variable_name": "layer2" + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_offset_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 59" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_offset_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_layer_offset_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_offset_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_offset", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 60" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_offset", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "function", + "function_name": "sprite_set_layer_offset_at_index", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_offset", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_rectangle_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 61" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_layer_rectangle_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ], + "store_result": "rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "sprite_layer_rectangle_at_index", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 62" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_layer_rectangle_at_index", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ], + "store_result": "rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "sprite_layer_width_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 63" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_width_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_width_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + } + } + } + ] + }, + { + "name": "sprite_layer_width", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 64" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_width", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100 + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_width", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + } + } + } + ] + }, + { + "name": "sprite_location_matrix", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 65" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_rotation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 45.0 + } + ] + }, + { + "type": "function", + "function_name": "sprite_location_matrix", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "matrix" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 150.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "matrix", + "field": "elements", + "row": 0, + "col": 2 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 1.0 + }, + "value2": { + "type": "variable_matrix_access", + "variable_name": "matrix", + "field": "elements", + "row": 2, + "col": 2 + } + } + } + ] + }, + { + "name": "sprite_mass", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 66" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_mass", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_mass", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 10.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_mass", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_move_from_anchor_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 67" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_move_from_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "sprite_set_move_from_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_move_from_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_move_to_taking_seconds", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 68" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_move_to_taking_seconds", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 200.0 + }, + { + "type": "double", + "value": 200.0 + } + ] + }, + { + "type": "float", + "value": 1.0 + } + ] + }, + { + "type": "loop", + "iterations": 5, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 300 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "center_point_of_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "sprite_center" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "sprite_center", + "variable_field": "x" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "sprite_center", + "variable_field": "y" + }, + "value3": { + "type": "precision", + "value": 0.0001 + } + } + } + ] + }, + { + "name": "sprite_name", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 69" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 7" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Sprite 7" + }, + "value2": { + "type": "function", + "function_name": "sprite_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 70" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 8" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_sprite" + }, + "value2": { + "type": "function", + "function_name": "sprite_named", + "args": [ + { + "type": "string", + "value": "Test Sprite 8" + } + ] + } + } + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "Python pointer registry creates an instance if passed None instead of returning None" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "null", + "value1": { + "type": "function", + "function_name": "sprite_named", + "args": [ + { + "type": "string", + "value": "non_existent_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_offscreen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 5" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 71" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_offscreen", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": -200.0 + }, + { + "type": "double", + "value": -200.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_offscreen", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_on_screen_at_point", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 6" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 72" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "draw_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_on_screen_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 451.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_on_screen_at_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_on_screen_at", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 7" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 73" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_red", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "setup_collision_mask", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ] + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "draw_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_on_screen_at", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "double", + "value": 451.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_on_screen_at", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_position", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 74" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_replay_animation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 75" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 8" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 84" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "loop", + "iterations": 5, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "sprite_replay_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_replay_animation_with_sound", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 76" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 9" + }, + { + "type": "string", + "value": "startup.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 85" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "splash" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "loop", + "iterations": 100, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "sprite_replay_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_rotation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 77" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_rotation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_rotation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 45.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 45.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_rotation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_scale", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 78" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 1.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 2.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 2.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_screen_rectangle", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 8" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 79" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 10" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 88" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_screen_rectangle", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "rect" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "y" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "width" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "rect", + "variable_field": "height" + } + } + } + ] + }, + { + "name": "sprite_send_layer_backward", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 80" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer1" + } + ], + "store_result": "layer1" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer1" + } + ] + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer2" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer2" + } + ] + }, + { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer2" + } + ], + "store_result": "visible_index" + }, + { + "type": "function", + "function_name": "sprite_send_layer_backward", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "visible_index" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer2" + } + ] + } + } + } + ] + }, + { + "name": "sprite_send_layer_to_back", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 81" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer1" + } + ], + "store_result": "layer1" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer1" + } + ] + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer2" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer2" + } + ] + }, + { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer2" + } + ], + "store_result": "visible_index" + }, + { + "type": "function", + "function_name": "sprite_send_layer_to_back", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "visible_index" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer2" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_anchor_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 82" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 50.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 25.0 + }, + { + "type": "double", + "value": 25.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_collision_bitmap", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 83" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_bitmap" + }, + "value2": { + "type": "function", + "function_name": "sprite_collision_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 84" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ], + "store_result": "new_bitmap" + }, + { + "type": "function", + "function_name": "sprite_set_collision_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "new_bitmap" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "new_bitmap" + }, + "value2": { + "type": "function", + "function_name": "sprite_collision_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_collision_kind", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 85" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "pixel_collisions" + }, + "value2": { + "type": "function", + "function_name": "sprite_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "aabb_collisions" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "enum", + "enum_type": "collision_test_kind", + "value": "aabb_collisions" + }, + "value2": { + "type": "function", + "function_name": "sprite_collision_kind", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_dx", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 86" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_dx", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_dx", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 5.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_dx", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_dy", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 87" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_dy", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_dy", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 5.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_dy", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_heading", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 88" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 90.0 + }, + { + "type": "double", + "value": 1.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 90.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_heading", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_heading", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 45.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 45.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_heading", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_layer_offset_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 89" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_offset_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_layer_offset_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_offset_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_layer_offset_at_index", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 90" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_offset", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_layer_offset_at_index", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_layer_offset", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_mass", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 91" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_mass", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_mass", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 10.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_mass", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_move_from_anchor_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 92" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_move_from_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "sprite_set_move_from_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_move_from_anchor_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_set_position", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 93" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_rotation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 94" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_rotation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_rotation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 45.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 45.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_rotation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_scale", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 95" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 1.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 2.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 2.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_speed", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 96" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_from_angle", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 1.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_speed", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 5.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_speed", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_value_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 97" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_has_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "test_value" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "sprite_add_value_with_default", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "test_value" + }, + { + "type": "float", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_value_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "test_value" + }, + { + "type": "float", + "value": 10.5 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 10.5 + }, + "value2": { + "type": "function", + "function_name": "sprite_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "test_value" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_velocity", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 98" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_x", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 99" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 150.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 150.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_set_y", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 100" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 300.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 300.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_show_layer_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 101" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "function", + "function_name": "sprite_hide_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "layer_idx" + }, + "value2": { + "type": "function", + "function_name": "sprite_show_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_show_layer", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 102" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "function", + "function_name": "sprite_hide_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "layer_idx" + }, + "value2": { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_speed", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 103" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_speed", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 3.0 + }, + { + "type": "double", + "value": 4.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_speed", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_start_animation_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 104" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 11" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 112" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "loop", + "iterations": 5, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "walkfront" + }, + "value2": { + "type": "function", + "function_name": "sprite_animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_start_animation_named_with_sound", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 105" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 12" + }, + { + "type": "string", + "value": "startup.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 113" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "splash" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + } + } + }, + { + "type": "loop", + "iterations": 100, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splash" + }, + "value2": { + "type": "function", + "function_name": "sprite_animation_name", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_start_animation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 106" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 13" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 114" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "loop", + "iterations": 5, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "sprite_start_animation_with_sound", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 107" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 14" + }, + { + "type": "string", + "value": "startup.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 115" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + "value2": null + } + }, + { + "type": "loop", + "iterations": 100, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_percent_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + }, + { + "type": "bool", + "value": true + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "stop_calling_on_sprite_event", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "test_sprite_delegates", + "class_name": "sprite_delegates", + "args": [] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 108" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "call_on_sprite_event", + "args": [ + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_event_handler" + } + ] + }, + { + "type": "function", + "function_name": "update_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "event_called" + } + } + }, + { + "type": "function", + "function_name": "stop_calling_on_sprite_event", + "args": [ + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_event_handler" + } + ] + }, + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "reset" + }, + { + "type": "function", + "function_name": "update_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "event_called" + } + } + } + ] + }, + { + "name": "sprite_stop_calling_on_event", + "steps": [ + { + "type": "variable", + "variable_type": "class_instance", + "variable_name": "test_sprite_delegates", + "class_name": "sprite_delegates", + "args": [] + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 109" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_call_on_event", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_event_handler" + } + ] + }, + { + "type": "function", + "function_name": "update_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "event_called" + } + } + }, + { + "type": "function", + "function_name": "sprite_stop_calling_on_event", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "sprite_event_handler" + } + ] + }, + { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "reset" + }, + { + "type": "function", + "function_name": "update_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "method_call", + "variable_name": "test_sprite_delegates", + "method_name": "event_called" + } + } + } + ] + }, + { + "name": "sprite_toggle_layer_visible_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 110" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "function", + "function_name": "sprite_show_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_toggle_layer_visible_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_toggle_layer_visible_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_toggle_layer_visible", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 111" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_toggle_layer_visible", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_value", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 112" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 3 + }, + "value2": { + "type": "function", + "function_name": "sprite_value_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_value_with_default", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "test_value" + }, + { + "type": "float", + "value": 0.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_value", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "test_value" + } + ] + } + } + } + ] + }, + { + "name": "sprite_value_count", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 113" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 3 + }, + "value2": { + "type": "function", + "function_name": "sprite_value_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_value_with_default", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "health" + }, + { + "type": "float", + "value": 0.0 + } + ] + }, + { + "type": "function", + "function_name": "sprite_add_value_with_default", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "speed" + }, + { + "type": "float", + "value": 0.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 5 + }, + "value2": { + "type": "function", + "function_name": "sprite_value_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_velocity", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 114" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 5.0 + }, + { + "type": "double", + "value": 5.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_visible_index_of_layer_named", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 115" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_index_of_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "base_layer" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "function", + "function_name": "sprite_show_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_index_of_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + } + } + } + ] + }, + { + "name": "sprite_visible_index_of_layer", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 116" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ], + "store_result": "layer_idx" + }, + { + "type": "function", + "function_name": "sprite_show_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_index_of_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "layer_idx" + } + ] + } + } + } + ] + }, + { + "name": "sprite_visible_layer", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 117" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "function", + "function_name": "sprite_show_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 1 + } + ] + } + } + } + ] + }, + { + "name": "sprite_visible_layer_count", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 118" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "function", + "function_name": "sprite_show_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 2 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_hide_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_count", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_visible_layer_id", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 119" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_id", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 0 + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_add_layer", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "function", + "function_name": "sprite_show_layer_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "layer2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "sprite_visible_layer_id", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "int", + "value": 1 + } + ] + } + } + } + ] + }, + { + "name": "sprite_width", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 120" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 1.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 2.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 2.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_scale", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_x", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 121" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 150.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 150.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "sprite_y", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 122" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 0.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "function", + "function_name": "sprite_set_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 200.0 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 200.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "update_all_sprites", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 123" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite2" + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": -10.0 + }, + { + "type": "double", + "value": -10.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "update_all_sprites", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": -10.0 + }, + { + "type": "double", + "value": -10.0 + } + ] + }, + "value2": { + "type": "function", + "function_name": "sprite_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + } + ] + } + } + } + ] + }, + { + "name": "update_all_sprites_percent", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 124" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite2" + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": -100.0 + }, + { + "type": "double", + "value": -100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "update_all_sprites_percent", + "args": [ + { + "type": "float", + "value": 0.5 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": -50.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": -50.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + } + ] + } + } + } + ] + }, + { + "name": "update_sprite", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 125" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ], + "store_result": "initial_pos" + }, + { + "type": "function", + "function_name": "update_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_pos" + }, + "value2": { + "type": "function", + "function_name": "sprite_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "update_sprite_with_sound", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 126" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 15" + }, + { + "type": "string", + "value": "startup.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 136" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "splash" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "function", + "function_name": "update_sprite_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + } + } + }, + { + "type": "function", + "function_name": "stop_sound_effect_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + { + "type": "function", + "function_name": "update_sprite_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "bool", + "value": false + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + } + } + } + ] + }, + { + "name": "update_sprite_percent", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 127" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_velocity", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "vector_to", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "update_sprite_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 0.5 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_x", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "float", + "value": 50.0 + }, + "value2": { + "type": "function", + "function_name": "sprite_y", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + } + } + ] + }, + { + "name": "update_sprite_percent_with_sound", + "steps": [ + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 16" + }, + { + "type": "string", + "value": "startup.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 128" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 138" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "splash" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "function", + "function_name": "update_sprite_percent_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 0.5 + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + } + } + }, + { + "type": "function", + "function_name": "stop_sound_effect_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + { + "type": "function", + "function_name": "update_sprite_percent_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 0.5 + }, + { + "type": "bool", + "value": false + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + } + } + } + ] + }, + { + "name": "update_sprite_animation", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 129" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 17" + }, + { + "type": "string", + "value": "kermit.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "walkfront" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "loop", + "iterations": 50, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "update_sprite_animation_with_sound", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 130" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 18" + }, + { + "type": "string", + "value": "startup.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 140" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "splash" + } + ] + }, + { + "type": "function", + "function_name": "update_sprite_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "stop_sound_effect_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + { + "type": "loop", + "iterations": 100, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "bool", + "value": false + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "update_sprite_animation_percent", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 131" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 19" + }, + { + "type": "string", + "value": "startup.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 141" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "splash" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "loop", + "iterations": 100, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_percent", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "update_sprite_animation_percent_with_sound", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 132" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "load_animation_script", + "args": [ + { + "type": "string", + "value": "Test Script 20" + }, + { + "type": "string", + "value": "startup.txt" + } + ], + "store_result": "test_animation" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "animation_script", + "store_result": "cleanup_animation_script" + }, + { + "type": "function", + "function_name": "create_sprite_with_animation", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap", + "value": "Test Sprite 142" + }, + { + "type": "variable", + "variable_name": "test_animation" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_start_animation_named", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "string", + "value": "splash" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sprite_animation_has_ended", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "update_sprite_animation_percent_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + }, + { + "type": "bool", + "value": true + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "stop_sound_effect_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + { + "type": "loop", + "iterations": 100, + "loop_steps": [ + { + "type": "function", + "function_name": "update_sprite_animation_percent_with_sound", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "float", + "value": 100.0 + }, + { + "type": "bool", + "value": false + } + ] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "sound_effect_playing_named", + "args": [ + { + "type": "string", + "value": "SwinGameStart" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "vector_from_center_sprite_to_point_point", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 133" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 150.0 + }, + { + "type": "double", + "value": 150.0 + } + ], + "store_result": "target_point" + }, + { + "type": "function", + "function_name": "vector_from_center_sprite_to_point_point", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite" + }, + { + "type": "variable", + "variable_name": "target_point" + } + ], + "store_result": "vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "vector", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "vector_from_to", + "steps": [ + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 134" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 100 + } + ], + "store_result": "test_bitmap" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "sprite", + "store_result": "cleanup_sprite" + }, + { + "type": "function", + "function_name": "create_sprite", + "args": [ + { + "type": "variable", + "variable_name": "test_bitmap" + } + ], + "store_result": "test_sprite2" + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "sprite_set_position", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite2" + }, + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 100.0 + }, + { + "type": "double", + "value": 100.0 + } + ] + } + ] + }, + { + "type": "function", + "function_name": "vector_from_to", + "args": [ + { + "type": "variable", + "variable_name": "test_sprite1" + }, + { + "type": "variable", + "variable_name": "test_sprite2" + } + ], + "store_result": "vector" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "vector", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "vector", + "variable_field": "y" + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/terminal.json b/coresdk/src/test/splashkit-test-generator/data/tests/terminal.json new file mode 100644 index 00000000..e4e831ab --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/terminal.json @@ -0,0 +1,334 @@ +{ + "group": "terminal", + "tests": [ + { + "name": "read_char", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Enter the letter A" + }, + { + "type": "function", + "function_name": "read_char", + "args": [], + "store_result": "result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "char", + "value": "A" + }, + "value2": { + "type": "variable", + "variable_name": "result" + } + } + } + ] + }, + { + "name": "read_line", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Enter the text: Test Input" + }, + { + "type": "function", + "function_name": "read_line", + "args": [], + "store_result": "result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Input" + }, + "value2": { + "type": "variable", + "variable_name": "result" + } + } + } + ] + }, + { + "name": "terminal_has_input", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Enter some text: Some Input" + }, + { + "type": "function", + "function_name": "terminal_has_input", + "args": [], + "store_result": "result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "variable", + "variable_name": "result" + } + } + } + ] + }, + { + "name": "write", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print Test String:" + }, + { + "type": "function", + "function_name": "write", + "args": [ + { + "type": "string", + "value": "Test String" + } + ] + }, + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + } + ] + }, + { + "name": "write_int", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print 42:" + }, + { + "type": "function", + "function_name": "write_int", + "args": [ + { + "type": "int", + "value": 42 + } + ] + }, + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + } + ] + }, + { + "name": "write_double", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print 3.14:" + }, + { + "type": "function", + "function_name": "write_double", + "args": [ + { + "type": "double", + "value": 3.14 + } + ] + }, + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + } + ] + }, + { + "name": "write_char", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print A:" + }, + { + "type": "function", + "function_name": "write_char", + "args": [ + { + "type": "char", + "value": "A" + } + ] + }, + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + } + ] + }, + { + "name": "write_line", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print Test Line:" + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "Test Line" + } + ] + } + ] + }, + { + "name": "write_line_empty", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print empty line:" + }, + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + } + ] + }, + { + "name": "write_line_int", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print 42:" + }, + { + "type": "function", + "function_name": "write_line_int", + "args": [ + { + "type": "int", + "value": 42 + } + ] + } + ] + }, + { + "name": "write_line_double", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print 3.14:" + }, + { + "type": "function", + "function_name": "write_line_double", + "args": [ + { + "type": "double", + "value": 3.14 + } + ] + } + ] + }, + { + "name": "write_line_char", + "steps": [ + { + "type": "function", + "function_name": "write_line_empty", + "args": [] + }, + { + "type": "message", + "message": "Should print A:" + }, + { + "type": "function", + "function_name": "write_line_char", + "args": [ + { + "type": "char", + "value": "A" + } + ] + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/timers.json b/coresdk/src/test/splashkit-test-generator/data/tests/timers.json new file mode 100644 index 00000000..7b175ef9 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/timers.json @@ -0,0 +1,1574 @@ +{ + "group": "timers", + "cleanup": [ + { + "cleanup_type": "timer", + "function_name": "free_all_timers", + "args": [] + } + ], + "tests": [ + { + "name": "create_timer", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 1" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_timer" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 1" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_all_timers", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 2" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 3" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 2" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 3" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_all_timers", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 2" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 3" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "free_timer", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 4" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 4" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 4" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "has_timer_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 5" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 5" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "free_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 5" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "pause_timer_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 6" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "pause_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 6" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "timer_paused_named", + "args": [ + { + "type": "string", + "value": "Test Timer 6" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "initial_ticks" + }, + "value2": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + } + } + } + ] + }, + { + "name": "pause_timer", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 7" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "pause_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "initial_ticks" + }, + "value2": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + } + } + } + ] + }, + { + "name": "reset_timer_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 8" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "reset_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 8" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "less_than", + "value1": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "initial_ticks" + } + } + } + ] + }, + { + "name": "reset_timer", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 9" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "reset_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "less_than", + "value1": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "initial_ticks" + } + } + } + ] + }, + { + "name": "resume_timer_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 10" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "pause_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "resume_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 10" + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "initial_ticks" + } + } + } + ] + }, + { + "name": "resume_timer", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 11" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "pause_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "resume_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "initial_ticks" + } + } + } + ] + }, + { + "name": "start_timer_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 12" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 12" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "timer_started_named", + "args": [ + { + "type": "string", + "value": "Test Timer 12" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "start_timer", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 13" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "timer_started", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "stop_timer_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 14" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": { + "type": "unsigned_int", + "value": 40 + } + } + }, + { + "type": "function", + "function_name": "stop_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 14" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "unsigned_int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + } + } + } + ] + }, + { + "name": "stop_timer", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 15" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "timer_started", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "stop_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "timer_started", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "timer_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 16" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 16" + } + ], + "store_result": "named_timer" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_timer" + }, + "value2": { + "type": "variable", + "variable_name": "named_timer" + } + } + } + ] + }, + { + "name": "timer_paused_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 17" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "timer_paused_named", + "args": [ + { + "type": "string", + "value": "Test Timer 17" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "pause_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 17" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "timer_paused_named", + "args": [ + { + "type": "string", + "value": "Test Timer 17" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "timer_paused", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 18" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "timer_paused", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "pause_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "timer_paused", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "timer_started_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 19" + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "timer_started_named", + "args": [ + { + "type": "string", + "value": "Test Timer 19" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "start_timer_named", + "args": [ + { + "type": "string", + "value": "Test Timer 19" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "timer_started_named", + "args": [ + { + "type": "string", + "value": "Test Timer 19" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "timer_started", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 20" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "timer_started", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "timer_started", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "timer_ticks_named", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 21" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks_named", + "args": [ + { + "type": "string", + "value": "Test Timer 21" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks_named", + "args": [ + { + "type": "string", + "value": "Test Timer 21" + } + ], + "store_result": "after_delay_ticks" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "after_delay_ticks" + }, + "value2": { + "type": "variable", + "variable_name": "initial_ticks" + } + } + } + ] + }, + { + "name": "timer_ticks", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 22" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "after_delay_ticks" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "after_delay_ticks" + }, + "value2": { + "type": "variable", + "variable_name": "initial_ticks" + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/utilities.json b/coresdk/src/test/splashkit-test-generator/data/tests/utilities.json new file mode 100644 index 00000000..c09beef4 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/utilities.json @@ -0,0 +1,2436 @@ +{ + "group": "utilities", + "constructor": [ + { + "type": "function", + "function_name": "set_resources_path", + "args": [ + { + "type": "string", + "value": "set this value before running tests, use an absolute path" + } + ] + } + ], + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "font", + "function_name": "free_all_fonts", + "args": [] + }, + { + "cleanup_type": "timer", + "function_name": "free_all_timers", + "args": [] + } + ], + "tests": [ + { + "name": "display_dialog", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 2" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "load_font", + "args": [ + { + "type": "string", + "value": "test_font" + }, + { + "type": "string", + "value": "hara.ttf" + } + ], + "store_result": "test_font" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "font", + "store_result": "cleanup_font" + }, + { + "type": "function", + "function_name": "display_dialog", + "args": [ + { + "type": "string", + "value": "Test Dialog" + }, + { + "type": "string", + "value": "This is a test message" + }, + { + "type": "variable", + "variable_name": "test_font" + }, + { + "type": "int", + "value": 20 + } + ] + }, + { + "type": "function", + "function_name": "free_font", + "args": [ + { + "type": "variable", + "variable_name": "test_font" + } + ] + } + ] + }, + { + "name": "contains", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "contains", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "splashkit" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "contains", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "library" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "contains", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "it lib" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "contains", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "contains", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "unreal" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "contains", + "args": [ + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "splashkit" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "convert_to_double", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123.0 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "123" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 123.456 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "123.456" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -123.0 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "-123" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": -123.456 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "-123.456" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 0.456 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": ".456" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123.0 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "123." + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 123.456 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "000123.456" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 123.456 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "123.456000" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "inf" + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "inf" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "neg_inf" + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "-inf" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123.0 + }, + "value2": { + "type": "function", + "function_name": "convert_to_double", + "args": [ + { + "type": "string", + "value": "1.23e2" + } + ] + } + } + } + ] + }, + { + "name": "convert_to_integer", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123 + }, + "value2": { + "type": "function", + "function_name": "convert_to_integer", + "args": [ + { + "type": "string", + "value": "123" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123 + }, + "value2": { + "type": "function", + "function_name": "convert_to_integer", + "args": [ + { + "type": "string", + "value": "123.456" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -123 + }, + "value2": { + "type": "function", + "function_name": "convert_to_integer", + "args": [ + { + "type": "string", + "value": "-123" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -123 + }, + "value2": { + "type": "function", + "function_name": "convert_to_integer", + "args": [ + { + "type": "string", + "value": "-123.456" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123 + }, + "value2": { + "type": "function", + "function_name": "convert_to_integer", + "args": [ + { + "type": "string", + "value": "123." + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123 + }, + "value2": { + "type": "function", + "function_name": "convert_to_integer", + "args": [ + { + "type": "string", + "value": "000123.456" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 123 + }, + "value2": { + "type": "function", + "function_name": "convert_to_integer", + "args": [ + { + "type": "string", + "value": "123.456000" + } + ] + } + } + } + ] + }, + { + "name": "index_of", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "splashkit" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 10 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "library" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 7 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "it lib" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -1 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "unreal" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "splashkit library" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -1 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "splashkit library is the best" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": -1 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "splashkit" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "index_of", + "args": [ + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "" + } + ] + } + } + } + ] + }, + { + "name": "is_double", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "123.456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "123" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "-123.456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "-123" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "123." + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "000123.456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "123.456000" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": ".456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "SplashKit" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_double", + "args": [ + { + "type": "string", + "value": "" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "is_integer", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_integer", + "args": [ + { + "type": "string", + "value": "123" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_integer", + "args": [ + { + "type": "string", + "value": "-123" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_integer", + "args": [ + { + "type": "string", + "value": "123.456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_integer", + "args": [ + { + "type": "string", + "value": "-123.456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_integer", + "args": [ + { + "type": "string", + "value": ".456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_integer", + "args": [ + { + "type": "string", + "value": "SplashKit" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_integer", + "args": [ + { + "type": "string", + "value": "" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "is_number", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_number", + "args": [ + { + "type": "string", + "value": "123" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_number", + "args": [ + { + "type": "string", + "value": "123.456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_number", + "args": [ + { + "type": "string", + "value": "-123" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_number", + "args": [ + { + "type": "string", + "value": "-123.456" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_number", + "args": [ + { + "type": "string", + "value": "SplashKit" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_number", + "args": [ + { + "type": "string", + "value": "" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "length_of", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 9 + }, + "value2": { + "type": "function", + "function_name": "length_of", + "args": [ + { + "type": "string", + "value": "splashkit" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "length_of", + "args": [ + { + "type": "string", + "value": "" + } + ] + } + } + } + ] + }, + { + "name": "replace_all", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "SK library" + }, + "value2": { + "type": "function", + "function_name": "replace_all", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "splashkit" + }, + { + "type": "string", + "value": "SK" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit lib" + }, + "value2": { + "type": "function", + "function_name": "replace_all", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "library" + }, + { + "type": "string", + "value": "lib" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkitlibrary" + }, + "value2": { + "type": "function", + "function_name": "replace_all", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "it lib" + }, + { + "type": "string", + "value": "itlib" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit library" + }, + "value2": { + "type": "function", + "function_name": "replace_all", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "unreal" + }, + { + "type": "string", + "value": "tournament" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "SK" + }, + "value2": { + "type": "function", + "function_name": "replace_all", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "SK" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": " library" + }, + "value2": { + "type": "function", + "function_name": "replace_all", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "splashkit" + }, + { + "type": "string", + "value": "" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit library" + }, + "value2": { + "type": "function", + "function_name": "replace_all", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "SK" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "function", + "function_name": "replace_all", + "args": [ + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "SK" + } + ] + } + } + } + ] + }, + { + "name": "split", + "steps": [ + { + "type": "function", + "function_name": "split", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "char", + "value": " " + } + ], + "store_result": "result" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "splashkit" + }, + { + "type": "string", + "value": "library" + } + ] + }, + "value2": { + "type": "variable", + "variable_name": "result" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "" + } + ] + }, + "value2": { + "type": "function", + "function_name": "split", + "args": [ + { + "type": "string", + "value": "" + }, + { + "type": "char", + "value": " " + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "splashkit library" + } + ] + }, + "value2": { + "type": "function", + "function_name": "split", + "args": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "char", + "value": "," + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "splashkit library" + } + ] + }, + "value2": { + "type": "function", + "function_name": "split", + "args": [ + { + "type": "string", + "value": ",splashkit library" + }, + { + "type": "char", + "value": "," + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "" + } + ] + }, + "value2": { + "type": "function", + "function_name": "split", + "args": [ + { + "type": "string", + "value": "splashkit library," + }, + { + "type": "char", + "value": "," + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "splashkit library" + }, + { + "type": "string", + "value": "" + } + ] + }, + "value2": { + "type": "function", + "function_name": "split", + "args": [ + { + "type": "string", + "value": ",splashkit library," + }, + { + "type": "char", + "value": "," + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "list", + "target_type": "string", + "value": [ + { + "type": "string", + "value": "splashkit" + }, + { + "type": "string", + "value": "" + }, + { + "type": "string", + "value": "library" + } + ] + }, + "value2": { + "type": "function", + "function_name": "split", + "args": [ + { + "type": "string", + "value": "splashkit,,library" + }, + { + "type": "char", + "value": "," + } + ] + } + } + } + ] + }, + { + "name": "to_lowercase", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit" + }, + "value2": { + "type": "function", + "function_name": "to_lowercase", + "args": [ + { + "type": "string", + "value": "SPLASHKIT" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "function", + "function_name": "to_lowercase", + "args": [ + { + "type": "string", + "value": "" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit" + }, + "value2": { + "type": "function", + "function_name": "to_lowercase", + "args": [ + { + "type": "string", + "value": "splashkit" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit" + }, + "value2": { + "type": "function", + "function_name": "to_lowercase", + "args": [ + { + "type": "string", + "value": "SpLaShKiT" + } + ] + } + } + } + ] + }, + { + "name": "to_uppercase", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "SPLASHKIT" + }, + "value2": { + "type": "function", + "function_name": "to_uppercase", + "args": [ + { + "type": "string", + "value": "splashkit" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "function", + "function_name": "to_uppercase", + "args": [ + { + "type": "string", + "value": "" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "SPLASHKIT" + }, + "value2": { + "type": "function", + "function_name": "to_uppercase", + "args": [ + { + "type": "string", + "value": "SPLASHKIT" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "SPLASHKIT" + }, + "value2": { + "type": "function", + "function_name": "to_uppercase", + "args": [ + { + "type": "string", + "value": "SpLaShKiT" + } + ] + } + } + } + ] + }, + { + "name": "trim", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit" + }, + "value2": { + "type": "function", + "function_name": "trim", + "args": [ + { + "type": "string", + "value": " splashkit" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit" + }, + "value2": { + "type": "function", + "function_name": "trim", + "args": [ + { + "type": "string", + "value": "splashkit " + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit" + }, + "value2": { + "type": "function", + "function_name": "trim", + "args": [ + { + "type": "string", + "value": " splashkit " + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "splashkit" + }, + "value2": { + "type": "function", + "function_name": "trim", + "args": [ + { + "type": "string", + "value": "splashkit" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "function", + "function_name": "trim", + "args": [ + { + "type": "string", + "value": "" + } + ] + } + } + } + ] + }, + { + "name": "rnd_range", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "rnd_range", + "args": [ + { + "type": "int", + "value": -1 + }, + { + "type": "int", + "value": 5 + } + ] + }, + "value2": { + "type": "int", + "value": -1 + }, + "value3": { + "type": "int", + "value": 5 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1 + }, + "value2": { + "type": "function", + "function_name": "rnd_range", + "args": [ + { + "type": "int", + "value": 1 + }, + { + "type": "int", + "value": 1 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "rnd_range", + "args": [ + { + "type": "int", + "value": 5 + }, + { + "type": "int", + "value": 1 + } + ] + }, + "value2": { + "type": "int", + "value": 1 + }, + "value3": { + "type": "int", + "value": 5 + } + } + } + ] + }, + { + "name": "rnd", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "rnd", + "args": [] + }, + "value2": { + "type": "int", + "value": 0.0 + }, + "value3": { + "type": "max_value" + } + } + } + ] + }, + { + "name": "rnd_int", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "rnd_int", + "args": [ + { + "type": "int", + "value": 1 + } + ] + }, + "value2": { + "type": "int", + "value": 0 + }, + "value3": { + "type": "int", + "value": 1 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "range", + "value1": { + "type": "function", + "function_name": "rnd_int", + "args": [ + { + "type": "int", + "value": 10 + } + ] + }, + "value2": { + "type": "int", + "value": 0 + }, + "value3": { + "type": "int", + "value": 10 + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "rnd_int", + "args": [ + { + "type": "int", + "value": -1 + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 0 + }, + "value2": { + "type": "function", + "function_name": "rnd_int", + "args": [ + { + "type": "int", + "value": 0 + } + ] + } + } + } + ] + }, + { + "name": "current_ticks", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 1" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "function", + "function_name": "current_ticks", + "args": [], + "store_result": "test_ticks" + }, + { + "type": "assertion", + "compare": { + "compare_type": "greater_than", + "value1": { + "type": "variable", + "variable_name": "test_ticks" + }, + "value2": { + "type": "int", + "value": 0 + } + } + } + ] + }, + { + "name": "delay", + "steps": [ + { + "type": "function", + "function_name": "create_timer", + "args": [ + { + "type": "string", + "value": "Test Timer 1" + } + ], + "store_result": "test_timer" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "timer", + "store_result": "cleanup_timer" + }, + { + "type": "function", + "function_name": "start_timer", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + }, + { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ], + "store_result": "initial_ticks" + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "less_than", + "value1": { + "type": "variable", + "variable_name": "initial_ticks + 200" + }, + "value2": { + "type": "function", + "function_name": "timer_ticks", + "args": [ + { + "type": "variable", + "variable_name": "test_timer" + } + ] + } + } + } + ] + }, + { + "name": "file_as_string", + "steps": [ + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "BITMAP,ufo,ufo.png\\n" + }, + "value2": { + "type": "function", + "function_name": "file_as_string", + "args": [ + { + "type": "string", + "value": "blah.txt" + }, + { + "type": "enum", + "enum_type": "resource_kind", + "value": "bundle_resource" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "function", + "function_name": "file_as_string", + "args": [ + { + "type": "string", + "value": "" + }, + { + "type": "enum", + "enum_type": "resource_kind", + "value": "bundle_resource" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "" + }, + "value2": { + "type": "function", + "function_name": "file_as_string", + "args": [ + { + "type": "string", + "value": "invalid.txt" + }, + { + "type": "enum", + "enum_type": "resource_kind", + "value": "bundle_resource" + } + ] + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/data/tests/windows.json b/coresdk/src/test/splashkit-test-generator/data/tests/windows.json new file mode 100644 index 00000000..e2153b91 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/data/tests/windows.json @@ -0,0 +1,4617 @@ +{ + "group": "windows", + "cleanup": [ + { + "cleanup_type": "window", + "function_name": "close_all_windows", + "args": [] + }, + { + "cleanup_type": "bitmap", + "function_name": "free_all_bitmaps", + "args": [] + } + ], + "tests": [ + { + "name": "clear_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 1" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "color_black", + "args": [], + "store_result": "test_color" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "test_color" + } + ] + }, + { + "type": "function", + "function_name": "refresh_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "get_pixel_at_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 0.0 + }, + { + "type": "double", + "value": 0.0 + } + ] + } + ], + "store_result": "pixel" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_color" + }, + "value2": { + "type": "variable", + "variable_name": "pixel" + } + } + } + ] + }, + { + "name": "close_all_windows", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 2" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "function", + "function_name": "close_all_windows", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "string", + "value": "Test Window 3" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "close_current_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 4" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "close_current_window", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "string", + "value": "Test Window 4" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "write_line", + "args": [ + { + "type": "string", + "value": "Python pointer register creates an instance if passed None instead of returning None" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "null", + "value1": { + "type": "function", + "function_name": "current_window", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "close_window_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 5" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "string", + "value": "Test Window 5" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_window_named", + "args": [ + { + "type": "string", + "value": "Test Window 5" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "string", + "value": "Test Window 5" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "close_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 6" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "window_caption", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "window_name" + }, + { + "type": "function", + "function_name": "close_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "variable", + "variable_name": "window_name" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "current_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 7" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 8" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window2" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_window2" + }, + "value2": { + "type": "function", + "function_name": "current_window", + "args": [] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window2" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window1" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "current_window_has_border", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 9" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "current_window_has_border", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "current_window_toggle_border", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "current_window_has_border", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "current_window_height", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 10" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 600 + }, + "value2": { + "type": "function", + "function_name": "current_window_height", + "args": [] + } + } + }, + { + "type": "function", + "function_name": "resize_current_window", + "args": [ + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 400 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 400 + }, + "value2": { + "type": "function", + "function_name": "current_window_height", + "args": [] + } + } + } + ] + }, + { + "name": "current_window_is_fullscreen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 11" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "current_window_is_fullscreen", + "args": [] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "current_window_toggle_fullscreen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "current_window_is_fullscreen", + "args": [] + }, + "value2": null + } + } + ] + }, + { + "name": "current_window_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 12" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "move_current_window_to", + "args": [ + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "current_window_position", + "args": [], + "store_result": "position" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0, + "alt_value": 68.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0, + "alt_value": 168.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "current_window_toggle_border", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 13" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "current_window_has_border", + "args": [], + "store_result": "initial_border" + }, + { + "type": "function", + "function_name": "current_window_toggle_border", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_border" + }, + "value2": { + "type": "function", + "function_name": "current_window_has_border", + "args": [] + } + } + } + ] + }, + { + "name": "current_window_toggle_fullscreen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 14" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "current_window_is_fullscreen", + "args": [], + "store_result": "initial_fullscreen" + }, + { + "type": "function", + "function_name": "current_window_toggle_fullscreen", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "variable", + "variable_name": "initial_fullscreen" + }, + "value2": { + "type": "function", + "function_name": "current_window_is_fullscreen", + "args": [] + } + } + } + ] + }, + { + "name": "current_window_width", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 15" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 800 + }, + "value2": { + "type": "function", + "function_name": "current_window_width", + "args": [] + } + } + }, + { + "type": "function", + "function_name": "resize_current_window", + "args": [ + { + "type": "int", + "value": 400 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 400 + }, + "value2": { + "type": "function", + "function_name": "current_window_width", + "args": [] + } + } + } + ] + }, + { + "name": "current_window_x", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 16" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "move_current_window_to", + "args": [ + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100, + "alt_value": 68 + }, + "value2": { + "type": "function", + "function_name": "current_window_x", + "args": [] + } + } + }, + { + "type": "function", + "function_name": "move_current_window_to", + "args": [ + { + "type": "int", + "value": 300 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 300, + "alt_value": 268 + }, + "value2": { + "type": "function", + "function_name": "current_window_x", + "args": [] + } + } + } + ] + }, + { + "name": "current_window_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 17" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "move_current_window_to", + "args": [ + { + "type": "int", + "value": 0 + }, + { + "type": "int", + "value": 100 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100, + "alt_value": 68 + }, + "value2": { + "type": "function", + "function_name": "current_window_y", + "args": [] + } + } + } + ] + }, + { + "name": "has_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 18" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "string", + "value": "Test Window 18" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "function", + "function_name": "window_caption", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "close_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "has_window", + "args": [ + { + "type": "string", + "value": "Test Window 18" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "is_current_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 19" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 20" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window2" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window1" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "is_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window1" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "is_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window2" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "move_current_window_to", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 21" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "move_current_window_to", + "args": [ + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100, + "alt_value": 68 + }, + "value2": { + "type": "function", + "function_name": "current_window_x", + "args": [] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 200, + "alt_value": 168 + }, + "value2": { + "type": "function", + "function_name": "current_window_y", + "args": [] + } + } + } + ] + }, + { + "name": "move_window_to_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 22" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to_named", + "args": [ + { + "type": "string", + "value": "Test Window 22" + }, + { + "type": "int", + "value": 150 + }, + { + "type": "int", + "value": 250 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 150, + "alt_value": 118 + }, + "value2": { + "type": "function", + "function_name": "window_x_named", + "args": [ + { + "type": "string", + "value": "Test Window 22" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 250, + "alt_value": 218 + }, + "value2": { + "type": "function", + "function_name": "window_y_named", + "args": [ + { + "type": "string", + "value": "Test Window 22" + } + ] + } + } + } + ] + }, + { + "name": "move_window_to", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 23" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 300 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 200, + "alt_value": 168 + }, + "value2": { + "type": "function", + "function_name": "window_x", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 300, + "alt_value": 268 + }, + "value2": { + "type": "function", + "function_name": "window_y", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "open_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 24" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "not_null", + "value1": { + "type": "variable", + "variable_name": "test_window" + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Window 24" + }, + "value2": { + "type": "function", + "function_name": "window_caption", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 800 + }, + "value2": { + "type": "function", + "function_name": "window_width", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 600 + }, + "value2": { + "type": "function", + "function_name": "window_height", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "refresh_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 25" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_circle", + "args": [ + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 300.0 + }, + { + "type": "double", + "value": 50.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "get_pixel_at_point", + "args": [ + { + "type": "function", + "function_name": "point_at", + "args": [ + { + "type": "double", + "value": 400.0 + }, + { + "type": "double", + "value": 350.0 + } + ] + } + ], + "store_result": "pixel" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "color_black", + "args": [] + }, + "value2": { + "type": "variable", + "variable_name": "pixel" + } + } + } + ] + }, + { + "name": "refresh_window_with_target_fps", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 26" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "refresh_window_with_target_fps", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "unsigned_int", + "value": 60 + } + ] + } + ] + }, + { + "name": "resize_current_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 27" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "function", + "function_name": "resize_current_window", + "args": [ + { + "type": "int", + "value": 1024 + }, + { + "type": "int", + "value": 768 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1024 + }, + "value2": { + "type": "function", + "function_name": "window_width", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 768 + }, + "value2": { + "type": "function", + "function_name": "window_height", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "resize_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 28" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "resize_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 1024 + }, + { + "type": "int", + "value": 768 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1024 + }, + "value2": { + "type": "function", + "function_name": "window_width", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 768 + }, + "value2": { + "type": "function", + "function_name": "window_height", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "set_current_window_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 29" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 30" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window2" + }, + { + "type": "function", + "function_name": "set_current_window_named", + "args": [ + { + "type": "string", + "value": "Test Window 30" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_window2" + }, + "value2": { + "type": "function", + "function_name": "current_window", + "args": [] + } + } + } + ] + }, + { + "name": "set_current_window", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 31" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 32" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window2" + }, + { + "type": "function", + "function_name": "set_current_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window2" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_window2" + }, + "value2": { + "type": "function", + "function_name": "current_window", + "args": [] + } + } + } + ] + }, + { + "name": "window_caption", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 33" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "string", + "value": "Test Window 33" + }, + "value2": { + "type": "function", + "function_name": "window_caption", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "window_close_requested_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 34" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_close_requested_named", + "args": [ + { + "type": "string", + "value": "Test Window 34" + } + ] + }, + "value2": null + } + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_close_requested_named", + "args": [ + { + "type": "string", + "value": "Test Window 34" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: window_close_requested_named. Close window to pass." + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_close_requested_named", + "args": [ + { + "type": "string", + "value": "Test Window 34" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_close_requested", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 35" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_close_requested", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + }, + { + "type": "while", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_close_requested", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size", + "args": [ + { + "type": "string", + "value": "Test: window_close_requested. Close window to pass." + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_close_requested", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_has_border_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 36" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_has_border_named", + "args": [ + { + "type": "string", + "value": "Test Window 36" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "window_toggle_border_named", + "args": [ + { + "type": "string", + "value": "Test Window 36" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_has_border_named", + "args": [ + { + "type": "string", + "value": "Test Window 36" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_has_border", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 37" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_has_border", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "window_toggle_border", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_has_border", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_has_focus", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 38" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 39" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window2" + }, + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_has_focus", + "args": [ + { + "type": "variable", + "variable_name": "test_window2" + } + ] + }, + "value2": null + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_has_focus", + "args": [ + { + "type": "variable", + "variable_name": "test_window1" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_height_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 40" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 600 + }, + "value2": { + "type": "function", + "function_name": "window_height_named", + "args": [ + { + "type": "string", + "value": "Test Window 40" + } + ] + } + } + }, + { + "type": "function", + "function_name": "resize_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 400 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 400 + }, + "value2": { + "type": "function", + "function_name": "window_height_named", + "args": [ + { + "type": "string", + "value": "Test Window 40" + } + ] + } + } + } + ] + }, + { + "name": "window_height", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 41" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 600 + }, + "value2": { + "type": "function", + "function_name": "window_height", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "function", + "function_name": "resize_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 400 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 400 + }, + "value2": { + "type": "function", + "function_name": "window_height", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "window_is_fullscreen_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 42" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_is_fullscreen_named", + "args": [ + { + "type": "string", + "value": "Test Window 42" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "window_toggle_fullscreen_named", + "args": [ + { + "type": "string", + "value": "Test Window 42" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_is_fullscreen_named", + "args": [ + { + "type": "string", + "value": "Test Window 42" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_is_fullscreen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 43" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_is_fullscreen", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "window_toggle_fullscreen", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_is_fullscreen", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 44" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "window_named", + "args": [ + { + "type": "string", + "value": "Test Window 44" + } + ], + "store_result": "named_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_window" + }, + "value2": { + "type": "variable", + "variable_name": "named_window" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "function", + "function_name": "window_caption", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": { + "type": "function", + "function_name": "window_caption", + "args": [ + { + "type": "variable", + "variable_name": "named_window" + } + ] + } + } + } + ] + }, + { + "name": "window_position_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 45" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to_named", + "args": [ + { + "type": "string", + "value": "Test Window 45" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 500 + } + ] + }, + { + "type": "function", + "function_name": "window_position_named", + "args": [ + { + "type": "string", + "value": "Test Window 45" + } + ], + "store_result": "position" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0, + "alt_value": 68.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0, + "alt_value": 168.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "window_position", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 46" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 500 + } + ] + }, + { + "type": "function", + "function_name": "window_position", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ], + "store_result": "position" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 100.0, + "alt_value": 68.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "x" + } + } + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "double", + "value": 200.0, + "alt_value": 168.0 + }, + "value2": { + "type": "variable_field", + "variable_name": "position", + "variable_field": "y" + } + } + } + ] + }, + { + "name": "window_set_icon", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 47" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "create_bitmap", + "args": [ + { + "type": "string", + "value": "Test Bitmap 1" + }, + { + "type": "int", + "value": 32 + }, + { + "type": "int", + "value": 32 + } + ], + "store_result": "icon" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "bitmap", + "store_result": "cleanup_bitmap" + }, + { + "type": "function", + "function_name": "clear_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "icon" + }, + { + "type": "function", + "function_name": "color_white", + "args": [] + } + ] + }, + { + "type": "function", + "function_name": "window_set_icon", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "variable", + "variable_name": "icon" + } + ] + }, + { + "type": "function", + "function_name": "free_bitmap", + "args": [ + { + "type": "variable", + "variable_name": "icon" + } + ] + } + ] + }, + { + "name": "window_toggle_border_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 48" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_has_border_named", + "args": [ + { + "type": "string", + "value": "Test Window 48" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "window_toggle_border_named", + "args": [ + { + "type": "string", + "value": "Test Window 48" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_has_border_named", + "args": [ + { + "type": "string", + "value": "Test Window 48" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_toggle_border", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 49" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_has_border", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "window_toggle_border", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_has_border", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_toggle_fullscreen_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 50" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_is_fullscreen_named", + "args": [ + { + "type": "string", + "value": "Test Window 50" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "window_toggle_fullscreen_named", + "args": [ + { + "type": "string", + "value": "Test Window 50" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_is_fullscreen_named", + "args": [ + { + "type": "string", + "value": "Test Window 50" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_toggle_fullscreen", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 51" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "false", + "value1": { + "type": "function", + "function_name": "window_is_fullscreen", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + }, + { + "type": "function", + "function_name": "window_toggle_fullscreen", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "true", + "value1": { + "type": "function", + "function_name": "window_is_fullscreen", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + }, + "value2": null + } + } + ] + }, + { + "name": "window_width_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 52" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 800 + }, + "value2": { + "type": "function", + "function_name": "window_width_named", + "args": [ + { + "type": "string", + "value": "Test Window 52" + } + ] + } + } + }, + { + "type": "function", + "function_name": "resize_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 1024 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1024 + }, + "value2": { + "type": "function", + "function_name": "window_width_named", + "args": [ + { + "type": "string", + "value": "Test Window 52" + } + ] + } + } + } + ] + }, + { + "name": "window_width", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 53" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 800 + }, + "value2": { + "type": "function", + "function_name": "window_width", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "function", + "function_name": "resize_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 1024 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 1024 + }, + "value2": { + "type": "function", + "function_name": "window_width", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "window_with_focus", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 54" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window1" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to", + "args": [ + { + "type": "variable", + "variable_name": "test_window1" + }, + { + "type": "int", + "value": 200 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 500 + } + ] + }, + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 55" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window2" + }, + { + "type": "function", + "function_name": "move_window_to", + "args": [ + { + "type": "variable", + "variable_name": "test_window2" + }, + { + "type": "int", + "value": 850 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "function", + "function_name": "delay", + "args": [ + { + "type": "int", + "value": 500 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_window2" + }, + "value2": { + "type": "function", + "function_name": "window_with_focus", + "args": [] + } + } + }, + { + "type": "while", + "compare": { + "compare_type": "not_equal", + "value1": { + "type": "function", + "function_name": "window_with_focus", + "args": [] + }, + "value2": { + "type": "variable", + "variable_name": "test_window1" + } + }, + "while_steps": [ + { + "type": "function", + "function_name": "process_events", + "args": [] + }, + { + "type": "function", + "function_name": "clear_screen_to_white", + "args": [] + }, + { + "type": "function", + "function_name": "draw_text_no_font_no_size_with_options", + "args": [ + { + "type": "string", + "value": "Test: window_with_focus. Click this window to pass." + }, + { + "type": "function", + "function_name": "color_black", + "args": [] + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "double", + "value": 10.0 + }, + { + "type": "function", + "function_name": "option_draw_to_window", + "args": [ + { + "type": "variable", + "variable_name": "test_window1" + } + ] + } + ] + }, + { + "type": "function", + "function_name": "refresh_screen", + "args": [] + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "variable", + "variable_name": "test_window1" + }, + "value2": { + "type": "function", + "function_name": "window_with_focus", + "args": [] + } + } + } + ] + }, + { + "name": "window_x_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 56" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to_named", + "args": [ + { + "type": "string", + "value": "Test Window 56" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100, + "alt_value": 68 + }, + "value2": { + "type": "function", + "function_name": "window_x_named", + "args": [ + { + "type": "string", + "value": "Test Window 56" + } + ] + } + } + }, + { + "type": "function", + "function_name": "move_window_to_named", + "args": [ + { + "type": "string", + "value": "Test Window 56" + }, + { + "type": "int", + "value": 300 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 300, + "alt_value": 268 + }, + "value2": { + "type": "function", + "function_name": "window_x_named", + "args": [ + { + "type": "string", + "value": "Test Window 56" + } + ] + } + } + } + ] + }, + { + "name": "window_x", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 57" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 100, + "alt_value": 68 + }, + "value2": { + "type": "function", + "function_name": "window_x", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "function", + "function_name": "move_window_to", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 300 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 300, + "alt_value": 268 + }, + "value2": { + "type": "function", + "function_name": "window_x", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + }, + { + "name": "window_y_named", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 58" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ] + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to_named", + "args": [ + { + "type": "string", + "value": "Test Window 58" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 200, + "alt_value": 168 + }, + "value2": { + "type": "function", + "function_name": "window_y_named", + "args": [ + { + "type": "string", + "value": "Test Window 58" + } + ] + } + } + }, + { + "type": "function", + "function_name": "move_window_to_named", + "args": [ + { + "type": "string", + "value": "Test Window 58" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 400 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 400, + "alt_value": 368 + }, + "value2": { + "type": "function", + "function_name": "window_y_named", + "args": [ + { + "type": "string", + "value": "Test Window 58" + } + ] + } + } + } + ] + }, + { + "name": "window_y", + "steps": [ + { + "type": "function", + "function_name": "open_window", + "args": [ + { + "type": "string", + "value": "Test Window 59" + }, + { + "type": "int", + "value": 800 + }, + { + "type": "int", + "value": 600 + } + ], + "store_result": "test_window" + }, + { + "type": "cleanup", + "args": [], + "cleanup_type": "window", + "store_result": "cleanup_window" + }, + { + "type": "function", + "function_name": "move_window_to", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 200 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 200, + "alt_value": 168 + }, + "value2": { + "type": "function", + "function_name": "window_y", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + }, + { + "type": "function", + "function_name": "move_window_to", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + }, + { + "type": "int", + "value": 100 + }, + { + "type": "int", + "value": 400 + } + ] + }, + { + "type": "assertion", + "compare": { + "compare_type": "equal", + "value1": { + "type": "int", + "value": 400, + "alt_value": 368 + }, + "value2": { + "type": "function", + "function_name": "window_y", + "args": [ + { + "type": "variable", + "variable_name": "test_window" + } + ] + } + } + } + ] + } + ] +} diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/cpp/helpers.hpp b/coresdk/src/test/splashkit-test-generator/generated_tests/cpp/helpers.hpp new file mode 100644 index 00000000..1aba4388 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/cpp/helpers.hpp @@ -0,0 +1,318 @@ +#include "splashkit.h" + +template +std::string to_string_custom(const T& value) { + if constexpr (std::is_same_v) { + return value ? "true" : "false"; + } + else if constexpr (std::is_same_v) { + return value; + } + else { + return std::to_string(value); + } +} + +class sprite_delegates { +private: + int _float_function_call_count = 0; + int _function_call_count = 0; + bool _event_called = false; + static sprite_delegates* current_instance; + +public: + sprite_delegates() { + current_instance = this; + } + + static void event_handler_wrapper(void*, int evt) { + if (current_instance) { + current_instance->sprite_event_handler(nullptr, evt); + } + } + + static void float_function_wrapper(void*, float value) { + if (current_instance) { + current_instance->sprite_float_function(nullptr, value); + } + } + + static void function_wrapper(void*) { + if (current_instance) { + current_instance->sprite_function(nullptr); + } + } + + void (*sprite_event_handler())(void*, int) { + return &event_handler_wrapper; + } + + void (*sprite_float_function())(void*, float) { + return &float_function_wrapper; + } + + void (*sprite_function())(void*) { + return &function_wrapper; + } + + void sprite_float_function(void* ptr, float value) { + _float_function_call_count++; + _event_called = true; + } + + void sprite_function(void* ptr) { + _function_call_count++; + _event_called = true; + } + + void sprite_event_handler(void* ptr, int evt) { + _event_called = true; + } + + void reset() { + _float_function_call_count = 0; + _function_call_count = 0; + _event_called = false; + } + + bool event_called() const { return _event_called; } + int float_function_call_count() const { return _float_function_call_count; } + int function_call_count() const { return _function_call_count; } +}; + +class key_callbacks { +private: + key_code _key_typed = key_code(0); + key_code _key_down = key_code(0); + key_code _key_up = key_code(0); + static key_callbacks* current_instance; + +public: + key_callbacks() { + current_instance = this; + } + + static void key_typed_wrapper(int key) { + if (current_instance) { + current_instance->_key_typed = key_code(key); + } + } + + static void key_down_wrapper(int key) { + if (current_instance) { + current_instance->_key_down = key_code(key); + } + } + + static void key_up_wrapper(int key) { + if (current_instance) { + current_instance->_key_up = key_code(key); + } + } + + void (*on_key_typed())(int) { + return &key_typed_wrapper; + } + + void (*on_key_down())(int) { + return &key_down_wrapper; + } + + void (*on_key_up())(int) { + return &key_up_wrapper; + } + + void reset() { + _key_typed = key_code(0); + _key_down = key_code(0); + _key_up = key_code(0); + } + + key_code get_key_typed() const { return _key_typed; } + key_code get_key_down() const { return _key_down; } + key_code get_key_up() const { return _key_up; } +}; + +class notifier_tracker { +private: + bool _was_notified = false; + static notifier_tracker* current_instance; + +public: + notifier_tracker() { + current_instance = this; + } + + static void free_notify_wrapper(void*) { + if (current_instance) { + current_instance->on_free_impl(); + } + } + + void (*on_free())(void*) { + return &free_notify_wrapper; + } + + void on_free_impl() { + _was_notified = true; + } + + void reset() { + _was_notified = false; + } + + bool was_notified() const { + return _was_notified; + } +}; + +sprite_delegates* sprite_delegates::current_instance = nullptr; +key_callbacks* key_callbacks::current_instance = nullptr; +notifier_tracker* notifier_tracker::current_instance = nullptr; + +class animation_script_cleanup { +public: + ~animation_script_cleanup() { + free_all_animation_scripts(); + } +}; + +class animation_cleanup { +private: + animation _animation; +public: + animation_cleanup(animation anim) : _animation(anim) {} + ~animation_cleanup() { + free_animation(_animation); + } +}; + +class audio_cleanup { +public: + ~audio_cleanup() { + close_audio(); + } +}; + +class sound_effect_cleanup { +public: + ~sound_effect_cleanup() { + free_all_sound_effects(); + } +}; + +class music_cleanup { +public: + ~music_cleanup() { + free_all_music(); + } +}; + +class window_cleanup { +public: + ~window_cleanup() { + close_all_windows(); + set_camera_position(point_at(0, 0)); + } +}; + +class bitmap_cleanup { +public: + ~bitmap_cleanup() { + free_all_bitmaps(); + } +}; + +class sprite_cleanup { +public: + ~sprite_cleanup() { + free_all_sprites(); + } +}; + +class font_cleanup { +public: + ~font_cleanup() { + free_all_fonts(); + } +}; + +class raspberry_cleanup { +public: + ~raspberry_cleanup() { + raspi_cleanup(); + } +}; + +class json_cleanup { +public: + ~json_cleanup() { + free_all_json(); + } +}; + +class server_cleanup { +public: + ~server_cleanup() { + close_all_servers(); + } +}; + +class connection_cleanup { +public: + ~connection_cleanup() { + close_all_connections(); + } +}; + +class resource_cleanup { +private: + string _bundle_name; +public: + resource_cleanup(const string& bundle_name) : _bundle_name(bundle_name) {} + ~resource_cleanup() { + free_resource_bundle(_bundle_name); + } +}; + +class sprite_pack_cleanup { +private: + string _sprite_pack_name; +public: + sprite_pack_cleanup(const string& pack_name) : _sprite_pack_name(pack_name) {} + ~sprite_pack_cleanup() { + free_sprite_pack(_sprite_pack_name); + } +}; + +class timer_cleanup { +public: + ~timer_cleanup() { + free_all_timers(); + } +}; + +class logger_cleanup { +public: + ~logger_cleanup() { + close_log_process(); + } +}; + +class layout_cleanup { +public: + ~layout_cleanup() { + process_events(); + reset_layout(); + set_interface_style(interface_style::SHADED_DARK_STYLE); + process_events(); + } +}; + + +class interface_font_cleanup { +public: + ~interface_font_cleanup() { + set_interface_font(get_system_font()); + } +}; diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/cpp/test_main.cpp b/coresdk/src/test/splashkit-test-generator/generated_tests/cpp/test_main.cpp new file mode 100644 index 00000000..28d4847b --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/cpp/test_main.cpp @@ -0,0 +1,6 @@ +#define CATCH_CONFIG_RUNNER +#include + +int main(int argc, char* argv[]) { + return Catch::Session().run(argc, argv); +} \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/csharp/csharp.csproj b/coresdk/src/test/splashkit-test-generator/generated_tests/csharp/csharp.csproj new file mode 100644 index 00000000..1b1303bb --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/csharp/csharp.csproj @@ -0,0 +1,30 @@ + + + + net8.0 + enable + enable + + false + true + false + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/csharp/helpers.cs b/coresdk/src/test/splashkit-test-generator/generated_tests/csharp/helpers.cs new file mode 100644 index 00000000..f9a08dd3 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/csharp/helpers.cs @@ -0,0 +1,269 @@ +using SplashKitSDK; +using static SplashKitSDK.SplashKit; +namespace SplashKitTests +{ + public class SpriteDelegates + { + private bool _eventCalled; + private int _floatFunctionCallCount; + private int _functionCallCount; + + private readonly SpriteFloatFunction _spriteFloatDelegate; + private readonly SpriteFunction _spriteFunctionDelegate; + private readonly SpriteEventHandler _spriteEventDelegate; + + + public SpriteDelegates() + { + _spriteFloatDelegate = (ptr, value) => + { + _floatFunctionCallCount++; + _eventCalled = true; + }; + + _spriteFunctionDelegate = (ptr) => + { + _functionCallCount++; + _eventCalled = true; + }; + _spriteEventDelegate = (ptr, evt) => + { + _eventCalled = true; + }; + } + + public SpriteFloatFunction SpriteFloatFunction() + { + return _spriteFloatDelegate; + } + + public SpriteFunction SpriteFunction() + { + return _spriteFunctionDelegate; + } + + public SpriteEventHandler SpriteEventHandler() + { + return _spriteEventDelegate; + } + + public bool EventCalled() { return _eventCalled; } + public int FloatFunctionCallCount() { return _floatFunctionCallCount; } + public int FunctionCallCount() { return _functionCallCount; } + + public void Reset() + { + _floatFunctionCallCount = 0; + _functionCallCount = 0; + _eventCalled = false; + } + } + + public class KeyCallbacks + { + private KeyCode _lastKeyTyped; + private KeyCode _lastKeyDown; + private KeyCode _lastKeyUp; + private KeyCallback _onKeyTyped; + private KeyCallback _onKeyDown; + private KeyCallback _onKeyUp; + + public KeyCallbacks() + { + _onKeyTyped = (key) => _lastKeyTyped = (KeyCode)key; + _onKeyDown = (key) => _lastKeyDown = (KeyCode)key; + _onKeyUp = (key) => _lastKeyUp = (KeyCode)key; + } + + public KeyCallback OnKeyTyped() + { + return _onKeyTyped; + } + + public KeyCallback OnKeyDown() + { + return _onKeyDown; + } + + public KeyCallback OnKeyUp() + { + return _onKeyUp; + } + + public KeyCode GetKeyTyped() { return _lastKeyTyped; } + public KeyCode GetKeyDown() { return _lastKeyDown; } + public KeyCode GetKeyUp() { return _lastKeyUp; } + + public void Reset() + { + _lastKeyTyped = 0; + _lastKeyDown = 0; + _lastKeyUp = 0; + } + } + + public class NotifierTracker + { + private bool _wasNotified; + private FreeNotifier _onFree; + + public NotifierTracker() + { + _onFree = (resource) => _wasNotified = true; + } + public FreeNotifier OnFree() + { + return _onFree; + } + + public bool WasNotified() { return _wasNotified; } + + public void Reset() + { + _wasNotified = false; + } + } + public class AnimationScriptCleanup : IDisposable + { + public void Dispose() + { + FreeAllAnimationScripts(); + } + } + public class AnimationCleanup(Animation animation) : IDisposable + { + private readonly Animation _animation = animation; + public void Dispose() + { + FreeAnimation(_animation); + } + } + public class AudioCleanup : IDisposable + { + public void Dispose() + { + CloseAudio(); + } + } + public class SoundEffectCleanup : IDisposable + { + public void Dispose() + { + FreeAllSoundEffects(); + } + } + public class MusicCleanup : IDisposable + { + public void Dispose() + { + FreeAllMusic(); + } + } + public class WindowCleanup : IDisposable + { + public void Dispose() + { + CloseAllWindows(); + SetCameraPosition(PointAt(0, 0)); + } + } + public class BitmapCleanup : IDisposable + { + public void Dispose() + { + FreeAllBitmaps(); + } + } + public class SpriteCleanup : IDisposable + { + public void Dispose() + { + FreeAllSprites(); + } + } + public class FontCleanup : IDisposable + { + public void Dispose() + { + FreeAllFonts(); + } + } + public class RaspberryCleanup : IDisposable + { + public void Dispose() + { + RaspiCleanup(); + } + } + public class JsonCleanup : IDisposable + { + public void Dispose() + { + FreeAllJson(); + } + } + public class ServerCleanup : IDisposable + { + public void Dispose() + { + CloseAllServers(); + } + } + public class ConnectionCleanup : IDisposable + { + public void Dispose() + { + CloseAllConnections(); + } + } + public class ResourceCleanup(string bundleName) : IDisposable + { + private readonly string _bundleName = bundleName; + public void Dispose() + { + FreeResourceBundle(_bundleName); + } + } + + public class SpritePackCleanup(string spritePackName) : IDisposable + { + private readonly string _spritePackName = spritePackName; + public void Dispose() + { + FreeSpritePack(_spritePackName); + } + } + + public class TimerCleanup : IDisposable + { + public void Dispose() + { + FreeAllTimers(); + } + } + public class LoggerCleanup : IDisposable + { + public void Dispose() + { + CloseLogProcess(); + } + } + + public class InterfaceFontCleanup : IDisposable + { + public void Dispose() + { + SetInterfaceFont(GetSystemFont()); + } + } + public class LayoutCleanup : IDisposable + { + public void Dispose() + { + ProcessEvents(); + ResetLayout(); + SetInterfaceStyle(InterfaceStyle.ShadedDarkStyle); + ProcessEvents(); + } + } +} \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/.editorconfig b/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/.editorconfig new file mode 100644 index 00000000..3c44241c --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/helpers.pas b/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/helpers.pas new file mode 100644 index 00000000..e128020a --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/helpers.pas @@ -0,0 +1,660 @@ +unit Helpers; + +interface +uses splashkit_test, Variants, SysUtils, StrUtils; + +function ToStr(const Value: Variant): String; overload; +function ToStr(Value: Boolean): String; overload; +function ToStr(Value: Integer): String; overload; +function ToStr(Value: Double): String; overload; +function ToStr(Value: String): String; overload; +function CreateStringArray(const Values: array of String): ArrayOfString; +function CreateDoubleArray(const Values: array of Double): ArrayOfDouble; +function CreateBooleanArray(const Values: array of Boolean): ArrayOfBoolean; +function CreateJsonArray(const Values: array of Json): ArrayOfJson; +function CreateLineArray(const Values: array of Line): ArrayOfLine; +function CreateCharArray(const Values: array of Char): ArrayOfChar; +function CreateTriangleArray(const Values: array of Triangle): ArrayOfTriangle; + +type + TSpriteFunction = procedure(ptr: Pointer); cdecl; + TSpriteFloatFunction = procedure(ptr: Pointer; value: Single); cdecl; + TSpriteEventHandler = procedure(ptr: Pointer; evt: Integer); cdecl; + TKeyCallback = procedure(key: Integer); cdecl; + TFreeNotifier = procedure(resource: Pointer); cdecl; + + TSpriteDelegates = class + private + class var + FEventCalled: Boolean; + FFloatFunctionCallCount: Integer; + FFunctionCallCount: Integer; + class procedure HandleSpriteFloat(ptr: Pointer; value: Single); static; cdecl; + class procedure HandleSprite(ptr: Pointer); static; cdecl; + class procedure HandleSpriteEvent(ptr: Pointer; evt: Integer); static; cdecl; + public + constructor Create; + function SpriteFloatFunction: TSpriteFloatFunction; + function SpriteFunction: TSpriteFunction; + function SpriteEventHandler: TSpriteEventHandler; + procedure Reset; + class property EventCalled: Boolean read FEventCalled; + class property FloatFunctionCallCount: Integer read FFloatFunctionCallCount; + class property FunctionCallCount: Integer read FFunctionCallCount; + end; + + TKeyCallbacks = class + private + class var + FKeyTyped: KeyCode; + FKeyDown: KeyCode; + FKeyUp: KeyCode; + class procedure HandleKeyTyped(key: Integer); static; cdecl; + class procedure HandleKeyDown(key: Integer); static; cdecl; + class procedure HandleKeyUp(key: Integer); static; cdecl; + public + constructor Create; + function OnKeyTyped: KeyCallback; + function OnKeyDown: KeyCallback; + function OnKeyUp: KeyCallback; + procedure Reset; + class function GetKeyTyped: KeyCode; + class function GetKeyDown: KeyCode; + class function GetKeyUp: KeyCode; + end; + + TNotifierTracker = class + private + class var + FWasNotified: Boolean; + class procedure HandleFree(resource: Pointer); static; cdecl; + public + constructor Create; + function OnFree: TFreeNotifier; + procedure Reset; + class property WasNotified: Boolean read FWasNotified; + end; + + AnimationScriptCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + AnimationCleanup = class(TInterfacedObject) + private + FAnimation: Animation; + public + constructor Create(animation: Animation); + destructor Destroy; override; + end; + + AudioCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + SoundEffectCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + MusicCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + WindowCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + BitmapCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + SpriteCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + FontCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + RaspberryCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + JsonCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + ServerCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + ConnectionCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + ResourceCleanup = class(TInterfacedObject) + private + FBundleName: String; + public + constructor Create(bundleName: String); + destructor Destroy; override; + end; + + SpritePackCleanup = class(TInterfacedObject) + private + FPackName: String; + public + constructor Create(packName: String); + destructor Destroy; override; + end; + + TimerCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + LoggerCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + LayoutCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + + InterfaceFontCleanup = class(TInterfacedObject) + public + constructor Create; + destructor Destroy; override; + end; + +implementation + +{ TSpriteDelegates } + +constructor TSpriteDelegates.Create; +begin + inherited; + Reset; +end; + +class procedure TSpriteDelegates.HandleSpriteFloat(ptr: Pointer; value: Single); static; cdecl; +begin + Inc(FFloatFunctionCallCount); + FEventCalled := True; +end; + +class procedure TSpriteDelegates.HandleSprite(ptr: Pointer); static; cdecl; +begin + Inc(FFunctionCallCount); + FEventCalled := True; +end; + +class procedure TSpriteDelegates.HandleSpriteEvent(ptr: Pointer; evt: Integer); static; cdecl; +begin + FEventCalled := True; +end; + +function TSpriteDelegates.SpriteFloatFunction: TSpriteFloatFunction; +begin + Result := @HandleSpriteFloat; +end; + +function TSpriteDelegates.SpriteFunction: TSpriteFunction; +begin + Result := @HandleSprite; +end; + +function TSpriteDelegates.SpriteEventHandler: TSpriteEventHandler; +begin + Result := @HandleSpriteEvent; +end; + +procedure TSpriteDelegates.Reset; +begin + FFloatFunctionCallCount := 0; + FFunctionCallCount := 0; + FEventCalled := False; +end; + +{ TKeyCallbacks } + +constructor TKeyCallbacks.Create; +begin + inherited; + Reset; +end; + +procedure TKeyCallbacks.Reset; +begin + FKeyTyped := KeyCode(0); + FKeyDown := KeyCode(0); + FKeyUp := KeyCode(0); +end; + +class procedure TKeyCallbacks.HandleKeyTyped(key: Integer); static; cdecl; +begin + FKeyTyped := KeyCode(key); +end; + +class procedure TKeyCallbacks.HandleKeyDown(key: Integer); static; cdecl; +begin + FKeyDown := KeyCode(key); +end; + +class procedure TKeyCallbacks.HandleKeyUp(key: Integer); static; cdecl; +begin + FKeyUp := KeyCode(key); +end; + +function TKeyCallbacks.OnKeyTyped: KeyCallback; +begin + Result := @HandleKeyTyped; +end; + +function TKeyCallbacks.OnKeyDown: KeyCallback; +begin + Result := @HandleKeyDown; +end; + +function TKeyCallbacks.OnKeyUp: KeyCallback; +begin + Result := @HandleKeyUp; +end; + +class function TKeyCallbacks.GetKeyTyped: KeyCode; +begin + Result := FKeyTyped; +end; + +class function TKeyCallbacks.GetKeyDown: KeyCode; +begin + Result := FKeyDown; +end; + +class function TKeyCallbacks.GetKeyUp: KeyCode; +begin + Result := FKeyUp; +end; + +{ TNotifierTracker } + +constructor TNotifierTracker.Create; +begin + inherited; + Reset; +end; + +class procedure TNotifierTracker.HandleFree(resource: Pointer); static; cdecl; +begin + FWasNotified := True; +end; + +function TNotifierTracker.OnFree: TFreeNotifier; +begin + Result := @HandleFree; +end; + +procedure TNotifierTracker.Reset; +begin + FWasNotified := False; +end; + +{ AnimationScriptCleanup } + +constructor AnimationScriptCleanup.Create; +begin +end; + +destructor AnimationScriptCleanup.Destroy; +begin + FreeAllAnimationScripts; + inherited; +end; + +{ AnimationCleanup } + +constructor AnimationCleanup.Create(animation: Animation); +begin + FAnimation := animation; +end; + +destructor AnimationCleanup.Destroy; +begin + FreeAnimation(FAnimation); + inherited; +end; + +{ AudioCleanup } + +constructor AudioCleanup.Create; +begin +end; + +destructor AudioCleanup.Destroy; +begin + CloseAudio; + inherited; +end; + +{ SoundEffectCleanup } + +constructor SoundEffectCleanup.Create; +begin +end; + +destructor SoundEffectCleanup.Destroy; +begin + FreeAllSoundEffects; + inherited; +end; + +{ MusicCleanup } + +constructor MusicCleanup.Create; +begin +end; + +destructor MusicCleanup.Destroy; +begin + FreeAllMusic; + inherited; +end; + +{ WindowCleanup } + +constructor WindowCleanup.Create; +begin +end; + +destructor WindowCleanup.Destroy; +begin + CloseAllWindows; + SetCameraPosition(PointAt(0, 0)); + inherited; +end; + +{ BitmapCleanup } + +constructor BitmapCleanup.Create; +begin +end; + +destructor BitmapCleanup.Destroy; +begin + FreeAllBitmaps; + inherited; +end; + +{ SpriteCleanup } + +constructor SpriteCleanup.Create; +begin +end; + +destructor SpriteCleanup.Destroy; +begin + FreeAllSprites; + inherited; +end; + +{ FontCleanup } + +constructor FontCleanup.Create; +begin +end; + +destructor FontCleanup.Destroy; +begin + FreeAllFonts; + inherited; +end; + +{ RaspberryCleanup } + +constructor RaspberryCleanup.Create; +begin +end; + +destructor RaspberryCleanup.Destroy; +begin + splashkit_test.RaspiCleanup; + inherited; +end; + +{ JsonCleanup } + +constructor JsonCleanup.Create; +begin +end; + +destructor JsonCleanup.Destroy; +begin + FreeAllJson; + inherited; +end; + +{ ServerCleanup } + +constructor ServerCleanup.Create; +begin +end; + +destructor ServerCleanup.Destroy; +begin + CloseAllServers; + inherited; +end; + +{ ConnectionCleanup } + +constructor ConnectionCleanup.Create; +begin +end; + +destructor ConnectionCleanup.Destroy; +begin + CloseAllConnections; + inherited; +end; + +{ ResourceCleanup } + +constructor ResourceCleanup.Create(bundleName: String); +begin + FBundleName := bundleName; +end; + +destructor ResourceCleanup.Destroy; +begin + FreeResourceBundle(FBundleName); + inherited; +end; + +{ SpritePackCleanup } + +constructor SpritePackCleanup.Create(packName: String); +begin + FPackName := packName; +end; + +destructor SpritePackCleanup.Destroy; +begin + FreeSpritePack(FPackName); + inherited; +end; + +{ TimerCleanup } + +constructor TimerCleanup.Create; +begin +end; + +destructor TimerCleanup.Destroy; +begin + FreeAllTimers; + inherited; +end; + +{ LoggerCleanup } + +constructor LoggerCleanup.Create; +begin +end; + +destructor LoggerCleanup.Destroy; +begin + CloseLogProcess; + inherited; +end; + +{ LayoutCleanup } + +constructor LayoutCleanup.Create; +begin +end; + +destructor LayoutCleanup.Destroy; +begin + ProcessEvents(); + ResetLayout(); + SetInterfaceStyle(InterfaceStyle.SHADED_DARK_STYLE); + ProcessEvents(); + inherited; +end; + +{ InterfaceFontCleanup } + +constructor InterfaceFontCleanup.Create; +begin +end; + +destructor InterfaceFontCleanup.Destroy; +begin + SetInterfaceFont(GetSystemFont()); + inherited; +end; + +function ToStr(Value: Boolean): String; overload; +begin + Result := BoolToStr(Value, True); +end; + +function ToStr(Value: Integer): String; overload; +begin + Result := IntToStr(Value); +end; + +function ToStr(Value: Double): String; overload; +begin + Result := FloatToStr(Value); +end; + +function ToStr(Value: String): String; overload; +begin + Result := Value; +end; + +function ToStr(const Value: Variant): String; overload; +begin + Result := VarToStr(Value); +end; + +function CreateStringArray(const Values: array of String): ArrayOfString; +var + i: Integer; +begin + Result := nil; + SetLength(Result, Length(Values)); + for i := 0 to High(Values) do + Result[i] := Values[i]; +end; + +function CreateJsonArray(const Values: array of Json): ArrayOfJson; +var + i: Integer; +begin + Result := nil; + SetLength(Result, Length(Values)); + for i := 0 to High(Values) do + Result[i] := Values[i]; +end; + +function CreateDoubleArray(const Values: array of Double): ArrayOfDouble; +var + i: Integer; +begin + Result := nil; + SetLength(Result, Length(Values)); + for i := 0 to High(Values) do + Result[i] := Values[i]; +end; + +function CreateBooleanArray(const Values: array of Boolean): ArrayOfBoolean; +var + i: Integer; +begin + Result := nil; + SetLength(Result, Length(Values)); + for i := 0 to High(Values) do + Result[i] := Values[i]; +end; + +function CreateLineArray(const Values: array of Line): ArrayOfLine; +var + i: Integer; +begin + Result := nil; + SetLength(Result, Length(Values)); + for i := 0 to High(Values) do + Result[i] := Values[i]; +end; + +function CreateCharArray(const Values: array of Char): ArrayOfChar; +var + i: Integer; +begin + Result := nil; + SetLength(Result, Length(Values)); + for i := 0 to High(Values) do + Result[i] := Values[i]; +end; + +function CreateTriangleArray(const Values: array of Triangle): ArrayOfTriangle; +var + i: Integer; +begin + Result := nil; + SetLength(Result, Length(Values)); + for i := 0 to High(Values) do + Result[i] := Values[i]; +end; + +end. \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/test_main.pas b/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/test_main.pas new file mode 100644 index 00000000..48726b2e --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/pascal/test_main.pas @@ -0,0 +1,305 @@ +{$mode objfpc}{$H+} +{$UNITPATH tests} +{$UNITPATH ../../data/language_files/pascal} + +program TestMain; + +uses + SysUtils, + DynLibs, + fpcunit, + testregistry, + consoletestrunner, + splashkit_test, + testreport, + DigestTestReport + {$IFDEF TEST_ANIMATIONS}, animations_tests {$ENDIF} + {$IFDEF TEST_AUDIO}, audio_tests {$ENDIF} + {$IFDEF TEST_CAMERA}, camera_tests {$ENDIF} + {$IFDEF TEST_COLOR}, color_tests {$ENDIF} + {$IFDEF TEST_GEOMETRY}, geometry_tests {$ENDIF} + {$IFDEF TEST_GRAPHICS}, graphics_tests {$ENDIF} + {$IFDEF TEST_INPUT}, input_tests {$ENDIF} + {$IFDEF TEST_INTERFACE}, interface_tests {$ENDIF} + {$IFDEF TEST_JSON}, json_tests {$ENDIF} + {$IFDEF TEST_LOGGING}, logging_tests {$ENDIF} + {$IFDEF TEST_PHYSICS}, physics_tests {$ENDIF} + {$IFDEF TEST_RASPBERRY}, raspberry_tests {$ENDIF} + {$IFDEF TEST_RESOURCE_BUNDLES}, resource_bundles_tests {$ENDIF} + {$IFDEF TEST_RESOURCES}, resources_tests {$ENDIF} + {$IFDEF TEST_SPRITES}, sprites_tests {$ENDIF} + {$IFDEF TEST_TERMINAL}, terminal_tests {$ENDIF} + {$IFDEF TEST_TIMERS}, timers_tests {$ENDIF} + {$IFDEF TEST_UTILITIES}, utilities_tests {$ENDIF} + {$IFDEF TEST_WINDOWS}, windows_tests {$ENDIF}; + +{ Custom results writer } +type + TCustomTestWriter = class(TTestCase, IInterface, ITestListener) + private + { IInterface } + FCurrentTest: TTest; + FTestFailed: Boolean; + function QueryInterface(constref IID: TGUID; out Obj): HResult; cdecl; + function _AddRef: Integer; cdecl; + function _Release: Integer; cdecl; + public + procedure WriteHeader; virtual; + procedure WriteResult(aResult: TTestResult); virtual; + { ITestListener } + procedure AddFailure(ATest: TTest; AFailure: TTestFailure); virtual; + procedure AddError(ATest: TTest; AError: TTestFailure); virtual; + procedure StartTest(ATest: TTest); virtual; + procedure EndTest(ATest: TTest); virtual; + procedure StartTestSuite(ATestSuite: TTestSuite); virtual; + procedure EndTestSuite(ATestSuite: TTestSuite); virtual; + end; + +{ Variable declarations section } +var + testResult: TTestResult; + groupName: string; + testName: string; + i: Integer; + testSuite: TTestSuite; + foundTest: TTest; + FCustomWriter: TCustomTestWriter; + +{ Implementation of IInterface methods } +function TCustomTestWriter.QueryInterface(constref IID: TGUID; out Obj): HResult; cdecl; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TCustomTestWriter._AddRef: Integer; cdecl; +begin + Result := -1; // No reference counting needed +end; + +function TCustomTestWriter._Release: Integer; cdecl; +begin + Result := -1; // No reference counting needed +end; + +{ Implementation of custom writer methods } +procedure TCustomTestWriter.WriteHeader; +begin + // Optional: Add any header text you want +end; + +procedure TCustomTestWriter.WriteResult(aResult: TTestResult); +var + i: Integer; + failure: TTestFailure; +begin + writeln; + writeln('Test Run Summary'); + writeln('----------------'); + writeln('Total Tests Run: ', aResult.RunTests); + writeln('Failed Tests: ', aResult.NumberOfFailures); + writeln('Errors: ', aResult.NumberOfErrors); + + if (aResult.NumberOfFailures > 0) or (aResult.NumberOfErrors > 0) then + begin + writeln; + writeln('Failed Tests Details:'); + writeln('--------------------'); + + if aResult.NumberOfFailures > 0 then + begin + writeln('Failures:'); + for i := 0 to aResult.Failures.Count - 1 do + begin + failure := TTestFailure(aResult.Failures[i]); + if failure.ExceptionMessage <> '' then + writeln('Failure: ', failure.ExceptionMessage) + else if failure.AsString <> '' then + writeln('Failure: ', failure.AsString) + else + writeln('Failure: '); + writeln(' Message: ', failure.ExceptionClassName); + if failure.SourceUnitName <> '' then + writeln(' Source Unit: ', failure.SourceUnitName); + + writeln; + end; + end; + + if aResult.NumberOfErrors > 0 then + begin + writeln('Errors:'); + for i := 0 to aResult.Errors.Count - 1 do + begin + failure := TTestFailure(aResult.Errors[i]); + writeln('ERROR: ', failure.ExceptionClassName); + writeln(' Message: ', failure.ExceptionMessage); + + if failure.SourceUnitName <> '' then + writeln(' Unit: ', failure.SourceUnitName); + if failure.FailedMethodName <> '' then + writeln(' Method: ', failure.FailedMethodName); + if failure.LineNumber <> 0 then + writeln(' Line: ', failure.LineNumber); + + writeln; + end; + end; + end; +end; + +procedure TCustomTestWriter.AddFailure(ATest: TTest; AFailure: TTestFailure); +var + msg: string; + locationParts: TStringArray; + lineStr: string; +begin + FTestFailed := True; + msg := AFailure.ExceptionMessage; + + AFailure.SourceUnitName := ATest.TestSuiteName; + AFailure.FailedMethodName := ATest.TestName; + + if AFailure.LocationInfo <> '' then + begin + locationParts := AFailure.LocationInfo.Split('('); + if Length(locationParts) > 1 then + begin + lineStr := locationParts[1].Split(')')[0]; + AFailure.LineNumber := StrToIntDef(lineStr, 0); + end; + end; + + writeln('FAILED: ', ATest.TestSuiteName, '.', ATest.TestName); + if msg <> '' then + writeln(' Message: ', msg) + else + writeln(' Message: Test assertion failed (no message provided)'); + writeln; +end; + +procedure TCustomTestWriter.AddError(ATest: TTest; AError: TTestFailure); +begin + writeln('ERROR in ', ATest.TestSuiteName, '.', ATest.TestName); + writeln(' Exception: ', AError.ExceptionClassName); + writeln(' Message: ', AError.ExceptionMessage); + if AError.SourceUnitName <> '' then + writeln(' Unit: ', AError.SourceUnitName); + if AError.FailedMethodName <> '' then + writeln(' Method: ', AError.FailedMethodName); + if AError.LineNumber <> 0 then + writeln(' Line: ', AError.LineNumber); +end; + +procedure TCustomTestWriter.StartTest(ATest: TTest); +begin + FCurrentTest := ATest; + FTestFailed := False; + writeln('Running ', ATest.TestSuiteName, '.', ATest.TestName, '... '); +end; + +procedure TCustomTestWriter.EndTest(ATest: TTest); +begin + if not FTestFailed then + writeln('PASSED'); + FCurrentTest := nil; +end; + +procedure TCustomTestWriter.StartTestSuite(ATestSuite: TTestSuite); +begin + // Optional: Add any test suite start text +end; + +procedure TCustomTestWriter.EndTestSuite(ATestSuite: TTestSuite); +begin + // Optional: Add any test suite end text +end; + +procedure RegisterTestGroup(const groupName: string); +begin + case LowerCase(groupName) of + 'ttestanimations': {$IFDEF TEST_ANIMATIONS} animations_tests.RegisterTests {$ENDIF}; + 'ttestaudio': {$IFDEF TEST_AUDIO} audio_tests.RegisterTests {$ENDIF}; + 'ttestcamera': {$IFDEF TEST_CAMERA} camera_tests.RegisterTests {$ENDIF}; + 'ttestcolor': {$IFDEF TEST_COLOR} color_tests.RegisterTests {$ENDIF}; + 'ttestgeometry': {$IFDEF TEST_GEOMETRY} geometry_tests.RegisterTests {$ENDIF}; + 'ttestgraphics': {$IFDEF TEST_GRAPHICS} graphics_tests.RegisterTests {$ENDIF}; + 'ttestinput': {$IFDEF TEST_INPUT} input_tests.RegisterTests {$ENDIF}; + 'ttestinterface': {$IFDEF TEST_INTERFACE} interface_tests.RegisterTests {$ENDIF}; + 'ttestjson': {$IFDEF TEST_JSON} json_tests.RegisterTests {$ENDIF}; + 'ttestlogging': {$IFDEF TEST_LOGGING} logging_tests.RegisterTests {$ENDIF}; + 'ttestphysics': {$IFDEF TEST_PHYSICS} physics_tests.RegisterTests {$ENDIF}; + 'ttestraspberry': {$IFDEF TEST_RASPBERRY} raspberry_tests.RegisterTests {$ENDIF}; + 'ttestresourcebundles': {$IFDEF TEST_RESOURCEBUNDLES} resource_bundles_tests.RegisterTests {$ENDIF}; + 'ttestresources': {$IFDEF TEST_RESOURCES} resources_tests.RegisterTests {$ENDIF}; + 'ttestsprites': {$IFDEF TEST_SPRITES} sprites_tests.RegisterTests {$ENDIF}; + 'ttestterminal': {$IFDEF TEST_TERMINAL} terminal_tests.RegisterTests {$ENDIF}; + 'ttesttimers': {$IFDEF TEST_TIMERS} timers_tests.RegisterTests {$ENDIF}; + 'ttestutilities': {$IFDEF TEST_UTILITIES} utilities_tests.RegisterTests {$ENDIF}; + 'ttestwindows': {$IFDEF TEST_WINDOWS} windows_tests.RegisterTests {$ENDIF}; + end; +end; + +{ Main program block } +begin + groupName := ''; + testName := ''; + testSuite := GetTestRegistry; // Initialize testSuite + + for i := 1 to ParamCount do + begin + if Copy(ParamStr(i), 1, 8) = '--group=' then + begin + groupName := 'TTest' + Copy(ParamStr(i), 9, Length(ParamStr(i))); + end + else if Copy(ParamStr(i), 1, 7) = '--test=' then + begin + testName := Copy(ParamStr(i), 8, Length(ParamStr(i))); + end; + end; + + if groupName = '' then + begin + WriteLn('Error: Test group not specified'); + Exit; + end; + + RegisterTestGroup(groupName); + + testResult := TTestResult.Create; + FCustomWriter := TCustomTestWriter.Create; + + try + testResult.AddListener(FCustomWriter); + + if testName <> '' then + begin + foundTest := testSuite.FindTest(groupName + '.' + testName); + if foundTest <> nil then + begin + WriteLn('Running specific test: ', groupName, '.', testName); + foundTest.Run(testResult); + end + else + WriteLn('Error: Test "', groupName, '.', testName, '" not found'); + end + else + begin + foundTest := testSuite.FindTest(groupName); + if foundTest <> nil then + begin + WriteLn('Running test group: ', groupName); + foundTest.Run(testResult); + end + else + WriteLn('Error: Test group "', groupName, '" not found'); + end; + + FCustomWriter.WriteResult(testResult); + finally + testResult.Free; + FCustomWriter.Free; + end; +end. diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/python/helpers.py b/coresdk/src/test/splashkit-test-generator/generated_tests/python/helpers.py new file mode 100644 index 00000000..457374e9 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/python/helpers.py @@ -0,0 +1,246 @@ +import sys +import os +import contextlib +sys.path.append(os.path.join(os.path.dirname(__file__), "../../data/language_files/python")) +from splashkit_test import * + +class SpriteDelegates: + def __init__(self): + self._event_called = False + self._float_function_call_count = 0 + self._function_call_count = 0 + + def float_callback(sprite, value): + self._float_function_call_count += 1 + self._event_called = True + + def function_callback(sprite): + self._function_call_count += 1 + self._event_called = True + + def event_callback(sprite, evt): + self._event_called = True + + self._float_fn = SpriteFloatFunction(float_callback) + self._function_fn = SpriteFunction(function_callback) + self._event_fn = SpriteEventHandler(event_callback) + + def sprite_float_function(self): + return self._float_fn + + def sprite_function(self): + return self._function_fn + + def sprite_event_handler(self): + return self._event_fn + + def reset(self): + self._float_function_call_count = 0 + self._function_call_count = 0 + self._event_called = False + + def event_called(self): + return self._event_called + + def float_function_call_count(self): + return self._float_function_call_count + + def function_call_count(self): + return self._function_call_count + +class KeyCallbacks: + def __init__(self): + self._key_typed = KeyCode.unknown_key + self._key_down = KeyCode.unknown_key + self._key_up = KeyCode.unknown_key + + def typed_callback(key): + self._key_typed = KeyCode(key) + def down_callback(key): + self._key_down = KeyCode(key) + def up_callback(key): + self._key_up = KeyCode(key) + + # Store the wrapped callbacks + self._typed_fn = KeyCallback(typed_callback) + self._down_fn = KeyCallback(down_callback) + self._up_fn = KeyCallback(up_callback) + + def on_key_typed(self): + return self._typed_fn + + def on_key_down(self): + return self._down_fn + + def on_key_up(self): + return self._up_fn + + def get_key_typed(self): + return self._key_typed + + def get_key_down(self): + return self._key_down + + def get_key_up(self): + return self._key_up + + def reset(self): + self._key_typed = KeyCode.unknown_key + self._key_down = KeyCode.unknown_key + self._key_up = KeyCode.unknown_key + +class NotifierTracker: + def __init__(self): + self._was_notified = False + + def free_callback(resource): + self._was_notified = True + + self._free_fn = FreeNotifier(free_callback) + + def on_free(self): + return self._free_fn + + def reset(self): + self._was_notified = False + + def was_notified(self): + return self._was_notified + +@contextlib.contextmanager +def animation_script_cleanup(): + try: + yield + finally: + free_all_animation_scripts() + +@contextlib.contextmanager +def animation_cleanup(animation): + try: + yield + finally: + free_animation(animation) + +@contextlib.contextmanager +def audio_cleanup(): + try: + yield + finally: + close_audio() + +@contextlib.contextmanager +def sound_effect_cleanup(): + try: + yield + finally: + free_all_sound_effects() + +@contextlib.contextmanager +def music_cleanup(): + try: + yield + finally: + free_all_music() + +@contextlib.contextmanager +def window_cleanup(): + try: + yield + finally: + close_all_windows() + set_camera_position(point_at(0, 0)) + +@contextlib.contextmanager +def bitmap_cleanup(): + try: + yield + finally: + close_all_windows() + free_all_bitmaps() + +@contextlib.contextmanager +def sprite_cleanup(): + try: + yield + finally: + free_all_sprites() + +@contextlib.contextmanager +def font_cleanup(): + try: + yield + finally: + free_all_fonts() + +@contextlib.contextmanager +def raspberry_cleanup(): + try: + yield + finally: + raspi_cleanup() + +@contextlib.contextmanager +def json_cleanup(): + try: + yield + finally: + free_all_json() + +@contextlib.contextmanager +def server_cleanup(): + try: + yield + finally: + close_all_servers() + +@contextlib.contextmanager +def connection_cleanup(): + try: + yield + finally: + close_all_connections() + +@contextlib.contextmanager +def resource_cleanup(bundle_name: str): + try: + yield + finally: + free_resource_bundle(bundle_name) + +@contextlib.contextmanager +def sprite_pack_cleanup(pack_name: str): + try: + yield + finally: + free_sprite_pack(pack_name) + +@contextlib.contextmanager +def timer_cleanup(): + try: + yield + finally: + free_all_timers() + +@contextlib.contextmanager +def logger_cleanup(): + try: + yield + finally: + close_log_process() + +@contextlib.contextmanager +def interface_font_cleanup(): + try: + yield + finally: + set_interface_font(get_system_font()) + +@contextlib.contextmanager +def layout_cleanup(): + try: + yield + finally: + process_events() + reset_layout() + set_interface_style(InterfaceStyle.shaded_dark_style) + process_events() \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/rust/Cargo.lock b/coresdk/src/test/splashkit-test-generator/generated_tests/rust/Cargo.lock new file mode 100644 index 00000000..350be0d9 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/rust/Cargo.lock @@ -0,0 +1,85 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cc" +version = "1.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +dependencies = [ + "shlex", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "splashkit_backend" +version = "0.1.0" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "splashkit_tests" +version = "0.1.0" +dependencies = [ + "ctor", + "splashkit_backend", +] + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/rust/Cargo.toml b/coresdk/src/test/splashkit-test-generator/generated_tests/rust/Cargo.toml new file mode 100644 index 00000000..681595a2 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/rust/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "splashkit_tests" +version = "0.1.0" +edition = "2021" + +[dependencies] +ctor = "0.2" +splashkit_backend = { path = "../../data/language_files/rust" } + +[lints.rust] +non_snake_case = "allow" +unused_imports = "allow" diff --git a/coresdk/src/test/splashkit-test-generator/generated_tests/rust/src/helpers.rs b/coresdk/src/test/splashkit-test-generator/generated_tests/rust/src/helpers.rs new file mode 100644 index 00000000..4b1f4e11 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/generated_tests/rust/src/helpers.rs @@ -0,0 +1,361 @@ +use splashkit_backend::*; +use std::sync::{Arc, Mutex}; + +pub struct SpriteDelegates { + event_called: Arc>, + float_function_call_count: Arc>, + function_call_count: Arc>, +} + +impl SpriteDelegates { + pub fn new() -> Self { + SpriteDelegates { + event_called: Arc::new(Mutex::new(false)), + float_function_call_count: Arc::new(Mutex::new(0)), + function_call_count: Arc::new(Mutex::new(0)), + } + } + + pub fn sprite_float_function(&self) -> SpriteFloatFunction { + let event_called = self.event_called.clone(); + let count = self.float_function_call_count.clone(); + Box::new(move |_ptr, _value| { + *count.lock().unwrap() += 1; + *event_called.lock().unwrap() = true; + }) + } + + pub fn sprite_function(&self) -> SpriteFunction { + let event_called = self.event_called.clone(); + let count = self.function_call_count.clone(); + Box::new(move |_ptr| { + *count.lock().unwrap() += 1; + *event_called.lock().unwrap() = true; + }) + } + + pub fn sprite_event_handler(&self) -> SpriteEventHandler { + let event_called = self.event_called.clone(); + Box::new(move |_ptr, _evt| { + *event_called.lock().unwrap() = true; + }) + } + + pub fn reset(&self) { + *self.float_function_call_count.lock().unwrap() = 0; + *self.function_call_count.lock().unwrap() = 0; + *self.event_called.lock().unwrap() = false; + } + + pub fn event_called(&self) -> bool { + *self.event_called.lock().unwrap() + } + + pub fn float_function_call_count(&self) -> i32 { + *self.float_function_call_count.lock().unwrap() + } + + pub fn function_call_count(&self) -> i32 { + *self.function_call_count.lock().unwrap() + } +} + +struct KeyState { + typed: KeyCode, + down: KeyCode, + up: KeyCode, +} + +pub struct KeyCallbacks { + state: Arc>, +} + +impl KeyCallbacks { + pub fn new() -> Self { + let state = Arc::new(Mutex::new(KeyState { + typed: KeyCode::UnknownKey, + down: KeyCode::UnknownKey, + up: KeyCode::UnknownKey, + })); + + KeyCallbacks { + state, + } + } + + pub fn on_key_typed(&self) -> KeyCallback { + let state = self.state.clone(); + Box::new(move |key| { + state.lock().unwrap().typed = KeyCode::from(key); + }) + } + + pub fn on_key_down(&self) -> KeyCallback { + let state = self.state.clone(); + Box::new(move |key| { + state.lock().unwrap().down = KeyCode::from(key); + }) + } + + pub fn on_key_up(&self) -> KeyCallback { + let state = self.state.clone(); + Box::new(move |key| { + state.lock().unwrap().up = KeyCode::from(key); + }) + } + + pub fn get_key_typed(&self) -> KeyCode { + self.state.lock().unwrap().typed + } + + pub fn get_key_down(&self) -> KeyCode { + self.state.lock().unwrap().down + } + + pub fn get_key_up(&self) -> KeyCode { + self.state.lock().unwrap().up + } + + pub fn reset(&self) { + let mut state = self.state.lock().unwrap(); + state.typed = KeyCode::UnknownKey; + state.down = KeyCode::UnknownKey; + state.up = KeyCode::UnknownKey; + } +} + +pub struct NotifierTracker { + was_notified: Arc>, +} + +impl NotifierTracker { + pub fn new() -> Self { + NotifierTracker { + was_notified: Arc::new(Mutex::new(false)), + } + } + + pub fn on_free(&self) -> FreeNotifier { + let was_notified = self.was_notified.clone(); + Box::new(move |_ptr| { + *was_notified.lock().unwrap() = true; + }) + } + + pub fn reset(&self) { + *self.was_notified.lock().unwrap() = false; + } + + pub fn was_notified(&self) -> bool { + *self.was_notified.lock().unwrap() + } +} + +pub struct AnimationScriptCleanup; +impl AnimationScriptCleanup { + pub fn new() -> Self { Self } +} +impl Drop for AnimationScriptCleanup { + fn drop(&mut self) { + free_all_animation_scripts(); + } +} + +pub struct AnimationCleanup { + animation: Animation, +} +impl AnimationCleanup { + pub fn new(animation: Animation) -> Self { + Self { animation } + } +} +impl Drop for AnimationCleanup { + fn drop(&mut self) { + free_animation(self.animation); + } +} + +pub struct AudioCleanup; +impl AudioCleanup { + pub fn new() -> Self { Self } +} +impl Drop for AudioCleanup { + fn drop(&mut self) { + close_audio(); + } +} + +pub struct SoundEffectCleanup; +impl SoundEffectCleanup { + pub fn new() -> Self { Self } +} +impl Drop for SoundEffectCleanup { + fn drop(&mut self) { + free_all_sound_effects(); + } +} + +pub struct MusicCleanup; +impl MusicCleanup { + pub fn new() -> Self { Self } +} +impl Drop for MusicCleanup { + fn drop(&mut self) { + free_all_music(); + } +} + +pub struct WindowCleanup; +impl WindowCleanup { + pub fn new() -> Self { Self } +} +impl Drop for WindowCleanup { + fn drop(&mut self) { + close_all_windows(); + set_camera_position(point_at(0.0, 0.0)); + } +} + +pub struct BitmapCleanup; +impl BitmapCleanup { + pub fn new() -> Self { Self } +} +impl Drop for BitmapCleanup { + fn drop(&mut self) { + close_all_windows(); + free_all_bitmaps(); + } +} + +pub struct SpriteCleanup; +impl SpriteCleanup { + pub fn new() -> Self { Self } +} +impl Drop for SpriteCleanup { + fn drop(&mut self) { + free_all_sprites(); + } +} + +pub struct FontCleanup; +impl FontCleanup { + pub fn new() -> Self { Self } +} +impl Drop for FontCleanup { + fn drop(&mut self) { + free_all_fonts(); + } +} + +pub struct RaspberryCleanup; +impl RaspberryCleanup { + pub fn new() -> Self { Self } +} +impl Drop for RaspberryCleanup { + fn drop(&mut self) { + raspi_cleanup(); + } +} + +pub struct JsonCleanup; +impl JsonCleanup { + pub fn new() -> Self { Self } +} +impl Drop for JsonCleanup { + fn drop(&mut self) { + free_all_json(); + } +} + +pub struct ServerCleanup; +impl ServerCleanup { + pub fn new() -> Self { Self } +} +impl Drop for ServerCleanup { + fn drop(&mut self) { + close_all_servers(); + } +} + +pub struct ConnectionCleanup; +impl ConnectionCleanup { + pub fn new() -> Self { Self } +} +impl Drop for ConnectionCleanup { + fn drop(&mut self) { + close_all_connections(); + } +} + +pub struct ResourceCleanup { + bundle_name: String, +} +impl ResourceCleanup { + pub fn new(bundle_name: String) -> Self { + Self { bundle_name } + } +} +impl Drop for ResourceCleanup { + fn drop(&mut self) { + if has_resource_bundle(self.bundle_name.clone()) { + free_resource_bundle(self.bundle_name.clone()); + } + } +} + +pub struct SpritePackCleanup { + pack_name: String, +} +impl SpritePackCleanup { + pub fn new(pack_name: String) -> Self { + Self { pack_name } + } +} +impl Drop for SpritePackCleanup { + fn drop(&mut self) { + free_sprite_pack(self.pack_name.clone()); + } +} + +pub struct TimerCleanup; +impl TimerCleanup { + pub fn new() -> Self { Self } +} +impl Drop for TimerCleanup { + fn drop(&mut self) { + free_all_timers(); + } +} + +pub struct LoggerCleanup; +impl LoggerCleanup { + pub fn new() -> Self { Self } +} +impl Drop for LoggerCleanup { + fn drop(&mut self) { + close_log_process(); + } +} + +pub struct LayoutCleanup; +impl LayoutCleanup { + pub fn new() -> Self { Self } +} +impl Drop for LayoutCleanup { + fn drop(&mut self) { + process_events(); + reset_layout(); + set_interface_style(InterfaceStyle::ShadedDarkStyle); + process_events(); + } +} + +pub struct InterfaceFontCleanup; +impl InterfaceFontCleanup { + pub fn new() -> Self { Self } +} +impl Drop for InterfaceFontCleanup { + fn drop(&mut self) { + set_interface_font(get_system_font()); + } +} diff --git a/coresdk/src/test/splashkit-test-generator/main.rb b/coresdk/src/test/splashkit-test-generator/main.rb new file mode 100644 index 00000000..e3b996bc --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/main.rb @@ -0,0 +1,44 @@ +#!/usr/bin/env ruby +require_relative 'shared/lib' + +options = CliParser.parse + +begin + if options[:generate] + api_json = File.read(options[:generate]) + require_relative 'test_generator/test_generator' + TestGenerator.generate(api_json) + elsif options[:run_tests] || options[:language] || options[:group] || options[:test] + require_relative 'test_runner/test_runner' + if options[:run_tests] + # Add your TestRunner calls here for default behavior + # Examples: + # TestRunner.run_all_tests(:pascal) + # TestRunner.run_single_file(:pascal, 'animations') + # TestRunner.run_specific_test(:pascal, 'animations', 'animation_count') + elsif options[:test] + TestRunner.run_specific_test(options[:language], options[:group], options[:test]) + elsif options[:group] + TestRunner.run_single_file(options[:language], options[:group]) + else + TestRunner.run_all_tests(options[:language]) + end + else + puts "\nError: No valid operation specified" + puts "Please use one of the following options:" + puts " --generate PATH : Generate tests from API JSON file" + puts " --run-tests : Run tests with default configuration" + puts " --language LANGUAGE : Run tests for specific language" + puts "\nUse --help for complete usage information" + exit 1 + end +rescue Errno::ENOENT + puts MessageHandler.log_warning("Could not find file '#{options[:generate]}'") + exit 1 +rescue JSON::ParserError + puts MessageHandler.log_warning('Invalid JSON file') + exit 1 +rescue StandardError => e + puts MessageHandler.log_warning("Error: #{e.message}") + exit 1 +end diff --git a/coresdk/src/test/splashkit-test-generator/shared/extensions/string_extensions.rb b/coresdk/src/test/splashkit-test-generator/shared/extensions/string_extensions.rb new file mode 100644 index 00000000..667f290d --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/shared/extensions/string_extensions.rb @@ -0,0 +1,55 @@ +class String + # + # Converts from snake_case to camelCase + # + def to_camel_case + human_case = to_human_words + human_case[0] = human_case[0].downcase + human_case.join('') + end + + # + # Converts from snake_case to PascalCase + # + def to_pascal_case + to_human_case.tr(' ', '') + end + + # + # Converts from snake_case to humanised words + # + def to_human_words + gsub(/_([0-9])([a-zA-Z])/) { |match| "_#{$1}_#{$2}" }.split('_').map(&:capitalize).map do |input| + input.gsub(/^(Rgb|Hsb|Css|Ip|Tcp|Udp|Uri|Rgba)$/){ |match| "#{match.to_upper_case}" } #Dont do Html or Http + end + end + + # + # Converts from snake_case to Humanised Case + # + def to_human_case + to_human_words.join(' ') + end + + # + # Converts from snake_case to snake_case (all lower) + # + def to_snake_case + downcase + end + + # + # Converts to UPPER_CASE (snake but uppercase) + # + def to_upper_case + upcase + end + + + # + # Converts from snake_case to kebab-case + # + def to_kebab_case + to_human_case.downcase.tr(' ', '-') + end +end diff --git a/coresdk/src/test/splashkit-test-generator/shared/handlers/message_handler.rb b/coresdk/src/test/splashkit-test-generator/shared/handlers/message_handler.rb new file mode 100644 index 00000000..1715ea77 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/shared/handlers/message_handler.rb @@ -0,0 +1,46 @@ +def colorize(text, color_code) + "\e[#{color_code}m#{text}\e[0m" +end + +# Module for handling error and warning messages +module MessageHandler + COLORS = { + error: '31', # red + warning: '33', # yellow + info: '36', # cyan + success: '32', # green + test: '35', # magenta + status: '34' # blue + }.freeze + + class << self + def log_error(message, details = nil) + puts colorize("Error: #{message}", COLORS[:error]) + puts colorize("Details: #{details}", COLORS[:error]) if details + end + + def log_warning(message) + puts colorize("Warning: #{message}", COLORS[:warning]) + end + + def log_info(message) + puts colorize("Info: #{message}", COLORS[:info]) + end + + def log_success(message) + puts colorize("Success: #{message}", COLORS[:success]) + end + + def log_test(message) + puts colorize(message, COLORS[:test]) + end + + def log_status(message) + puts colorize("Status: #{message}", COLORS[:status]) + end + + def colorize(text, color_code) + "\e[#{color_code}m#{text}\e[0m" + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/shared/lib.rb b/coresdk/src/test/splashkit-test-generator/shared/lib.rb new file mode 100644 index 00000000..7deb6c1b --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/shared/lib.rb @@ -0,0 +1,5 @@ +require_relative 'utils/cli_parser' +require_relative 'utils/lib_processor' +require_relative 'utils/directory_manager' +require_relative 'handlers/message_handler' +require_relative 'extensions/string_extensions' \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/shared/utils/cli_parser.rb b/coresdk/src/test/splashkit-test-generator/shared/utils/cli_parser.rb new file mode 100644 index 00000000..4cf041ee --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/shared/utils/cli_parser.rb @@ -0,0 +1,61 @@ +require 'optparse' + +class CliParser + def self.parse + options = {} + parser = OptionParser.new do |opts| + opts.banner = <<~BANNER + #{colorize('SplashKit Test Tool', '1;34')} + #{colorize('==============================', '1;34')} + #{colorize('Usage:', '94')} #{colorize('ruby main.rb [options]', '1;33')} + + #{colorize('Examples:', '94')} + #{colorize('ruby main.rb --generate api.json', '32')} #{colorize('# Generate tests from API', '90')} + #{colorize('ruby main.rb --run-tests', '32')} #{colorize('# Run tests that have been set in main.rb', '90')} + #{colorize('ruby main.rb -l pascal', '32')} #{colorize('# Run all Pascal tests', '90')} + #{colorize('ruby main.rb -l pascal -g animations', '32')} #{colorize('# Run animation tests', '90')} + #{colorize('ruby main.rb -l pascal -g animations -t animation_count', '32')} #{colorize('# Run specific test', '90')} + + #{colorize('Available options:', '94')} + BANNER + + opts.on("--run-tests", + "#{colorize('Run tests that have been set in main.rb', '36')}") do |v| + options[:run_tests] = v + end + + opts.on("--generate PATH", + "#{colorize('Generate test files from API JSON', '36')}") do |v| + options[:generate] = v + end + + opts.on("-l", "--language LANGUAGE", %w[cpp python pascal rust csharp], + "#{colorize('Select programming language for tests', '36')}", + "#{colorize('Supported:', '90')} #{colorize('cpp, python, pascal, rust, csharp', '1;33')}") do |v| + options[:language] = v.to_sym + end + + opts.on("-g", "--group GROUP", + "#{colorize('Specify test group/category to run', '36')}", + "#{colorize('Example:', '90')} #{colorize('animations, audio, input', '1;33')}", + "#{colorize('(requires --language to be specified)', '90')}") do |v| + options[:group] = v + end + + opts.on("-t", "--test TEST", + "#{colorize('Run a specific test within a group', '36')}", + "#{colorize('(requires --group to be specified)', '90')}") do |v| + options[:test] = v + end + + opts.on("-h", "--help", + "#{colorize('Show this help message', '36')}") do + puts opts + exit 0 + end + end + + parser.parse! + options + end +end diff --git a/coresdk/src/test/splashkit-test-generator/shared/utils/directory_manager.rb b/coresdk/src/test/splashkit-test-generator/shared/utils/directory_manager.rb new file mode 100644 index 00000000..9588a433 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/shared/utils/directory_manager.rb @@ -0,0 +1,82 @@ +class DirectoryManager + REQUIRED_LANGUAGES = ['rust', 'python', 'cpp', 'clib', 'pascal', 'csharp'] + ROOT_DIR = File.expand_path('../../../../../..', __dir__) # splashkit-core root + RESOURCES_DIR = File.join(File.expand_path('../../..', __dir__), 'Resources') # test/resources + LANGUAGE_FILES_DIR = File.join('data', 'language_files') # splashkit-test-generator/data/language_files + CMAKE_PATH = File.join(LANGUAGE_FILES_DIR, 'cpp') # splashkit-test-generator/data/language_files/cpp + OUTPUT_DIR = File.join(LANGUAGE_FILES_DIR, 'cpp', 'lib') # splashkit-test-generator/data/language_files/cpp/lib + TRANSLATOR_DIR = File.join(ROOT_DIR, 'tools', 'translator') # splashkit-core/tools/translator + GENERATED_DIR = File.join(ROOT_DIR, 'generated') # splashkit-core/generated + SK_SRC = File.join(ROOT_DIR, 'coresdk', 'src') # splashkit-core/coresdk/src + SK_EXT = File.join(ROOT_DIR, 'coresdk', 'external') # splashkit-core/coresdk/external + + class << self + def setup(language) + new(language).setup + end + + def source_patterns + [ + File.join(SK_SRC, 'coresdk', '*.cpp'), + File.join(SK_SRC, 'backend', '*.cpp'), + File.join(SK_EXT, 'civetweb', 'src', 'civetweb.c'), + File.join(SK_EXT, 'sqlite', 'sqlite3.c'), + File.join(SK_EXT, 'hash-library', '*.cpp'), + File.join(SK_EXT, 'easyloggingpp', '*.cc'), + File.join(SK_EXT, 'microui', 'src', '*.c'), + File.join(GENERATED_DIR, 'clib', '*.cpp') + ] + end + + def find_built_library(os_config) + Dir.glob(File.join(OUTPUT_DIR, os_config[:lib_dir], os_config[:lib_glob])).first + end + + def lib_absolute_path(os_config, lib_file_name) + File.absolute_path(File.join(OUTPUT_DIR, os_config[:lib_dir], lib_file_name)) + end + + def lib_dir(os_config) + File.absolute_path(File.join(OUTPUT_DIR, os_config[:lib_dir])) + end + + def find_all_library_files + Dir.glob(File.join(OUTPUT_DIR, '**', LibProcessor.os_config[:lib_glob])) + end + + def find_all_source_files + source_patterns.flat_map { |pattern| Dir.glob(pattern) } + end + end + + def initialize(language) + @language = language + end + + def setup + create_base_directories + create_language_test_directories + [@language_dir, @tests_dir] + end + + private + + def create_base_directories + create_directory('generated_tests') + create_directory('resources') + end + + def create_language_test_directories + @language_dir = "generated_tests/#{@language}" + @tests_dir = "#{@language_dir}/tests" + create_directory(@language_dir) + create_directory(@tests_dir) + end + + def create_directory(path) + FileUtils.mkdir_p(path) unless Dir.exist?(path) + rescue StandardError => e + MessageHandler.log_error("Failed to create directory: #{path}", e.message) + raise TestGeneratorError, "Directory creation failed: #{e.message}" + end +end diff --git a/coresdk/src/test/splashkit-test-generator/shared/utils/lib_processor.rb b/coresdk/src/test/splashkit-test-generator/shared/utils/lib_processor.rb new file mode 100644 index 00000000..38aec29a --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/shared/utils/lib_processor.rb @@ -0,0 +1,72 @@ + +# Handles platform-specific test library operations and configurations +class LibProcessor + # Locates the compiled test library for the current platform + # @return [String, nil] Path to the test library or nil if not found + def self.find_test_library + DirectoryManager.find_built_library(os_config) + end + + # Generates the platform-specific test library filename + # @return [String] The formatted library name with appropriate prefix and extension + def self.test_library_name + "#{os_config[:lib_prefix]}SplashKitBackend#{os_config[:lib_extension]}" + end + + # Gets the absolute path to the test library + # @return [String] Full path to the test library file + def self.test_library_path + DirectoryManager.lib_absolute_path(os_config, test_library_name) + end + + # Gets the directory containing the test library + # @return [String] Path to the test library directory + def self.test_library_dir + DirectoryManager.lib_dir(os_config) + end + + # Gets the source directory for a specific language's generated files + # @param language [String] The target programming language + # @return [String] Path to the source directory + def self.source_dir(language) + File.join(DirectoryManager::GENERATED_DIR, language) + end + + # Gets the destination directory for a specific language's test files + # @param language [String] The target programming language + # @return [String] Path to the destination directory + def self.dest_dir(language) + File.join(DirectoryManager::LANGUAGE_FILES_DIR, language) + end + + # Returns platform-specific configuration for library handling + # @return [Hash] Configuration hash containing platform-specific settings + def self.os_config + @os_specific_config ||= case RbConfig::CONFIG['host_os'] + when /mswin|mingw|cygwin/ + { + platform: :windows, + lib_extension: '.dll', + lib_prefix: '', + lib_dir: 'windows', + lib_glob: '*.dll' + } + when /darwin/ + { + platform: :macos, + lib_extension: '.dylib', + lib_prefix: 'lib', + lib_dir: 'macos', + lib_glob: '*.dylib' + } + else + { + platform: :linux, + lib_extension: '.so', + lib_prefix: 'lib', + lib_dir: 'linux', + lib_glob: '*.so' + } + end + end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/config/language_config.rb b/coresdk/src/test/splashkit-test-generator/test_generator/config/language_config.rb new file mode 100644 index 00000000..781fe49e --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/config/language_config.rb @@ -0,0 +1,112 @@ +Dir[File.join(__dir__, 'languages', '*_config.rb')].sort.each { |file| require file } +module TestGenerator + # Manages configuration for different programming language test generators + class LanguageConfig + # List of supported languages + SUPPORTED_LANGUAGES = %i[python cpp rust csharp pascal].freeze + + attr_reader :language, + :statement_terminator, + :file_extension, + :indent_size, + :imports, + :variable_handlers, + :function_handlers, + :assert_conditions, + :if_conditions, + :control_flow, + :string_handlers, + :supports_overloading, + :class_wrapper_handler, + :tear_down_handler, + :constructor_handler, + :numeric_constants, + :terminal_handlers, + :comment_syntax, + :indentation, + :literal_cast, + :comparison_cast, + :test_main_file, + :boolean_mapping, + :type_mapping, + :class_wrapper, + :tear_down, + :cleanup_handlers + + def initialize(config) + ConfigValidator.validate!(config) + @config_instance = config.delete(:config_instance) + @language = config[:language] + @indent_size = config[:indent_size] + @file_extension = config[:file_extension] + @imports = config[:imports] + @variable_handlers = config[:variable_handlers] + @class_wrapper = config[:class_wrapper] + @tear_down = config[:tear_down] + @cleanup_handlers = config[:cleanup_handlers] + @assert_conditions = config[:assert_conditions] + @if_conditions = config[:if_conditions] + @control_flow = config[:control_flow] + @string_handlers = config[:string_handlers] + @supports_overloading = config[:supports_overloading] + @numeric_constants = config[:numeric_constants] + @terminal_handlers = config[:terminal_handlers] + @comment_syntax = config[:comment_syntax] + @indentation = config[:indentation] + @literal_cast = config[:literal_cast] + @comparison_cast = config[:comparison_cast] + @test_main_file = config[:test_main_file] + @statement_terminator = config[:statement_terminator] + @boolean_mapping = config[:boolean_mapping] + @type_mapping = config[:type_mapping] + @class_wrapper_handler = ClassWrapperHandler.new(self) + @constructor_handler = ConstructorHandler.new(self) + @tear_down_handler = TearDownHandler.new(self) + end + + # Creates a configuration instance for a specific language + # @param language [Symbol] The programming language to configure + # @return [LanguageConfig] The configuration instance + # @raise [StandardError] If language is unsupported or configuration is missing + def self.for_language(language) + raise LanguageError, "Unsupported language: #{language}" unless SUPPORTED_LANGUAGES.include?(language) + + begin + config_class = Object.const_get("LanguageConfig::#{language.to_s.capitalize}Config") + config_instance = config_class.new + config = config_instance.get + config[:language] = language + config[:config_instance] = config_instance + new(config) + rescue NameError + raise ConfigurationError, "Configuration not found for language: #{language}" + rescue StandardError => e + raise TestGeneratorError, "Error loading configuration: #{e.message}" + end + end + + # Handles method calls that are not directly defined in the LanguageConfig class + # Delegates undefined methods to the underlying configuration instance if possible + # @param method_name [Symbol] The name of the method being called + # @param args [Array] Arguments passed to the method + # @param block [Proc] Optional block passed to the method + # @return [Object] Result of the method call on the config instance + # @raise [NoMethodError] If the method is not found on the config instance + def method_missing(method_name, *args, &block) + if @config_instance.respond_to?(method_name) + @config_instance.send(method_name, *args, &block) + else + super + end + end + + # Checks if a method can be handled by the underlying configuration instance + # Extends the default respond_to? behavior to include methods from the config instance + # @param method_name [Symbol] The name of the method to check + # @param include_private [Boolean] Whether to include private methods in the check + # @return [Boolean] True if the method exists on the config instance or the parent class + def respond_to_missing?(method_name, include_private = false) + @config_instance.respond_to?(method_name) || super + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/base_config.rb b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/base_config.rb new file mode 100644 index 00000000..35750686 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/base_config.rb @@ -0,0 +1,286 @@ +module LanguageConfig + # Base configuration class for all language configurations + class BaseConfig + def initialize(default_config) + @config = deep_merge(build_config, default_config) + end + + # Build the base configuration with default settings + # @return [Hash] The base configuration hash + def build_config + { + imports: [], + indent_size: 4, + assignment_operator: '=', + identifier_cases: { + cleanup: :pascal_case, + functions: :snake_case, + variables: :snake_case, + fields: :snake_case, + constants: :upper_case + }, + + literal_cast: { + unsigned_int: ->(value) { value }, + float: ->(value) { value }, + double: ->(value) { value } + }, + + comparison_cast: { + unsigned_int: ->(value) { value }, + float: ->(value) { value }, + double: ->(value) { value } + }, + + variable_handlers: { + declaration: { + regular: ->(name) { "#{var_keyword}#{add_space}#{apply_case(name, :variables)} #{assignment_operator} " }, + string: ->(name) { "#{string_assignment_operator}#{add_space}#{apply_case(name, :variables)} #{assignment_operator} " }, + mutable: ->(name) { "#{var_mut_keyword}#{add_space}#{apply_case(name, :variables)} #{assignment_operator} " }, + reassignment: ->(name) { "#{apply_case(name, :variables)} #{assignment_operator} " } + }, + reference_operator: ->(var) { var } + }, + + list_handlers: { + prefix: ->(_) { '[' }, + suffix: ']', + separator: ',', + type_wrapper: ->(type) { type } + }, + + enum_handlers: { + separator: '.' + }, + + array_handlers: { + prefix: ->(arr) { "#{arr}[" }, + suffix: ']', + separator: '][' + }, + + method_handlers: { + prefix: ->(var, method) { "#{var}.#{method}(" }, + suffix: ')', + separator: ', ' + }, + + class_handlers: { + prefix: ->(name) { "#{name}(" }, + suffix: ')', + separator: ', ' + }.freeze, + + write_conditions: { + constructor: ->(group_file) { group_file[:constructor] && !group_file[:constructor].empty? }, + tear_down: ->(group_file) { group_file[:cleanup] && !group_file[:cleanup].empty? && @config[:tear_down] }, + protected_section: ->(group_file) { should_write?(:constructor, group_file) || should_write?(:tear_down, group_file) } + } + } + end + + # Retrieve the current configuration + # @return [Hash] The current configuration + def get + @config + end + + # Update the configuration with new options + # @param options [Hash] The options to merge into the existing configuration + def config=(options) + @config.merge!(options) + end + + # Apply the specified case to a value + # @param value [String] The value to transform + # @param type [Symbol] The type of identifier (e.g., :variables, :types) + # @return [String] The case-transformed value + def apply_case(value, type) + case @config[:identifier_cases][type] + when :snake_case then value.to_snake_case + when :pascal_case then value.to_pascal_case + when :camel_case then value.to_camel_case + when :upper_case then value.to_upper_case + else value + end + end + + # Determines if a specific section should be written + # @param section [Symbol] The section to check (:constructor, :tear_down, etc.) + # @param *args [Array] Arguments to pass to the condition check + # @return [Boolean] True if the section should be written + def should_write?(section, *args) + return false unless @config[:write_conditions][section] + + @config[:write_conditions][section].call(*args) + end + + # Format an identifier according to the configured case + # @param name [String] The identifier to format + # @return [String] The formatted identifier + def format_identifier(name) + apply_case(name, :variables) + end + + # Format field access with proper case + # @param var [String] The variable name + # @param field [String] The field to access (can be nested) + # @return [String] The formatted field access + def format_field_access(var, field) + parts = field.split('.') + formatted_parts = [] + parts.each do |part| + formatted_parts << apply_case(part, :fields) + end + "#{var}.#{formatted_parts.join('.')}" + end + + # Format matrix access with configurable separator + # @param var [String] The variable name + # @param row [String] The row index + # @param col [String] The column index + # @return [String] The formatted matrix access + def format_matrix_access(var, row, col) + separator = @config[:array_handlers][:matrix_separator] || @config[:array_handlers][:separator] + "#{var}[#{row}#{separator}#{col}]" + end + + # Format a list with optional type wrapping + # @param values [Array] The list of values + # @param target_type [String, nil] Optional type for the list + # @return [String] The formatted list + def format_list(values, target_type = nil) + handlers = @config[:list_handlers] + if target_type + mapped_type = @config[:type_mapping]&.[](target_type) || target_type + type_str = handlers[:type_wrapper] ? handlers[:type_wrapper].call(mapped_type) : '' + else + type_str = '' + end + "#{handlers[:prefix].call(type_str)}#{values.join(handlers[:separator])}#{handlers[:suffix]}" + end + + # Format an enum value with proper case + # @param type [String] The enum type + # @param value [String] The enum value + # @return [String] The formatted enum value + def format_enum(type, value) + type_formatted = apply_case(type, :types) + value_formatted = apply_case(value, :constants) + separator = @config[:enum_handlers][:separator] + "#{type_formatted}#{separator}#{value_formatted}" + end + + # Format array access with configurable handlers + # @param var [String] The variable name + # @param indices [Array] The indices to access + # @return [String] The formatted array access + def format_array_access(var, *indices) + handlers = @config[:array_handlers] + "#{handlers[:prefix].call(var)}#{indices.join(handlers[:separator])}#{handlers[:suffix]}" + end + + # Format a method call with proper case + # @param var [String] The variable or object + # @param method [String] The method name + # @param args [Array] The method arguments + # @return [String] The formatted method call + def format_method_call(var, method, *args) + handlers = @config[:method_handlers] + formatted_var = apply_case(var, :variables) + formatted_method = apply_case(method, :functions) + "#{handlers[:prefix].call(formatted_var, formatted_method)}#{args.join(handlers[:separator])}#{handlers[:suffix]}" + end + + # Format a class instance creation + # @param name [String] The class name + # @param args [Array] The constructor arguments + # @return [String] The formatted class instance creation + def format_class_instance(name, args) + handlers = @config[:class_handlers] + formatted_name = apply_case(name, :types) + formatted_args = args.join(handlers[:separator]) + "#{handlers[:prefix].call(formatted_name)}#{formatted_args}#{handlers[:suffix]}" + end + + # Format a test function name + # @param group [String] The test group name + # @param name [String] The test function name + # @return [String] The formatted test function name + def format_test_function(group, name) + formatted_group = apply_case(group, :types) + formatted_name = apply_case(name, :functions) + @config[:function_handlers][:test].call(formatted_group, formatted_name) + end + + # Format a function call + # @param name [String] The function name + # @param args [String] The function arguments + # @return [String] The formatted function call + def format_function_call(name, args) + formatted_name = apply_case(name, :functions) + "#{formatted_name}(#{args})" + end + + # Format a cleanup operation + # @param name [String] The variable name + # @param type [String] The cleanup type + # @param args [String, nil] Optional arguments for cleanup + # @return [String] The formatted cleanup operation + def format_cleanup(name, type, args = nil) + formatted_name = apply_case(name, :variables) + formatted_type = apply_case(type, :cleanup) + @config[:cleanup_handlers][:setup].call(formatted_name, formatted_type, args) + end + + private + + # Get the variable keyword from configuration + # @return [String] The variable keyword + def var_keyword + @config[:var_keyword] + end + + # Get the mutable variable keyword from configuration + # @return [String] The mutable variable keyword + def var_mut_keyword + @config[:var_keyword] + (@config[:var_mut_keyword] ? " #{@config[:var_mut_keyword]}" : '') + end + + # Get the assignment operator from configuration + # @return [String] The assignment operator + def assignment_operator + @config[:assignment_operator] + end + + # Get the string assignment operator from configuration + # @return [String] The string assignment operator + def string_assignment_operator + @config[:string_keyword] || var_keyword + end + + # Determine if a space should be added after the variable keyword + # @return [String] A space or an empty string + def add_space + @config[:var_keyword].empty? ? '' : ' ' + end + + # Perform a deep merge of two hashes + # @param base [Hash] The base configuration + # @param override [Hash] The configuration to override base with + # @return [Hash] The merged configuration + def deep_merge(base, override) + result = base.dup + override.each do |key, value| + if value.is_a?(Hash) && result[key].is_a?(Hash) + result[key] = deep_merge(result[key], value) + elsif value.is_a?(Array) && result[key].is_a?(Array) + result[key] = result[key] + value + else + result[key] = value + end + end + result + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/cpp_config.rb b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/cpp_config.rb new file mode 100644 index 00000000..8d9aa322 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/cpp_config.rb @@ -0,0 +1,149 @@ +module LanguageConfig + # Configuration class for generating Cpp test files + class CppConfig < BaseConfig + def initialize + super(DEFAULT_CONFIG) + end + + class << self + private + + def format_string_handler(text_parts, expressions) + combined_parts = text_parts.zip(expressions).flatten.compact + formatted_parts = combined_parts.each_with_index.map do |part, index| + if index.odd? + "to_string_custom(#{part})" + else + "\"#{part}\"" + end + end + formatted_parts.join(' + ') + end + end + + DEFAULT_CONFIG = { + supports_overloading: true, + statement_terminator: ';', + var_keyword: 'auto', + string_keyword: 'std::string', + file_extension: 'cpp', + + imports: [ + '#include ', + '#include ', + '#include ', + '#include "../helpers.hpp"' + ], + + identifier_cases: { + cleanup: :snake_case, + types: :snake_case, + functions: :snake_case, + variables: :snake_case, + fields: :snake_case, + constants: :upper_case + }.freeze, + + assert_conditions: { + 'equal' => ->(v1, v2, precision = nil) { precision ? "REQUIRE(abs(#{v1} - #{v2}) <= #{precision});" : "REQUIRE(#{v1} == #{v2});" }, + 'not_equal' => ->(v1, v2, _) { "REQUIRE(#{v1} != #{v2});" }, + 'greater_than' => ->(v1, v2, _) { "REQUIRE(#{v1} > #{v2});" }, + 'less_than' => ->(v1, v2, _) { "REQUIRE(#{v1} < #{v2});" }, + 'null' => ->(v1, _, _) { "REQUIRE(#{v1} == nullptr);" }, + 'not_null' => ->(v1, _, _) { "REQUIRE(#{v1} != nullptr);" }, + 'range' => ->(v1, v2, v3) { "REQUIRE((#{v1} >= #{v2})); REQUIRE((#{v1} <= #{v3}));" }, + 'true' => ->(v1, _, _) { "REQUIRE(#{v1});" }, + 'false' => ->(v1, _, _) { "REQUIRE_FALSE(#{v1});" }, + 'greater_than_or_equal' => ->(v1, v2, _) { "REQUIRE(#{v1} >= #{v2});" }, + 'less_than_or_equal' => ->(v1, v2, _) { "REQUIRE(#{v1} <= #{v2});" }, + 'throws' => ->(v1, _, _) { "REQUIRE_THROWS_AS(#{v1}, exception);" }, + 'not_empty' => ->(v1, _, _) { "REQUIRE(!#{v1}.empty());" }, + 'contains' => ->(v1, v2, _) { "REQUIRE(#{v2}.find(#{v1}) != string::npos);" }, + 'empty' => ->(v1, _, _) { "REQUIRE(#{v1}.empty());" } + }.freeze, + + if_conditions: { + 'greater_than' => ->(v1, v2) { "#{v1} > #{v2}" }, + 'true' => ->(v1, _) { "#{v1} == true" }, + 'false' => ->(v1, _) { "#{v1} == false" }, + 'equal' => ->(v1, v2) { "#{v1} == #{v2}" }, + 'not_equal' => ->(v1, v2) { "#{v1} != #{v2}" } + }.freeze, + + numeric_constants: { + infinity: 'std::numeric_limits::infinity()', + negative_infinity: '-std::numeric_limits::infinity()', + max_value: 'std::numeric_limits::max()' + }.freeze, + + control_flow: { + loop: ->(iterations) { "for (int i = 0; i < #{iterations}; ++i) {" }, + while: ->(condition) { "while (#{condition}) {" }, + if: ->(condition) { "if (#{condition}) {" }, + else: -> { 'else {' }, + break: -> { 'break;' }, + end: -> { '}' }, + new_line: 'endl' + }.freeze, + + string_handlers: { + string: ->(value) { "\"#{value}\"" }, + char: ->(value) { "'#{value}'" }, + string_ref: ->(value) { value }, + format_string: method(:format_string_handler) + }.freeze, + + literal_cast: { + unsigned_int: ->(value) { "#{value}u" }, + float: ->(value) { "#{value}f" }, + double: ->(value) { "#{value}d" }, + }.freeze, + + variable_handlers: { + array_size: ->(arr) { "#{arr}.size()" }, + }.freeze, + + function_handlers: { + test: ->(group, name) { ["TEST_CASE_METHOD(Test#{group}Fixture, \"test_#{name}_integration\") {"] } + }.freeze, + + comment_syntax: { + single: '//', + multi_start: '/*', + multi_end: '*/', + }.freeze, + + class_wrapper: { + header: [->(group) { "struct Test#{group}Fixture" }, '{'], + constructor_wrapper: { + header: ->(group) { ["Test#{group}Fixture()", '{'] }, + footer: ['}'] + }, + footer: ['};'] + }.freeze, + + cleanup_handlers: { + setup: ->(name, type, arg = nil) { "#{type}_cleanup #{name}#{arg.empty? ? '' : "(#{arg})" };" } + }.freeze, + + indentation: { + indent_after: ['{', 'public:', 'private:'], + unindent_before: ['};', '};', '}', 'public:', 'private:'] + }.freeze, + + terminal_handlers: { + message: ->(text) { "std::cout << \"#{text}\" << std::endl;" } + }.freeze, + + list_handlers: { + prefix: ->(type) { "vector<#{type}> {" }, + suffix: '}', + separator: ', ' + }, + + enum_handlers: { + separator: '::' + } + }.freeze + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/csharp_config.rb b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/csharp_config.rb new file mode 100644 index 00000000..bfce9d28 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/csharp_config.rb @@ -0,0 +1,165 @@ +module LanguageConfig + # Configuration class for generating Csharp test files + class CsharpConfig < BaseConfig + def initialize + super(DEFAULT_CONFIG) + end + + class << self + private + + def format_string_handler(text_parts, expressions) + formatted_expressions = expressions.map { |e| "{#{e}}" } + parts = [] + text_parts.each_with_index do |text, i| + parts << text + parts << formatted_expressions[i] if formatted_expressions[i] + end + "$\"#{parts.join}\"" + end + end + + DEFAULT_CONFIG = { + var_keyword: 'var', + supports_overloading: true, + statement_terminator: ';', + file_extension: 'cs', + + imports: [ + 'using Xunit;', + 'using SplashKitSDK;', + 'using static SplashKitSDK.SplashKit;', + 'using HttpMethod = SplashKitSDK.HttpMethod;' + ], + + identifier_cases: { + cleanup: :pascal_case, + types: :pascal_case, + functions: :pascal_case, + variables: :camel_case, + fields: :pascal_case, + constants: :pascal_case + }.freeze, + + assert_conditions: { + 'equal' => ->(v1, v2, precision = nil) { "Assert.Equal(#{v1}, #{v2}#{precision ? ", #{precision}" : ''});" }, + 'not_equal' => ->(v1, v2, _) { "Assert.NotEqual(#{v1}, #{v2});" }, + 'greater_than' => ->(v1, v2, _) { "Assert.True(#{v1} > #{v2});" }, + 'less_than' => ->(v1, v2, _) { "Assert.True(#{v1} < #{v2});" }, + 'null' => ->(v1, _, _) { "Assert.Null(#{v1});" }, + 'not_null' => ->(v1, _, _) { "Assert.NotNull(#{v1});" }, + 'range' => ->(v1, v2, v3) { "Assert.InRange(#{v1}, #{v2}, #{v3});" }, + 'true' => ->(v1, _, _) { "Assert.True(#{v1});" }, + 'false' => ->(v1, _, _) { "Assert.False(#{v1});" }, + 'greater_than_or_equal' => ->(v1, v2, _) { "Assert.True(#{v1} >= #{v2});" }, + 'less_than_or_equal' => ->(v1, v2, _) { "Assert.True(#{v1} <= #{v2});" }, + 'throws' => ->(v1, _, _) { "Assert.Throws(() => { #{v1} });" }, + 'not_empty' => ->(v1, _, _) { "Assert.NotEmpty(#{v1});" }, + 'contains' => ->(v1, v2, _) { "Assert.Contains(#{v1}, #{v2});" }, + 'empty' => ->(v1, _, _) { "Assert.Empty(#{v1});" } + }.freeze, + + if_conditions: { + 'greater_than' => ->(v1, v2) { "#{v1} > #{v2}" }, + 'true' => ->(v1, _) { "#{v1}" }, + 'false' => ->(v1, _) { "!#{v1}" }, + 'equal' => ->(v1, v2) { "#{v1} == #{v2}" }, + 'not_equal' => ->(v1, v2) { "#{v1} != #{v2}" } + }.freeze, + + numeric_constants: { + infinity: 'float.PositiveInfinity', + negative_infinity: 'float.NegativeInfinity', + max_value: 'float.MaxValue' + }.freeze, + + control_flow: { + loop: ->(iterations) { "for (int i = 0; i < #{iterations}; i++) {" }, + while: ->(condition) { "while (#{condition}) {" }, + if: ->(condition) { "if (#{condition}) {" }, + else: -> { 'else {' }, + break: -> { 'break;' }, + end: -> { '}' }, + new_line: 'Environment.NewLine' + }.freeze, + + string_handlers: { + char: ->(value) { "'#{value}'" }, + string_ref: ->(value) { value.to_camel_case }, + format_string: method(:format_string_handler), + string: ->(value) { "\"#{value}\"" } + }.freeze, + + type_mapping: { + 'json' => 'Json', + 'line' => 'Line' + }.freeze, + + literal_cast: { + unsigned_int: ->(value) { "#{value}u" }, + float: ->(value) { "#{value}f" } + }.freeze, + + variable_handlers: { + array_size: ->(arr) { "#{arr}.Count" }, + reference_operator: ->(var) { "ref #{var}" } + }.freeze, + + array_handlers: { + matrix_separator: ', ' + }, + + function_handlers: { + test: ->(_, name) { ['[Fact]', "public void Test#{name}Integration() {"] } + }.freeze, + + comment_syntax: { + single: '//', + multi_start: '/*', + multi_end: '*/' + }.freeze, + + class_wrapper: { + header: [ + 'namespace SplashKitTests', + '{', + ->(group) { "public class Test#{group}" }, + '{' + ], + constructor_wrapper: { + header: ->(group) { ["public Test#{group}()", '{'] }, + footer: ['}'] + }, + footer: [ + '}', + '}' + ] + }.freeze, + + cleanup_handlers: { + setup: ->(name, type, args = nil) { "using var #{name} = new #{type}Cleanup#{args ? "(#{args})" : '()'};" } + }.freeze, + + indentation: { + indent_after: ['{'], + unindent_before: ['}'] + }.freeze, + + terminal_handlers: { + message: ->(text) { "Console.WriteLine(\"#{text}\");" } + }.freeze, + + list_handlers: { + prefix: ->(type) { "new List<#{type}> {" }, + suffix: '}', + separator: ', ' + }, + + class_handlers: { + prefix: ->(name) { "new #{name}(" }, + suffix: ')', + separator: ', ' + }.freeze + }.freeze + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/pascal_config.rb b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/pascal_config.rb new file mode 100644 index 00000000..29cbe233 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/pascal_config.rb @@ -0,0 +1,205 @@ +module LanguageConfig + # Configuration class for generating Pascal test files + class PascalConfig < BaseConfig + def initialize + super(DEFAULT_CONFIG) + end + + class << self + private + + def format_string_handler(text_parts, expressions) + parts = [] + text_parts.each_with_index do |text, i| + parts << "'#{text}'" + parts << "ToStr(#{expressions[i]})" if expressions[i] + end + parts.join(' + ') + end + end + + DEFAULT_CONFIG = { + var_keyword: '', + assignment_operator: ':=', + supports_overloading: true, + statement_terminator: ';', + file_extension: 'pas', + + imports: [ + ->(group) { "unit #{group}_tests;" }, + 'interface', + 'uses splashkit_test, fpcunit, testutils, testregistry, Helpers, Math;', + 'procedure RegisterTests;' + ], + + identifier_cases: { + cleanup: :pascal_case, + types: :pascal_case, + functions: :pascal_case, + variables: :camel_case, + fields: :camel_case, + constants: :upper_case + }.freeze, + + assert_conditions: { + 'equal' => ->(v1, v2, precision = nil) { precision ? "AssertTrue(Abs(#{v1} - #{v2}) <= #{precision});" : "AssertTrue(#{v1} = #{v2});" }, + 'not_equal' => ->(v1, v2, _) { "AssertTrue(#{v1} <> #{v2});" }, + 'greater_than' => ->(v1, v2, _) { "AssertTrue(#{v1} > #{v2});" }, + 'less_than' => ->(v1, v2, _) { "AssertTrue(#{v1} < #{v2});" }, + 'null' => ->(v1, _, _) { "AssertNull(#{v1});" }, + 'not_null' => ->(v1, _, _) { "AssertNotNull(#{v1});" }, + 'range' => ->(v1, v2, v3) { "AssertTrue((#{v1} >= #{v2}) and (#{v1} <= #{v3}));" }, + 'true' => ->(v1, _, _) { "AssertTrue(#{v1});" }, + 'false' => ->(v1, _, _) { "AssertFalse(#{v1});" }, + 'greater_than_or_equal' => ->(v1, v2, _) { "AssertTrue(#{v1} >= #{v2});" }, + 'less_than_or_equal' => ->(v1, v2, _) { "AssertTrue(#{v1} <= #{v2});" }, + 'throws' => ->(v1, _, _) { "try#{v1}exceptend;" }, + 'not_empty' => ->(v1, _, _) { "AssertTrue(Length(#{v1}) > 0);" }, + 'contains' => ->(v1, v2, _) { "AssertTrue(Pos(#{v1}, #{v2}) > 0);" }, + 'empty' => ->(v1, _, _) { "AssertTrue(Length(#{v1}) = 0);" } + }.freeze, + + if_conditions: { + 'greater_than' => ->(v1, v2) { "#{v1} > #{v2}" }, + 'true' => ->(v1, _) { "#{v1} = true" }, + 'false' => ->(v1, _) { "#{v1} = false" }, + 'equal' => ->(v1, v2) { "#{v1} = #{v2}" }, + 'not_equal' => ->(v1, v2) { "#{v1} <> #{v2}" } + }.freeze, + + numeric_constants: { + infinity: 'MaxDouble', + negative_infinity: '-MaxDouble', + max_value: 'MaxSingle' + }.freeze, + + control_flow: { + loop: ->(iterations) { "for i := 0 to #{iterations - 1} do begin" }, + while: ->(condition) { "while #{condition} do begin" }, + if: ->(condition) { "if #{condition} then begin" }, + else: -> { 'else begin' }, + break: -> { 'break;' }, + end: -> { 'end;' }, + new_line: 'LineEnding' + }.freeze, + + string_handlers: { + char: ->(value) { "'#{value}'" }, + string_ref: ->(value) { value.to_camel_case }, + format_string: method(:format_string_handler), + string: ->(value) { "'#{value}'" } + }.freeze, + + type_mapping: { + 'double' => 'Double', + 'string' => 'String', + 'json' => 'Json', + 'line' => 'Line', + 'float' => 'Single', + 'bool' => 'Boolean', + 'int' => 'Integer', + 'string_ref' => 'String', + 'unsigned int' => 'Cardinal' + }.freeze, + + boolean_mapping: { + true => 'True', + false => 'False' + }.freeze, + + variable_handlers: { + array_size: ->(arr) { "Length(#{arr})" } + }.freeze, + + function_handlers: { + test: ->(group, name) { ["procedure TTest#{group}.Test#{name}Integration;"] } + }.freeze, + + comment_syntax: { + single: '//', + multi_start: '{', + multi_end: '}', + }.freeze, + + class_wrapper: { + header: [ + 'type', + ->(group) { "TTest#{group} = class(TTestCase)" }, + 'private_vars', + 'published', + 'published_functions', + 'end;', + '', + 'implementation', + '', + ->(group) { "{ TTest#{group} }" }, + '' + ], + publish: { + setup: 'procedure Setup; override;', + tear_down: 'procedure TearDown; override;' + }, + constructor_wrapper: { + header: ->(group) { [ + "procedure TTest#{group}.Setup;", + 'begin', + 'inherited;' + ] }, + footer: ['end;'] + }, + footer: [ + 'procedure RegisterTests;', + 'begin', + ->(group) { "RegisterTest(TTest#{group});" }, + 'end;', + 'end.' + ] + }.freeze, + + tear_down: { + header: ->(group) { ["procedure TTest#{group}.TearDown;", 'begin'] }, + footer: ['inherited;', 'end;'] + }, + + cleanup_handlers: { + setup: ->(_, type, arg = nil) { "cleanup#{type} := #{type}Cleanup.Create#{arg ? "(#{arg})" : ''};"}, + free: ->(name) { ["if Assigned(cleanup#{name}) then", "cleanup#{name}.Free;"] } + }.freeze, + + indentation: { + indent_after: %w[begin type protected published do private], + unindent_before: %w[end; end. protected published inherited], + reset_on: { + 'implementation' => 0 + } + }.freeze, + + terminal_handlers: { + message: ->(text) { "Write('#{text}');" } + }.freeze, + + array_handlers: { + separator: ', ' + }, + + method_handlers: { + prefix: ->(var, method) { "#{var}.#{method}" }, + suffix: '', + separator: ', ' + }, + + list_handlers: { + prefix: ->(type) { "Create#{type}Array([" }, + suffix: '])', + separator: ', ' + }, + + class_handlers: { + prefix: ->(name) { "T#{name}.Create(" }, + suffix: ')', + separator: ', ' + }.freeze + }.freeze + end +end + diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/python_config.rb b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/python_config.rb new file mode 100644 index 00000000..2cab4af6 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/python_config.rb @@ -0,0 +1,152 @@ +module LanguageConfig + # Configuration class for generating python test files + class PythonConfig < BaseConfig + def initialize + super(DEFAULT_CONFIG) + end + + class << self + private + + def format_string_handler(text_parts, expressions) + formatted_expressions = expressions.map { |e| "{#{e}}" } + parts = [] + text_parts.each_with_index do |text, i| + parts << text + parts << formatted_expressions[i] if formatted_expressions[i] + end + "f\"#{parts.join}\"" + end + end + + DEFAULT_CONFIG = { + var_keyword: '', + supports_overloading: false, + statement_terminator: '', + file_extension: 'py', + + imports: [ + 'import sys', + 'import os', + 'sys.path.append(os.path.join(os.path.dirname(__file__), "../../../data/language_files/python"))', + 'from splashkit_test import *', + 'import pytest', + 'from helpers import *', + 'import contextlib' + ], + + identifier_cases: { + cleanup: :snake_case, + types: :pascal_case, + functions: :snake_case, + variables: :snake_case, + fields: :snake_case, + constants: :snake_case + }.freeze, + + assert_conditions: { + 'equal' => ->(v1, v2, precision = nil) { precision ? "assert abs(#{v1} - #{v2}) <= #{precision}" : "assert #{v1} == #{v2}" }, + 'not_equal' => ->(v1, v2, _) { "assert #{v1} != #{v2}" }, + 'greater_than' => ->(v1, v2, _) { "assert #{v1} > #{v2}" }, + 'less_than' => ->(v1, v2, _) { "assert #{v1} < #{v2}" }, + 'null' => ->(v1, _, _) { "assert #{v1} is None" }, + 'not_null' => ->(v1, _, _) { "assert #{v1} is not None" }, + 'range' => ->(v1, v2, v3) { "assert #{v2} <= #{v1} <= #{v3}" }, + 'true' => ->(v1, _, _) { "assert #{v1}" }, + 'false' => ->(v1, _, _) { "assert not #{v1}" }, + 'greater_than_or_equal' => ->(v1, v2, _) { "assert #{v1} >= #{v2}" }, + 'less_than_or_equal' => ->(v1, v2, _) { "assert #{v1} <= #{v2}" }, + 'throws' => ->(v1, _, _) { "with pytest.raises(Exception): #{v1}" }, + 'not_empty' => ->(v1, _, _) { "assert len(#{v1}) > 0" }, + 'contains' => ->(v1, v2, _) { "assert #{v1} in #{v2}" }, + 'empty' => ->(v1, _, _) { "assert len(#{v1}) == 0" } + }.freeze, + + if_conditions: { + 'greater_than' => ->(v1, v2) { "#{v1} > #{v2}" }, + 'true' => ->(v1, _) { "#{v1} is True" }, + 'false' => ->(v1, _) { "#{v1} is False" }, + 'equal' => ->(v1, v2) { "#{v1} == #{v2}" }, + 'not_equal' => ->(v1, v2) { "#{v1} != #{v2}" } + }.freeze, + + numeric_constants: { + infinity: "float('inf')", + negative_infinity: "float('-inf')", + max_value: '3.4028235e+38' + }.freeze, + + control_flow: { + loop: ->(iterations) { "for _ in range(#{iterations}):" }, + while: ->(condition) { "while #{condition}:" }, + if: ->(condition) { "if #{condition}:" }, + else: -> { 'else:' }, + break: -> { 'break' }, + new_line: "'\'", + end: -> { "python_end_block" }, + block_end: -> { "python_end_block" } + }.freeze, + + string_handlers: { + char: ->(value) { "'#{value}'" }, + string_ref: ->(value) { value }, + format_string: method(:format_string_handler), + string: ->(value) { "\"#{value}\"" } + }.freeze, + + type_mapping: { + 'string' => 'str', + 'json' => 'Json', + 'line' => 'Line' + }.freeze, + + boolean_mapping: { + true => 'True', + false => 'False' + }.freeze, + + variable_handlers: { + array_size: ->(arr) { "len(#{arr})" } + }.freeze, + + function_handlers: { + test: ->(_, name) { ["def test_#{name}_integration(self):"] } + }.freeze, + + comment_syntax: { + single: '#', + multi_start: "'''", + multi_end: "'''", + }.freeze, + + class_wrapper: { + header: [->(group) { "class Test#{group}:" }], + constructor_wrapper: { + header: ['def setup_method(self):'], + footer: [''] + }, + footer: [] + }.freeze, + + cleanup_handlers: { + setup: ->(_, type, args = nil) { "with #{type}_cleanup(#{args}):" } + }.freeze, + + indentation: { + indent_after: [':'], + unindent_before: ['finally:', 'except:', 'else:', 'elif:'], + reset_on: { + 'def' => 1 + } + }.freeze, + + terminal_handlers: { + message: ->(text) { "print(\"#{text}\", end=\"\")" } + }.freeze, + + array_handlers: { + matrix_separator: ',' + } + }.freeze + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/rust_config.rb b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/rust_config.rb new file mode 100644 index 00000000..2b2f378e --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/config/languages/rust_config.rb @@ -0,0 +1,166 @@ +module LanguageConfig + # Configuration class for generating Rust test files + class RustConfig < BaseConfig + def initialize + super(DEFAULT_CONFIG) + end + + class << self + private + + def format_string_handler(text_parts, expressions) + format_str = "\"#{text_parts.join('{}')}{}\"" + format_args = expressions.join(', ') + "format!(#{format_str}, #{format_args})" + end + end + + DEFAULT_CONFIG = { + identifier_cases: { + cleanup: :pascal_case, + types: :pascal_case, + functions: :snake_case, + variables: :snake_case, + fields: :snake_case, + constants: :pascal_case + }.freeze, + + var_keyword: 'let', + var_mut_keyword: 'mut', + supports_overloading: false, + statement_terminator: ';', + file_extension: 'rs', + + imports: [ + 'use std::*;', + 'use splashkit_backend::*;', + 'use splashkit_tests::helpers::*;', + 'use ctor::ctor;', + '#[cfg(test)]' + ], + + assert_conditions: { + 'equal' => ->(v1, v2, precision = nil) { precision ? "assert!((#{v1} - #{v2}).abs() <= #{precision});" : "assert_eq!(#{v1}, #{v2});" }, + 'not_equal' => ->(v1, v2, _) { "assert_ne!(#{v1}, #{v2});" }, + 'greater_than' => ->(v1, v2, _) { "assert!(#{v1} > #{v2});" }, + 'less_than' => ->(v1, v2, _) { "assert!(#{v1} < #{v2});" }, + 'null' => ->(v1, _, _) { "assert!(#{v1}.is_null());" }, + 'not_null' => ->(v1, _, _) { "assert!(!#{v1}.is_null());" }, + 'range' => ->(v1, v2, v3) { "assert!((#{v2}..=#{v3}).contains(&#{v1}));" }, + 'true' => ->(v1, _, _) { "assert!(#{v1});" }, + 'false' => ->(v1, _, _) { "assert!(!#{v1});" }, + 'greater_than_or_equal' => ->(v1, v2, _) { "assert!(#{v1} >= #{v2});" }, + 'less_than_or_equal' => ->(v1, v2, _) { "assert!(#{v1} <= #{v2});" }, + 'throws' => ->(v1, _, _) { "assert!(std::panic::catch_unwind(|| { #{v1} }).is_err());" }, + 'not_empty' => ->(v1, _, _) { "assert!(!#{v1}.is_empty());" }, + 'contains' => ->(v1, v2, _) { "assert!(#{v2}.contains(#{v1}));" }, + 'empty' => ->(v1, _, _) { "assert!(#{v1}.is_empty());" } + }.freeze, + + if_conditions: { + 'greater_than' => ->(v1, v2) { "#{v1} > #{v2}" }, + 'true' => ->(v1, _) { "#{v1} == true" }, + 'false' => ->(v1, _) { "#{v1} == false" }, + 'equal' => ->(v1, v2) { "#{v1} == #{v2}" }, + 'not_equal' => ->(v1, v2) { "#{v1} != #{v2}" } + }.freeze, + + numeric_constants: { + infinity: 'f64::INFINITY', + negative_infinity: 'f64::NEG_INFINITY', + max_value: 'f32::MAX' + }.freeze, + + control_flow: { + loop: ->(iterations) { "for _ in 0..#{iterations} {" }, + while: ->(condition) { "while #{condition} {" }, + if: ->(condition) { "if #{condition} {" }, + else: -> { 'else {' }, + break: -> { 'break;' }, + end: -> { '}' }, + new_line: "'\'" + }.freeze, + + string_handlers: { + char: ->(value) { "'#{value}'" }, + string_ref: ->(value) { "#{value}.clone()" }, + format_string: method(:format_string_handler), + string: ->(value) { "\"#{value}\".to_string()" } + }.freeze, + + type_mapping: { + 'double' => 'f64', + 'json' => 'Json', + 'line' => 'Line' + }.freeze, + + literal_cast: { + unsigned_int: ->(value) { "#{value} as u32" }, + float: ->(value) { "#{value} as f32" }, + double: ->(value) { "#{value} as f64" }, + }.freeze, + + comparison_cast: { + unsigned_int: ->(value) { "#{value} as u32" }, + float: ->(value) { "#{value} as f32" }, + double: ->(value) { "#{value} as f64" } + }.freeze, + + variable_handlers: { + array_size: ->(arr) { "#{arr}.len()" }, + reference_operator: ->(var) { "&mut #{var}" } + }.freeze, + + function_handlers: { + test: ->(_, name) { ['#[test]', "fn test_#{name}_integration() {"] } + }.freeze, + + comment_syntax: { + single: '//', + multi_start: '/*', + multi_end: '*/' + }.freeze, + + class_wrapper: { + header: [ + ->(group) { "mod test_#{group} {" }, + 'use super::*;' + ], + constructor_wrapper: { + header: ['#[ctor]', 'fn setup()', '{'], + footer: ['}'] + }, + footer: ['}'] + }.freeze, + + cleanup_handlers: { + setup: ->(name, type, arg = nil) { "let _#{name} = #{type}Cleanup::new(#{arg});" } + }.freeze, + + indentation: { + indent_after: ['{'], + unindent_before: ['}'] + }.freeze, + + terminal_handlers: { + message: ->(text) { "println!(\"#{text}\");" } + }.freeze, + + list_handlers: { + prefix: ->(_) { 'vec![' }, + suffix: ']', + separator: ', ' + }, + + enum_handlers: { + separator: '::' + }, + + class_handlers: { + prefix: ->(name) { "#{name}::new(" }, + suffix: ')', + separator: ', ' + }.freeze + }.freeze + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/errors/test_generator_errors.rb b/coresdk/src/test/splashkit-test-generator/test_generator/errors/test_generator_errors.rb new file mode 100644 index 00000000..a312d43a --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/errors/test_generator_errors.rb @@ -0,0 +1,7 @@ +module TestGenerator + class TestGeneratorError < StandardError; end + class ConfigurationError < TestGeneratorError; end + class ValidationError < TestGeneratorError; end + class LanguageError < TestGeneratorError; end + class HandlerError < TestGeneratorError; end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/lib.rb b/coresdk/src/test/splashkit-test-generator/test_generator/lib.rb new file mode 100644 index 00000000..6e2ef1b7 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/lib.rb @@ -0,0 +1,41 @@ +# Core Ruby libraries +require 'json' +require 'fileutils' + +# Configuration +require_relative 'config/language_config' + +# Core data models +require_relative 'models/function' +require_relative 'models/parameter' + +# Service handlers for messages and class wrapping +require_relative 'services/handlers/class_wrapper_handler' +require_relative 'services/handlers/constructor_handler' +require_relative 'services/handlers/tear_down_handler' + +# Code and value formatting services +require_relative 'services/formatters/code_formatter' +require_relative 'services/formatters/value_formatter' + +# Test writing services +require_relative 'services/writers/step_writer' +require_relative 'services/writers/test_case' +require_relative 'services/writers/test_writer' + +# Test loading services +require_relative 'services/loaders/test_loader' + +# Configuration validation +require_relative 'validators/config_validator' +require_relative 'validators/source_validator' + +# Utility classes +require_relative 'utils/function_lookup' +require_relative 'utils/parser' +require_relative 'utils/pascal_variable_collector' +require_relative 'utils/cmake_builder' +require_relative 'utils/binding_fetcher' + +# Custom error definitions +require_relative 'errors/test_generator_errors' diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/models/function.rb b/coresdk/src/test/splashkit-test-generator/test_generator/models/function.rb new file mode 100644 index 00000000..dc0f3947 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/models/function.rb @@ -0,0 +1,21 @@ +# Represents a function in the SplashKit API +class Function + attr_reader :name, :description, :parameters, :return_type, + :return_description, :group, :suffix, :signature, :constructor_type, + :constant_value, :unique_global_name, :type_parameter + + def initialize(attributes = {}) + @name = attributes[:name] + @unique_global_name = attributes[:unique_global_name] + @description = attributes[:description] + @parameters = attributes[:parameters] + @return_type = attributes[:return_type] + @constructor_type = attributes[:constructor_type] || 'function' + @return_description = attributes[:return_description] + @group = attributes[:group] + @suffix = attributes[:suffix] ? "_#{attributes[:suffix]}" : '' + @signature = attributes[:signature] + @constant_value = attributes[:constant_value] + @type_parameter = attributes[:type_parameter] + end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/models/parameter.rb b/coresdk/src/test/splashkit-test-generator/test_generator/models/parameter.rb new file mode 100644 index 00000000..4bd802db --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/models/parameter.rb @@ -0,0 +1,12 @@ +# Represents a parameter in a SplashKit function +class Parameter + attr_reader :name, :param_type, :description, :is_array, :array_dimension_sizes + + def initialize(name:, param_type:, description: '', is_array: false, array_dimension_sizes: []) + @name = name + @param_type = param_type + @description = description + @is_array = is_array + @array_dimension_sizes = array_dimension_sizes + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/formatters/code_formatter.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/formatters/code_formatter.rb new file mode 100644 index 00000000..0ec1a1a1 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/formatters/code_formatter.rb @@ -0,0 +1,122 @@ +module TestGenerator + # Class responsible for handling code indentation and formatting in test generation + class CodeFormatter + attr_reader :level + + def initialize(indent_size) + @indent_size = indent_size + @level = 0 + end + + # Indents text with the current indentation level + # @param text [String, Object] The text to indent + # @param config [Hash] The language configuration + # @param add_terminator [Boolean] Whether to add a statement terminator + # @return [String] The indented text + def indent(text, config, add_terminator = false) + text_str = text.to_s + return handle_block_end if block_end?(text_str, config) + + handle_indent(text_str, config, add_terminator) + end + + # Increases the indentation level by one + # @return [void] + def increase_indent + @level += 1 + end + + # Decreases the indentation level by one if possible + # @return [void] + def decrease_indent + @level -= 1 if @level > 0 + end + + # Formats and indents a single line of code + # @param line [String] The line to format + # @return [String] The formatted and indented line + def format_line(line, config) + return '' if line.nil? || line.empty? + + indent(line.strip, config) + end + + # Adds the language-specific statement terminator if configured (e.g. ; in C++) + # @param text [String] The text to add the line operator to + # @param config [Hash] The language configuration + # @return [String] The text with line operator added if configured + def add_statement_terminator(text, config) + return text unless config.statement_terminator + + text + config.statement_terminator + end + + private + + # Handles regular indentation for non-block-end text + # @param text_str [String] The text to indent + # @param config [Hash] The language configuration + # @param add_terminator [Boolean] Whether to add a statement terminator + # @return [String] The indented text + def handle_indent(text_str, config, add_terminator) + check_reset_patterns(text_str, config) + check_unindent_patterns(text_str, config) + indented_text = create_indented_text(text_str, config, add_terminator) + check_indent_patterns(text_str, config) + indented_text + end + + # Checks if the text matches any unindent patterns and decreases indent if needed + # @param text_str [String] The text to check + # @param config [Hash] The language configuration + def check_unindent_patterns(text_str, config) + config.indentation[:unindent_before]&.any? { |pattern| text_str.strip.end_with?(pattern) } && decrease_indent + end + + # Checks if the text matches any indent patterns and increases indent if needed + # @param text_str [String] The text to check + # @param config [Hash] The language configuration + def check_indent_patterns(text_str, config) + config.indentation[:indent_after]&.any? { |pattern| text_str.strip.end_with?(pattern) } && increase_indent + end + + # Creates indented text with proper spacing and terminators + # @param text_str [String] The text to indent + # @param config [Hash] The language configuration + # @param add_terminator [Boolean] Whether to add a statement terminator + # @return [String] The formatted text with indentation + def create_indented_text(text_str, config, add_terminator) + base_text = add_terminator ? add_statement_terminator(text_str, config) : text_str + "#{' ' * (@level * @indent_size)}#{base_text}\n" + end + + # Checks if the text matches any reset patterns and sets the indentation level + # @param text_str [String] The text to check for reset patterns + # @param config [Hash] The language configuration containing reset patterns and their target levels + def check_reset_patterns(text_str, config) + config.indentation[:reset_on]&.each do |pattern, target_level| + if text_str.strip.start_with?(pattern) + @level = target_level + break + end + end + end + + # Checks if the text is a block end marker + # @param text_str [String] The text to check + # @param config [Hash] The language configuration + # @return [Boolean] True if text is a block end marker + def block_end?(text_str, config) + return false unless config.control_flow[:block_end] + + text_str == config.control_flow[:block_end].call + end + + # Handles block end by decreasing indent and returning empty string + # @return [String] Empty string + def handle_block_end + decrease_indent + "\n" + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/formatters/value_formatter.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/formatters/value_formatter.rb new file mode 100644 index 00000000..206d2a3d --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/formatters/value_formatter.rb @@ -0,0 +1,319 @@ +module TestGenerator + # Formats values for test generation based on their type and language configuration + module ValueFormatter + class << self + # Checks if running in Windows Subsystem for Linux (WSL) + # WSL uses a different graphics and window manager than Windows, + # which can lead to different window/element sizes when created. + # this is because it reserves space for borders and title bars + # The alt_value is used for WSL environments, while the normal + # value is used for native Windows environments. + def is_wsl + @is_wsl ||= system('uname -r | grep -q "WSL"') + end + # Maps value types to their corresponding formatting methods + # @return [Hash] Map of value types to formatter method names + def formatter_map + @formatter_map ||= { + 'function' => :format_function_value, + 'variable' => :format_variable_value, + 'variable_field' => :format_variable_field_value, + 'variable_matrix_access' => :format_variable_matrix_access_value, + 'list' => :format_list_value, + 'array_access' => :format_array_access_value, + 'array_access_field' => :format_array_access_field_value, + 'double' => :format_primitive_value, + 'int' => :format_primitive_value, + 'bool' => :format_boolean_value, + 'string' => :format_string_value, + 'string_ref' => :format_string_ref_value, + 'float' => :format_float_value, + 'enum' => :format_enum_value, + 'inf' => :format_infinity_value, + 'neg_inf' => :format_neg_infinity_value, + 'char' => :format_char_value, + 'max_value' => :format_max_value, + 'interpolated_string' => :format_interpolated_string_value, + 'class_instance' => :format_class_instance_value, + 'unsigned_int' => :format_unsigned_int_value, + 'unsigned_short' => :format_primitive_value, + 'ref' => :format_ref_value, + 'size' => :format_array_size_value, + 'object' => :format_object_value, + 'precision' => :format_primitive_value, + 'method_call' => :format_method_call_value, + 'reference' => :format_reference_value + }.freeze + end + + # Formats the value based on its type + # @param value [Hash] The value to format + # @param functions [Array] Available functions + # @param config [Hash] Language configuration + # @return [String] The formatted value + def format_value(value, functions, config) + return value.to_s if value.nil? || !value.is_a?(Hash) + + formatter = formatter_map[value[:type]] + if formatter + send(formatter, value, functions, config) + else + MessageHandler.log_warning("Unknown value type: #{value[:type]}") + puts "value: #{JSON.pretty_generate(value)}" + value.to_s + end + rescue StandardError => e + MessageHandler.log_error('Value formatting error', e.message) + raise HandlerError, "Failed to format value: #{e.message}" + end + + # Formats function values with arguments + # @param value [Hash] The function value to format + # @param functions [Array] Available functions + # @param config [Hash] Language configuration + # @return [String] The formatted function call + # @raise [StandardError] If function name is missing + def format_function_value(value, functions, config) + args = (value[:args] || []).map { |arg| format_value(arg, functions, config) }.join(', ') + function_name = FunctionLookup.determine_function_name(value, config, functions) + raise "Function name is required for function value #{JSON.pretty_generate(value)}" unless function_name + + result = config.format_function_call(function_name, args) + if value[:cast_to] && config.comparison_cast + result = config.comparison_cast[value[:cast_to].to_sym].call(result) + end + result + end + + # Formats variable references + # @param value [Hash] The variable value to format + # @param _ [Array] Unused functions parameter + # @param config [Hash] Language configuration + # @return [String] The formatted variable reference + def format_variable_value(value, _, config) + config.format_identifier(value[:variable_name]) + end + + # Formats field access on variables + # @param value [Hash] The field access value to format + # @param functions [Array] Available functions + # @param config [Hash] Language configuration + # @return [String] The formatted field access + def format_variable_field_value(value, functions, config) + variable_value = format_variable_value(value, functions, config) + config.format_field_access(variable_value, value[:variable_field]) + end + + # Formats primitive values + # @param value [Hash] The primitive value to format + # @return [String] The formatted primitive value + def format_primitive_value(value, _, _) + if value[:alt_value] && is_wsl + value[:alt_value].inspect + else + value[:value].inspect + end + end + + # Formats enum values + # @param value [Hash] The enum value to format + # @param config [Hash] Language configuration + # @return [String] The formatted enum value + def format_enum_value(value, _, config) + config.format_enum(value[:enum_type], value[:value]) + end + + # Formats matrix access on variables + # @param value [Hash] The matrix access value to format + # @param functions [Array] Available functions + # @param config [Hash] Language configuration + # @return [String] The formatted matrix access + def format_variable_matrix_access_value(value, functions, config) + variable_value = format_variable_value(value, functions, config) + variable_with_field = config.format_field_access(variable_value, value[:field]) + config.format_matrix_access(variable_with_field, value[:row], value[:col]) + end + + # Formats array access values + # @param value [Hash] The array access value to format + # @param config [Hash] Language configuration + # @return [String] The formatted array access + def format_array_access_value(value, _, config) + array_identifier = config.format_identifier(value[:array_name]) + config.format_array_access(array_identifier, value[:index]) + end + + # Formats list values + # @param value [Hash] The list value to format + # @param functions [Array] Available functions + # @param config [Hash] Language configuration + # @return [String] The formatted list + def format_list_value(value, functions, config) + values = value[:value].map { |v| format_value(v, functions, config) } + config.format_list(values, value[:target_type]) + end + + # Formats field access on array elements + # @param value [Hash] The array field access value to format + # @param config [Hash] Language configuration + # @return [String] The formatted array field access + def format_array_access_field_value(value, _, config) + identifier = config.format_identifier(value[:variable_name]) + array_access = config.format_field_access(identifier, value[:array_name]) + array_with_index = config.format_array_access(array_access, value[:index]) + config.format_field_access(array_with_index, value[:field]) + end + + # Formats infinity constant + # @param config [Hash] Language configuration + # @return [String] The language-specific infinity constant + def format_infinity_value(_, _, config) + config.numeric_constants[:infinity] + end + + # Formats negative infinity constant + # @param config [Hash] Language configuration + # @return [String] The language-specific negative infinity constant + def format_neg_infinity_value(_, _, config) + config.numeric_constants[:negative_infinity] + end + + # Formats character values + # @param value [Hash] The character value to format + # @param config [Hash] Language configuration + # @return [String] The formatted character value + def format_char_value(value, _, config) + config.string_handlers[:char].call(value[:value]) + end + + # Formats maximum value constant + # @param config [Hash] Language configuration + # @return [String] The language-specific maximum value constant + def format_max_value(_, _, config) + config.numeric_constants[:max_value] + end + + # Formats interpolated strings + # @param value [Hash] The interpolated string value to format + # @param functions [Array] Available functions + # @param config [Hash] Language configuration + # @return [String] The formatted interpolated string + def format_interpolated_string_value(value, functions, config) + text_parts = [] + expressions = [] + value[:parts].each do |part| + if part[:type] == 'text' + text_parts << part[:value] + else + expressions << format_value(part[:expression], functions, config) + end + end + config.string_handlers[:format_string].call(text_parts, expressions) + end + + # Formats class instance creation + # @param value [Hash] The class instance value to format + # @param functions [Array] Available functions + # @param config [Hash] Language configuration + # @return [String] The formatted class instance creation + # @raise [StandardError] If class name is missing + def format_class_instance_value(value, functions, config) + formatted_args = (value[:args] || []).map { |arg| format_value(arg, functions, config) } + raise "Class name is required for class instance value #{JSON.pretty_generate(value)}" unless value[:class_name] + + config.format_class_instance(value[:class_name], formatted_args) + end + + # Formats array size access + # @param value [Hash] The array size value to format + # @param _ [Array] Unused functions parameter + # @param config [Hash] Language configuration + # @return [String] The formatted array size access + def format_array_size_value(value, _, config) + array_identifier = config.format_identifier(value[:variable_name]) + config.variable_handlers[:array_size].call(array_identifier) + end + + # Formats float values + # @param value [Hash] The float value to format + # @return [String] The formatted float value + def format_float_value(value, _, config) + config.literal_cast[:float].call(value[:value]) + end + + # Formats unsigned integer values + # @param value [Hash] The unsigned integer value to format + # @param _ [Array] Unused functions parameter + # @param config [Hash] Language configuration + # @return [String] The formatted unsigned integer value + def format_unsigned_int_value(value, _, config) + config.literal_cast[:unsigned_int].call(value[:value]) + end + + # Formats reference values + # @param value [Hash] The ref value to format + # @param functions [Array] Available functions + # @param config [Hash] Language configuration + # @return [String] The formatted reference + def format_ref_value(value, _, config) + identifier = config.format_identifier(value[:variable_name]) + config.variable_handlers[:reference_operator].call(identifier) + end + + # Formats reference values + # @param value [Hash] The reference value to format + # @param _ [Array] Unused functions parameter + # @param config [Hash] Language configuration + # @return [String] The formatted reference + def format_reference_value(value, _, config) + config.format_identifier(value[:value]) + end + + # Formats string values + # @param value [Hash] The string value to format + # @param _ [Array] Unused functions parameter + # @param config [Hash] Language configuration + # @return [String] The formatted string value + def format_string_value(value, _, config) + config.string_handlers[:string].call(value[:value]) + end + + # Formats string reference values + # @param value [Hash] The string reference value to format + # @param _ [Array] Unused functions parameter + # @param config [Hash] Language configuration + # @return [String] The formatted string reference + def format_string_ref_value(value, _, config) + config.string_handlers[:string_ref].call(value[:value]) + end + + # # Formats object values + # # @param value [Hash] The object value to format + # # @param _ [Array] Unused functions parameter + # # @param config [Hash] Language configuration + # # @return [String] The formatted object + # def format_object_value(value, _, config) + # config.type_handlers[:object].call(value[:object_type], value[:variable_name]) + # end + + # Formats method call values + # @param value [Hash] The method call value to format + # @param config [Hash] Language configuration + # @return [String] The formatted method call + def format_method_call_value(value, _, config) + config.format_method_call(value[:variable_name], value[:method_name], value[:args]) + end + + # Formats boolean values + # @param value [Hash] The boolean value to format + # @param _ [Array] Unused functions parameter + # @param config [Hash] Language configuration + # @return [String] The formatted boolean value + def format_boolean_value(value, _, config) + bool_value = value[:value] + mapping = config.boolean_mapping&.[](bool_value) + mapping || bool_value.to_s + end + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/class_wrapper_handler.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/class_wrapper_handler.rb new file mode 100644 index 00000000..0866f50b --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/class_wrapper_handler.rb @@ -0,0 +1,74 @@ +module TestGenerator + # Handles the generation of class wrapper code for test files + class ClassWrapperHandler + def initialize(config) + @config = config + end + + # Gets the header lines for the class wrapper + # @param group [String] The group name for the test class + # @return [Array] Array of header lines, with procs evaluated + def header_lines(group, group_file, tests) + formatted_group = @config.apply_case(group, :types) + @config.class_wrapper[:header].map do |line| + if line == 'published_functions' && @config.language == :pascal + write_published_section(tests, group_file) + elsif line == 'private_vars' && @config.language == :pascal + write_private_vars(group_file) + else + line.is_a?(Proc) ? line.call(formatted_group) : line + end + end.flatten + end + + # Gets the footer lines for the class wrapper + # @return [Array] Array of footer lines + def footer_lines(group) + formatted_group = @config.apply_case(group, :types) + @config.class_wrapper[:footer].map do |line| + line.is_a?(Proc) ? line.call(formatted_group) : line + end + end + + private + + # Writes the private vars for Pascal test classes + # @param file [File] File handle to write to + # @return [void] + def write_private_vars(group_file) + return [] unless group_file[:cleanup] + + ['private'] + group_file[:cleanup].map do |step| + "cleanup#{step[:cleanup_type].to_pascal_case}: #{step[:cleanup_type].to_pascal_case}Cleanup;" + end + end + + # Writes the published section for Pascal test classes + # @param file [File] File handle to write to + # @return [void] + def write_published_section(tests, group_file) + lines = [] + tests.each do |test| + lines << "procedure Test#{test[:name].to_pascal_case}Integration;" + end + lines += write_protected_section(group_file) + lines + end + + # Writes the protected section with setup and tear down declarations + # @param file [File] File handle to write to + # @return [void] + def write_protected_section(group_file) + return [] unless @config.should_write?(:protected_section, group_file) + + lines = ['protected'] + lines << write_protected_line(:setup) if @config.should_write?(:constructor, group_file) + lines << write_protected_line(:tear_down) if @config.should_write?(:tear_down, group_file) + lines + end + + def write_protected_line(section_type) + @config.class_wrapper[:publish][section_type] + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/constructor_handler.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/constructor_handler.rb new file mode 100644 index 00000000..63dfcc95 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/constructor_handler.rb @@ -0,0 +1,60 @@ +module TestGenerator + # Handles constructor-related test code generation + class ConstructorHandler + def initialize(config) + @config = config + end + + # Generates constructor-related test lines if conditions are met + # @param group [String] The test group name + # @param constructor_steps [Array] Steps to be executed in constructor + # @return [Array] Array of formatted test lines + def lines(group, group_file, functions, formatter) + return [] unless @config.should_write?(:constructor, group_file) + + [ + *header_lines(group), + *step_lines(group_file, functions, formatter), + *footer_lines + ] + end + + private + + # Generates header lines with proper group name formatting + # @param group [String] The test group name + # @return [Array, String] Formatted header lines + def header_lines(group) + formatted_group = @config.apply_case(group, :types) + header = @config.class_wrapper[:constructor_wrapper][:header] + header.is_a?(Proc) ? header.call(formatted_group) : header + end + + # Processes each constructor step, with special handling for resource paths + # @param steps [Array] Array of step definitions + # @return [Array] Formatted test steps + def step_lines(group_file, functions, formatter) + group_file[:constructor].map do |step| + step = update_resources_path(step) if step[:function_name] == 'set_resources_path' + StepWriter.write_test_step(step, functions, @config, formatter) + end + end + + # Returns footer configuration for constructor wrapper + # @return [Array, String] Footer lines for constructor + def footer_lines + @config.class_wrapper[:constructor_wrapper][:footer] + end + + # Updates resource path to absolute path based on current file location + # This is for the set_resources_path splashkit function. + # @param step [Hash] The step definition to update + # @return [Hash] Updated step with absolute resource path + def update_resources_path(step) + step = step.dup + step[:args] = step[:args].map(&:dup) + step[:args][0][:value] = DirectoryManager::RESOURCES_DIR + step + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/tear_down_handler.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/tear_down_handler.rb new file mode 100644 index 00000000..ce16e72f --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/handlers/tear_down_handler.rb @@ -0,0 +1,48 @@ +module TestGenerator + # Handles tear down and cleanup test code generation + class TearDownHandler + def initialize(config) + @config = config + end + + # Generates tear down related test lines if conditions are met + # @param group [String] The test group name + # @param cleanup_steps [Array] Steps to be cleaned up + # @return [Array] Array of formatted test lines + def lines(group, group_file) + return [] unless @config.should_write?(:tear_down, group_file) + + [ + *header_lines(group), + *step_lines(group_file[:cleanup]), + *footer_lines + ] + end + + private + + # Generates header lines with proper group name formatting + # @param group [String] The test group name + # @return [Array, String] Formatted header lines + def header_lines(group) + formatted_group = @config.apply_case(group, :types) + @config.tear_down[:header].call(formatted_group) + end + + # Formats cleanup steps into test lines + # @param cleanup_steps [Array] Steps to be cleaned up + # @return [Array] Formatted cleanup step lines + def step_lines(cleanup_steps) + cleanup_steps.flat_map do |step| + formatted_type = @config.apply_case(step[:cleanup_type], :types) + @config.cleanup_handlers[:free].call(formatted_type) + end + end + + # Returns footer configuration for tear down wrapper + # @return [Array, String] Footer lines for tear down + def footer_lines + @config.tear_down[:footer] + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/loaders/test_loader.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/loaders/test_loader.rb new file mode 100644 index 00000000..2dba4abc --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/loaders/test_loader.rb @@ -0,0 +1,66 @@ +module TestGenerator + # Class responsible for loading and organizing test files into groups + class TestLoader + # Loads and organizes all test files into groups + # @return [Hash] Tests organized by group name + def load_all + MessageHandler.log_info('Loading test files...') + all_tests = {} + process_test_files(all_tests) + log_results(all_tests) + all_tests + end + + private + + # Processes all test files in the data/tests directory + # @param all_tests [Hash] Hash to store the processed tests + # @return [void] + def process_test_files(all_tests) + files = Dir.glob('data/tests/*.json') + MessageHandler.log_info("Found #{files.count} test files") + files.each { |file| process_single_file(file, all_tests) } + end + + # Processes a single test file and adds its tests to the appropriate group + # @param file [String] Path to the test file + # @param all_tests [Hash] Hash to store the processed tests + # @return [void] + def process_single_file(file, all_tests) + content = parse_and_validate_file(file) + group = content[:group] + all_tests[group] ||= { + tests: [], + constructor: content[:constructor], + cleanup: content[:cleanup], + group: group + } + all_tests[group][:tests].concat(content[:tests]) + MessageHandler.log_status("Found #{content[:tests].count} tests for group '#{group}' from #{file}") + rescue JSON::ParserError => e + raise ValidationError, "Invalid JSON in test file #{file}: #{e.message}" + rescue StandardError => e + raise TestGeneratorError, "Error processing test file #{file}: #{e.message}" + end + + # Parses and validates a test file + # @param file [String] Path to the file + # @return [Hash] Parsed and validated content + # @raise [ValidationError] If content structure is invalid + def parse_and_validate_file(file) + content = JSON.parse(File.read(file), symbolize_names: true) + unless content.is_a?(Hash) && content[:group] && content[:tests].is_a?(Array) + raise ValidationError, "Invalid test file structure in #{file}. Required keys: 'group' and 'tests' array" + end + + content + end + + # Logs the groups found after processing all files + # @param all_tests [Hash] The processed tests organized by group + # @return [void] + def log_results(all_tests) + MessageHandler.log_info("Groups found: #{all_tests.keys.join(', ')}") + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/step_writer.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/step_writer.rb new file mode 100644 index 00000000..1e320345 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/step_writer.rb @@ -0,0 +1,186 @@ +module TestGenerator + # Class responsible for writing individual test steps based on their type and configuration + class StepWriter + def initialize(step, functions, config, formatter) + @step = step + @functions = functions + @config = config + @formatter = formatter + end + + # Writes a test step using a new instance of StepWriter + # @param step [Hash] The test step to write + # @param functions [Array] Available functions + # @param config [Object] Language configuration + # @param formatter [CodeFormatter] Code formatting utility + # @return [String] The formatted test step code + def self.write_test_step(step, functions, config, formatter) + new(step, functions, config, formatter).write + end + + def write + type = @step[:type] + method_name = "write_#{type}_step" + + if respond_to?(method_name, true) + send(method_name) + else + MessageHandler.log_warning("Unimplemented step type: #{type}") + puts ": #{JSON.pretty_generate(@step)}" + @formatter.indent("# TODO: Implement #{type} step", @config) + end + rescue StandardError => e + MessageHandler.log_error("Error in step #{type}", e.message) + raise TestGeneratorError, "Failed to write #{type} step: #{e.message}" + end + + private + + # Writes a variable declaration step + # @return [String] Formatted variable declaration code + def write_variable_step + declaration_op = declaration + declaration = declaration_op.call(@step[:variable_name]) + step_clone = @step.clone + step_clone[:type] = step_clone[:variable_type] + value = ValueFormatter.format_value(step_clone, @functions, @config) + @formatter.indent("#{declaration}#{value}", @config, true) + end + + # Writes a function call step + # @return [String] Formatted function call code + def write_function_step + call = ValueFormatter.format_value(@step, @functions, @config) + if @step[:store_result] + declaration_op = declaration + declaration = declaration_op.call(@step[:store_result]) + @formatter.indent("#{declaration}#{call}", @config, true) + else + @formatter.indent(call, @config, true) + end + end + + # Gets the appropriate declaration handler based on variable type and mutability + # @param handlers [Hash] The variable handlers configuration + # @return [Proc] The declaration handler to use + def declaration + handlers = @config.variable_handlers + if @step[:variable_type] == 'string' && handlers[:declaration][:string] + handlers[:declaration][:string] + elsif @step[:is_mutable] + handlers[:declaration][:mutable] + else + handlers[:declaration][:regular] + end + end + + # Writes an assertion step + # @return [String] Formatted assertion code + def write_assertion_step + comparison = @step[:compare] + value1 = ValueFormatter.format_value(comparison[:value1], @functions, @config) + value2 = comparison[:value2] ? ValueFormatter.format_value(comparison[:value2], @functions, @config) : nil + value3 = comparison[:value3] ? ValueFormatter.format_value(comparison[:value3], @functions, @config) : nil + + @formatter.indent(@config.assert_conditions[comparison[:compare_type]].call(value1, value2, value3), @config) + end + + # Writes a loop step + # @return [String] Formatted loop code + def write_loop_step + loop_code = @formatter.indent(@config.control_flow[:loop].call(@step[:iterations]), @config) + @step[:loop_steps].each do |inner_step| + loop_code << self.class.write_test_step(inner_step, @functions, @config, @formatter) + end + loop_code << @formatter.indent(@config.control_flow[:end].call, @config) + loop_code + end + + # Writes a condition for if or while steps + # @param comparison [Hash] The comparison configuration + # @return [String] Formatted condition code + # @raise [StandardError] If comparison type is unsupported + def write_condition(comparison) + type = comparison[:compare_type] + value1 = ValueFormatter.format_value(comparison[:value1], @functions, @config) + value2 = comparison[:value2] ? ValueFormatter.format_value(comparison[:value2], @functions, @config) : nil + @config.if_conditions.fetch(type) do + MessageHandler.log_error("Unsupported comparison type: #{type}", comparison) + raise "Unsupported comparison type: #{type}" + end.call(value1, value2) + end + + # Writes an if-else step + # @return [String] Formatted if-else code + def write_if_step + condition_code = write_condition(@step[:compare]) + if_code = @formatter.indent(@config.control_flow[:if].call(condition_code), @config) + @step[:then_steps].each do |then_step| + if_code << self.class.write_test_step(then_step, @functions, @config, @formatter) + end + if_code << @formatter.indent(@config.control_flow[:end].call, @config) + if_code << write_else_steps + if_code + end + + # Writes the else part of an if-else step + # @return [String] Formatted else code + def write_else_steps + return '' unless @step[:else_steps] + + else_code = @formatter.indent(@config.control_flow[:else].call, @config) + @step[:else_steps].each do |else_step| + else_code << self.class.write_test_step(else_step, @functions, @config, @formatter) + end + else_code << @formatter.indent(@config.control_flow[:end].call, @config) + else_code + end + + # Writes a while loop step + # @return [String] Formatted while loop code + def write_while_step + condition = write_condition(@step[:compare]).strip + while_code = @formatter.indent(@config.control_flow[:while].call(condition), @config) + @step[:while_steps].each do |inner_step| + while_code << self.class.write_test_step(inner_step, @functions, @config, @formatter) + end + while_code << @formatter.indent(@config.control_flow[:end].call, @config) + while_code + end + + # Writes a variable reassignment step + # @return [String] Formatted reassignment code + def write_reassignment_step + reassignment_op = @config.variable_handlers[:declaration][:reassignment].call(@step[:variable_name]) + step_clone = @step.clone + step_clone[:type] = step_clone[:reassignment_type] + value = ValueFormatter.format_value(step_clone, @functions, @config) + @formatter.indent("#{reassignment_op}#{value}", @config, true) + end + + # Writes a prompt step that displays a message to the user + # @return [String] Formatted prompt code (e.g., cout, print, Console.WriteLine etc.) + def write_message_step + @formatter.indent(@config.terminal_handlers[:message].call(@step[:message]), @config) + end + + # Writes a cleanup step + # @return [String] Formatted cleanup code + def write_cleanup_step + args = format_args(@step[:args]) + cleanup = @config.format_cleanup(@step[:store_result], @step[:cleanup_type], args) + @formatter.indent(cleanup, @config) + end + + def format_args(args) + args.map { |arg| ValueFormatter.format_value(arg, @functions, @config) }.join(', ') + end + + # Writes a delegate call step + # @return [String] Formatted delegate call code + def write_method_call_step + method_call = ValueFormatter.format_value(@step, @functions, @config) + @formatter.indent(method_call, @config, true) + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/test_case.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/test_case.rb new file mode 100644 index 00000000..164e682f --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/test_case.rb @@ -0,0 +1,78 @@ +module TestGenerator + # Class responsible for generating individual test case code with proper formatting + class TestCase + attr_reader :name, :steps + + def initialize(name, group, steps, config, functions) + @name = name + @group = group + @steps = steps + @config = config + @functions = functions + end + + # Generates formatted code for the test case + # @param formatter [CodeFormatter] The formatter to use for code indentation + # @return [String] The complete formatted test case code + def to_code(formatter) + code = write_header(formatter) + code << write_var_section(formatter) if @config.language == :pascal + code << write_steps(formatter) + code << formatter.indent(@config.control_flow[:end].call, @config) + code + end + + private + + # Writes the test case header with the test name + # @return [String] The formatted test header + def write_header(formatter) + @config.format_test_function(@group, @name).map do |line| + formatter.indent(line, @config) + end.join + end + + # Writes all test steps in sequence + # @param formatter [CodeFormatter] The formatter to use for code indentation + # @return [String] The formatted test steps code + def write_steps(formatter) + @steps.map.with_index do |step, index| + StepWriter.write_test_step(step, @functions, @config, formatter) + rescue StandardError => e + raise TestGeneratorError, "Error writing step #{index + 1} in test '#{@name}': #{e.message}" + end.join + end + + # Generates the variable declaration section for Pascal tests + # @param formatter [CodeFormatter] The formatter to use for code indentation + # @return [String] Formatted variable declarations or just 'begin' if no variables + def write_var_section(formatter) + variables = collect_variables + return formatter.indent('begin', @config) if variables.empty? + + format_var_declarations(formatter, variables) + end + + # Formats the variable declarations in Pascal syntax + # @param formatter [CodeFormatter] The formatter to use for code indentation + # @param variables [Hash] Map of variable names to their Pascal types + # @return [String] Formatted string containing all variable declarations + def format_var_declarations(formatter, variables) + var_section = formatter.indent('var', @config) + formatter.increase_indent + variables.each do |var_name, type| + var_section << formatter.indent("#{var_name.to_camel_case}: #{type};", @config) + end + formatter.decrease_indent + var_section << formatter.indent('begin', @config) + var_section + end + + # Collects all variables used in the test steps + # @return [Hash] Map of variable names to their Pascal types + def collect_variables + collector = VariableCollector.new(@config, @functions) + collector.collect_from_steps(@steps) + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/test_writer.rb b/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/test_writer.rb new file mode 100644 index 00000000..3877d58a --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/services/writers/test_writer.rb @@ -0,0 +1,158 @@ +module TestGenerator + # Class responsible for writing test files for each function group + class TestWriter + def initialize(group, group_functions, all_functions, config, group_files) + @group = group + @group_functions = group_functions # Functions for this group only + @functions = all_functions # All available functions + @config = config + @group_files = group_files + @formatter = CodeFormatter.new(config.indent_size) + end + + # Writes the test file for a function group + # @param tests_dir [String] Directory where test files will be written + # @return [void] + def write_to(tests_dir) + FileUtils.mkdir_p(File.dirname(test_file_path(tests_dir))) + File.open(test_file_path(tests_dir), 'w') do |file| + write_content(file) + end + rescue SystemCallError => e + raise TestGeneratorError, "Failed to write test file: #{e.message}" + end + + private + + # Generates the file path for the test file + # @param tests_dir [String] Base directory for test files + # @return [String] Complete file path + def test_file_path(tests_dir) + "#{tests_dir}/#{@group.downcase.gsub(/\s+/, '_')}_tests.#{@config.file_extension}" + end + + # Writes the complete test file content + # @param file [File] File handle to write to + # @return [void] + def write_content(file) + write_imports(file) + if @config.class_wrapper + write_wrapped_tests(file) + else + write_unwrapped_tests(file) + end + end + + # Writes import statements at the start of the file + # @param file [File] File handle to write to + # @return [void] + def write_imports(file) + @config.imports.each do |import| + line = import.respond_to?(:call) ? import.call(@group) : import + file.puts(line) + end + end + + # Writes tests wrapped in a class structure + # @param file [File] File handle to write to + # @return [void] + def write_wrapped_tests(file) + write_class_header(file) + write_constructor(file) + write_class_footer(file) if @config.language == :cpp + write_test_methods(file) + write_tear_down(file) + write_class_footer(file) if @config.language != :cpp + end + + # Writes tests without class wrapping + # @param file [File] File handle to write to + # @return [void] + def write_unwrapped_tests(file) + @group_functions.each do |function| + write_test_method(file, function) + end + end + + # Writes the class header with proper indentation + # @param file [File] File handle to write to + # @return [void] + def write_class_header(file) + tests = @group_functions.map { |function| find_test_case(function) } + @config.class_wrapper_handler.header_lines(@group, group_file, tests).each do |line| + file.puts(@formatter.indent(line, @config)) + end + end + + # Writes the class footer + # @param file [File] File handle to write to + # @return [void] + def write_class_footer(file) + @config.class_wrapper_handler.footer_lines(@group).each do |line| + file.puts(@formatter.format_line(line, @config)) + end + end + + # Writes the constructor if required + # @param file [File] File handle to write to + # @return [void] + def write_constructor(file) + @config.constructor_handler.lines(@group, group_file, @functions, @formatter).each do |line| + file.puts(@formatter.format_line(line, @config)) + end + end + + # Writes individual test methods for each function + # @param file [File] File handle to write to + # @return [void] + def write_test_methods(file) + @group_functions.each do |function| + test_case = find_test_case(function) + test = TestCase.new(test_case[:name], @group, test_case[:steps], @config, @functions) + file.puts(test.to_code(@formatter)) + end + end + + # Finds the test case for a given function + # @param function [Function] The function to find tests for + # @return [Hash] The test case for the function + # @raise [StandardError] If no test case is found + def find_test_case(function) + test_case = FunctionLookup.get_test_by_function_name(function, @group_files) + validate_test_case_exists!(function, test_case) + test_case + end + + # Writes the tear down section + # @param file [File] File handle to write to + # @return [void] + def write_tear_down(file) + @config.tear_down_handler.lines(@group, group_file).each do |line| + file.puts(@formatter.format_line(line, @config)) + end + end + + # Gets constructor steps from group tests + # @return [Array, nil] Array of constructor steps or nil if none exist + def group_file + return nil unless @group_files[@group].is_a?(Hash) + + @group_files[@group] + end + + # Validates that a test case exists for a given function + # @param function [Function] The function to validate + # @param test_case [Hash, nil] The test case or nil if not found + # @raise [ValidationError] If no test case is found + def validate_test_case_exists!(function, test_case) + return if test_case + + raise ValidationError, <<~ERROR + No test case found for: + - Function: #{function.name} + - Group: #{function.group} + - Available groups: #{@group_files.to_h.keys.join(', ')} + ERROR + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/test_generator.rb b/coresdk/src/test/splashkit-test-generator/test_generator/test_generator.rb new file mode 100644 index 00000000..9585f791 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/test_generator.rb @@ -0,0 +1,48 @@ +require_relative 'lib' + +# Module responsible for generating test cases for SplashKit functions +module TestGenerator + # Main entry point for test generation + # @param api_json [String] JSON string containing the API specification + def self.generate(api_json) + SourceValidator.validate + CMakeBuilder.build_if_needed + BindingFetcher.process_files + + api = JSON.parse(api_json) + functions = Parser.parse_functions(api) + group_tests = TestLoader.new.load_all + + # Generate tests for each supported programming language + LanguageConfig::SUPPORTED_LANGUAGES.each do |language| + generate_for_language(functions, language, group_tests) + MessageHandler.log_success("Completed generating tests for #{language}") + end + end + + # Generates test files for a specific programming language + # @param functions [Array] List of functions to generate tests for + # @param language [String] Target programming language + # @param group_tests [Hash] Pre-loaded test cases grouped by category + def self.generate_for_language(functions, language, group_tests) + config = LanguageConfig.for_language(language) + base_dir, tests_dir = DirectoryManager.setup(config.language) + write_group_files(functions, tests_dir, config, group_tests) + rescue StandardError => e + MessageHandler.log_error('Test generation failed', e.message) + raise + end + + # Writes individual test group files + # @param functions [Array] List of all functions + # @param tests_dir [String] Directory to write test files + # @param config [LanguageConfig] Language configuration + # @param group_tests [Hash] Pre-loaded test cases + def self.write_group_files(functions, tests_dir, config, group_tests) + functions + .group_by { |func| func.group || 'ungrouped' } # Group functions by their category + .each do |group, group_funcs| + TestWriter.new(group, group_funcs, functions, config, group_tests).write_to(tests_dir) + end + end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/utils/binding_fetcher.rb b/coresdk/src/test/splashkit-test-generator/test_generator/utils/binding_fetcher.rb new file mode 100644 index 00000000..ae3a6d86 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/utils/binding_fetcher.rb @@ -0,0 +1,121 @@ +module TestGenerator + # Handles the generation and updating of language-specific test bindings + class BindingFetcher + # Processes binding files for all supported languages + # @return [void] + def self.process_files + process_python_files + process_rust_files + process_csharp_files + process_pascal_files + end + + private + + # Generates Python-specific test bindings with updated library paths + # @return [void] + def self.process_python_files + generate_language_bindings('python', 'splashkit.py', 'splashkit_test.py') do |content| + new_lib_path = LibProcessor.test_library_path + content.gsub(/search_paths = \[.*?\]/m) do |match| + "search_paths = [\"#{new_lib_path.gsub('\\', '/').strip}\"]\n" + end + end + end + + # Copies Rust bindings + # @return [void] + def self.process_rust_files + generate_language_bindings('rust', 'splashkit.rs', 'src/lib.rs') + end + + # Generates C#-specific test bindings with updated library paths + # @return [void] + def self.process_csharp_files + generate_language_bindings('csharp', 'splashkit.cs', 'splashkit_test.cs') do |content| + content.gsub!(/\[DllImport\("SplashKit",/, '[DllImport("SplashKitBackend",') + end + end + + # Generates Pascal-specific test bindings with updated library paths + # @return [void] + def self.process_pascal_files + generate_language_bindings('pascal', 'splashkit.pas', 'splashkit_test.pas') do |content| + content.gsub!(/unit\s+SplashKit;/i, 'unit splashkit_test;') + end + end + + # Generic method to generate language-specific bindings + # @param language [String] Target programming language + # @param source_filename [String] Name of the source binding file + # @param dest_filename [String] Name of the destination test binding file + # @yield [String] Optional block for content modification + # @return [void] + def self.generate_language_bindings(language, source_filename, dest_filename) + paths = setup_paths(language, source_filename, dest_filename) + return unless paths[:source_exists] + + return if bindings_up_to_date?(paths, language) + + generate_binding_file(paths, language) do |content| + block_given? ? yield(content) : content + end + end + + # Sets up source and destination paths for binding generation + # @param language [String] Target programming language + # @param source_filename [String] Name of the source binding file + # @param dest_filename [String] Name of the destination test binding file + # @return [Hash] Paths and existence information + def self.setup_paths(language, source_filename, dest_filename) + source_dir = LibProcessor.source_dir(language) + source_file = File.join(source_dir, source_filename) + dest_dir = LibProcessor.dest_dir(language) + dest_path = File.join(dest_dir, dest_filename) + + FileUtils.mkdir_p(File.dirname(dest_path)) + + { + source: source_file, + dest: dest_path, + source_exists: File.exist?(source_file) + } + end + + # Checks if existing bindings are up to date + # @param paths [Hash] Source and destination path information + # @param language [String] Target programming language + # @return [Boolean] true if bindings are current + def self.bindings_up_to_date?(paths, language) + if timestamps_current?(paths[:dest], paths[:source]) + MessageHandler.log_info("Test #{language} bindings are up to date at #{paths[:dest]}") + true + else + false + end + end + + # Generates the actual binding file with optional content modification + # @param paths [Hash] Source and destination path information + # @param language [String] Target programming language + # @yield [String] Block for content modification + # @return [void] + def self.generate_binding_file(paths, language) + content = File.read(paths[:source]) + content = yield(content) + File.write(paths[:dest], content) + MessageHandler.log_info("Created test #{language} bindings at #{paths[:dest]}") + end + + # Checks if destination file is newer than source file + # @param dest_file [String] Path to destination file + # @param source_file [String] Path to source file + # @return [Boolean] true if destination is current + def self.timestamps_current?(dest_file, source_file) + dest_time = File.mtime(dest_file) + [source_file, __FILE__ ].all? do |file| + dest_time >= File.mtime(file) + end + end + end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/utils/cmake_builder.rb b/coresdk/src/test/splashkit-test-generator/test_generator/utils/cmake_builder.rb new file mode 100644 index 00000000..5b05d9ff --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/utils/cmake_builder.rb @@ -0,0 +1,88 @@ +module TestGenerator + # Handles CMake-based compilation of the C/C++ test library + class CMakeBuilder + BUILD_DIR = 'build' + + # Initiates build process if source files or CMake configuration have changed + # @return [Boolean] true if build succeeds or not needed, false on failure + def self.build_if_needed + return unless needs_rebuild? + + MessageHandler.log_info("Building C library...") + build_library + end + + private + + # Performs the actual build process using CMake and Make + # @return [Boolean] true if build succeeds, false otherwise + def self.build_library + build_path = File.join(DirectoryManager::CMAKE_PATH, BUILD_DIR) + FileUtils.mkdir_p(build_path) + run_cmake && run_make + end + + # Runs CMake to generate build files + # @return [Boolean] true if CMake configuration succeeds + def self.run_cmake + Dir.chdir(DirectoryManager::CMAKE_PATH) do + return MessageHandler.log_error('CMake configuration failed') unless system('cmake', '-B', BUILD_DIR) + true + end + end + + # Runs Make to compile the library + # @return [Boolean] true if compilation succeeds + def self.run_make + Dir.chdir(File.join(DirectoryManager::CMAKE_PATH, BUILD_DIR)) do + return MessageHandler.log_error('Make build failed') unless system('make') + true + end + end + + # Determines if rebuilding is necessary based on file modifications + # @return [Boolean] true if rebuild is needed + def self.needs_rebuild? + cmake_file_modified? || source_files_modified? + end + + # Checks if CMake configuration file has been modified since last build + # @return [Boolean] true if CMake files are newer than built library + def self.cmake_file_modified? + return true unless library_files_exist? + cmake_path = File.join(DirectoryManager::CMAKE_PATH, 'CMakeLists.txt') + File.mtime(cmake_path) > newest_library_timestamp + end + + # Checks if any source files have been modified since last build + # @return [Boolean] true if any source files are newer than built library + def self.source_files_modified? + return true unless library_files_exist? + source_files.any? { |f| File.mtime(f) > newest_library_timestamp } + end + + # Verifies existence of built library files + # @return [Boolean] true if library files exist + def self.library_files_exist? + library_files.any? + end + + # Gets list of all library files in build directory + # @return [Array] List of library file paths + def self.library_files + @library_files ||= DirectoryManager.find_all_library_files + end + + # Gets list of all source files that need to be compiled + # @return [Array] List of source file paths + def self.source_files + @source_files ||= DirectoryManager.find_all_source_files + end + + # Gets timestamp of most recently built library file + # @return [Time, nil] Timestamp of newest library file or nil if none exist + def self.newest_library_timestamp + @newest_library_timestamp ||= library_files.map { |f| File.mtime(f) }.max + end + end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/utils/function_lookup.rb b/coresdk/src/test/splashkit-test-generator/test_generator/utils/function_lookup.rb new file mode 100644 index 00000000..6a7678b5 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/utils/function_lookup.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module TestGenerator + # Module for looking up tests and functions by their unique names + module FunctionLookup + # Determines the appropriate function name based on overload support + # @param step [Hash] The step containing the function name + # @param config [Object] The language configuration object + # @param functions [Array] List of available functions + # @return [String] The formatted function name according to language convention + # @raise [Error] If global function is not found + def self.determine_function_name(step, config, functions) + function = get_function_by_unique_global_name(step[:function_name], functions) + config.supports_overloading ? function.name : function.unique_global_name + rescue NoMethodError => e + raise HandlerError, "Error processing function '#{step[:function_name]}': #{e.message}" + end + + # Retrieves a test with a given function name + # @param function [Object] The function object + # @param group_tests [Hash] Available group tests + # @return [Hash, nil] The matching test or nil if not found + def self.get_test_by_function_name(function, group_tests) + group = function.group || 'ungrouped' + group_data = group_tests[group] + return nil unless group_data && group_data[:tests] + + group_data[:tests].find { |t| t[:name] == function.unique_global_name } + end + + # Finds a function by its unique global name + # @param unique_global_name [String] The unique global name to search for + # @param functions [Array] List of available functions + # @return [Object, nil] The matching function or nil if not found + def self.get_function_by_unique_global_name(unique_global_name, functions) + function = functions.find { |func| func.unique_global_name == unique_global_name.downcase } + raise HandlerError, "Function '#{unique_global_name}' not found in available functions." if function.nil? + + function + rescue NoMethodError => e + raise HandlerError, "Error processing function '#{unique_global_name}': #{e.message}" + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/utils/parser.rb b/coresdk/src/test/splashkit-test-generator/test_generator/utils/parser.rb new file mode 100644 index 00000000..64052b4b --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/utils/parser.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module TestGenerator + # Parses SplashKit API definitions to create function and parameter objects + module Parser + + def self.parse_functions(api) + all_functions = [] + api.each_value do |group| + next unless group['functions'].is_a?(Array) + + # Create function objects for each function in the group + group['functions'].each { |f| all_functions << create_function(f) } + end + all_functions + end + + class << self + private + + def create_function(func) + Function.new( + name: func['name'], + unique_global_name: func['unique_global_name'], + description: func['description'] || '', + parameters: parse_parameters(func), + return_type: func.dig('return', 'type'), + type_parameter: func.dig('return', 'type_parameter'), + return_description: func.dig('return', 'description'), + group: func.dig('attributes', 'group') || 'other', + suffix: func.dig('attributes', 'suffix'), + signature: func.dig('signatures', 'cpp', 0) + ) + end + + def parse_parameters(function) + parameters = [] + return parameters unless function['parameters'].is_a?(Hash) + + function['parameters'].each do |param_name, info| + parameters << Parameter.new( + name: param_name, + param_type: info['type'], + description: info['description'] || '', + is_array: info['is_array'] || false, + array_dimension_sizes: info['array_dimension_sizes'] || [] + ) + end + parameters + end + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/utils/pascal_variable_collector.rb b/coresdk/src/test/splashkit-test-generator/test_generator/utils/pascal_variable_collector.rb new file mode 100644 index 00000000..06c743ae --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/utils/pascal_variable_collector.rb @@ -0,0 +1,82 @@ +module TestGenerator + # Collects and maps variables from test steps for pascal + class VariableCollector + def initialize(config, functions) + @config = config + @functions = functions + end + + # Processes all test steps and builds a hash of variable names and their Pascal types + # @param steps [Array] List of test steps to process + # @return [Hash] Map of variable names to their Pascal types + def collect_from_steps(steps) + variables = {} + steps.each do |step| + search_for_variables(step, variables) + end + variables + end + + private + + # Recursively searches through test step data structures to find variable declarations + # @param item [Hash, Array] The current item being processed + # @param variables [Hash] The collection of variables being built + def search_for_variables(item, variables) + case item + when Hash + check_for_loop(item, variables) + check_for_store_result(item, variables) + check_for_variable_step(item, variables) + item.each_value { |v| search_for_variables(v, variables) } + when Array + item.each { |i| search_for_variables(i, variables) } + end + end + + # Adds loop counter variable 'i' when a loop step is encountered + # @param item [Hash] The step being checked + # @param variables [Hash] The collection of variables being built + def check_for_loop(item, variables) + return unless item.is_a?(Hash) && item[:type] == 'loop' + + variables['i'] = 'Integer' + end + + # Processes function results that are stored in variables + # @param item [Hash] The step being checked + # @param variables [Hash] The collection of variables being built + def check_for_store_result(item, variables) + return unless item.is_a?(Hash) && item[:store_result] && item[:function_name] + + function = FunctionLookup.get_function_by_unique_global_name(item[:function_name], @functions) + is_array = function.return_type == 'vector' + type = is_array ? function.type_parameter : function.return_type + variables[item[:store_result]] = map_type(type, is_array) + end + + # Processes variable declaration steps + # @param item [Hash] The step being checked + # @param variables [Hash] The collection of variables being built + def check_for_variable_step(item, variables) + return unless item[:type] == 'variable' && item[:variable_type] + # Handle variable references (copying type from another variable) + return variables[item[:variable_name]] = variables[item[:value]] if item[:variable_type] == 'reference' + + is_class = item[:variable_type] == 'class_instance' + is_array = item[:variable_type] == 'list' + type = is_array ? item[:target_type] : item[:variable_type] + type = is_class ? "t_#{item[:class_name]}" : type + variables[item[:variable_name]] = map_type(type, is_array) + end + + # Maps a type to its Pascal equivalent, handling arrays if necessary + # @param type [String] The type to map + # @param is_array [Boolean] Whether this type should be wrapped as an array + # @return [String] The mapped Pascal type + def map_type(type, is_array = false) + mapped_type = @config.type_mapping[type] || type.to_pascal_case + is_array ? "ArrayOf#{mapped_type}" : mapped_type + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/validators/config_validator.rb b/coresdk/src/test/splashkit-test-generator/test_generator/validators/config_validator.rb new file mode 100644 index 00000000..cd61e108 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/validators/config_validator.rb @@ -0,0 +1,221 @@ +module TestGenerator + # Class responsible for validating language configuration handlers and their required methods + class ConfigValidator + # List of required configuration handlers that must be present + REQUIRED_KEYS = %i[ + language identifier_cases indent_size file_extension imports assert_conditions + if_conditions control_flow string_handlers supports_overloading class_wrapper + numeric_constants terminal_handlers comment_syntax indentation literal_cast + statement_terminator variable_handlers function_handlers cleanup_handlers + array_handlers method_handlers list_handlers class_handlers + ].freeze + + # Creates a new validator instance + # @param config [Object] The configuration object to validate + def initialize(config) + @config = config.is_a?(Hash) ? config : {} + end + + # Validates a configuration by creating a new validator instance + # @param config [Object] The configuration to validate + # @return [Boolean] True if validation passes + # @raise [StandardError] If validation fails + def self.validate!(config) + new(config).validate! + end + + # Performs all validation checks + # @return [Boolean] True if all validations pass + # @raise [StandardError] If any validation fails + def validate! + validate_required_keys + validate_handler_methods + true + end + + private + + # Checks for presence of all required handlers + # @raise [StandardError] If any required handlers are missing + def validate_required_keys + missing = REQUIRED_KEYS - @config.keys + raise "Missing required handlers: #{missing.join(', ')}" if missing.any? + end + + # Validates all handler method requirements + # @return [void] + def validate_handler_methods + validate_variable_handlers + validate_function_handlers + validate_control_flow + validate_string_handlers + validate_assert_conditions + validate_if_conditions + validate_class_wrapper + validate_comment_syntax + validate_indentation + validate_cleanup_handlers + validate_literal_cast + validate_terminal_handlers + validate_list_handlers + validate_class_handlers + validate_method_handlers + validate_array_handlers + validate_enum_handlers + validate_numeric_constants + validate_identifier_cases + end + + # Validates required variable handler methods + # @return [void] + def validate_variable_handlers + required = %i[array_size reference_operator declaration] + validate_methods(@config[:variable_handlers], required, 'variable_handlers') + end + + # Validates required function handler methods + # @return [void] + def validate_function_handlers + required = %i[test] + validate_methods(@config[:function_handlers], required, 'function_handlers') + end + + # Validates required control flow methods + # @return [void] + def validate_control_flow + required = %i[loop while if else break end] + validate_methods(@config[:control_flow], required, 'control_flow') + end + + # Validates required string handler methods + # @return [void] + def validate_string_handlers + required = %i[char format_string string string_ref] + validate_methods(@config[:string_handlers], required, 'string_handlers') + end + + # Validates required assert condition methods + # @return [void] + def validate_assert_conditions + required = %w[equal not_equal greater_than less_than null not_null range true false + greater_than_or_equal less_than_or_equal throws not_empty contains empty] + validate_methods(@config[:assert_conditions], required, 'assert_conditions') + end + + # Validates required if condition methods + # @return [void] + def validate_if_conditions + required = %w[greater_than true false equal not_equal] + validate_methods(@config[:if_conditions], required, 'if_conditions') + end + + # Validates required class wrapper methods + # @return [void] + def validate_class_wrapper + required = %i[header constructor_wrapper footer] + validate_methods(@config[:class_wrapper], required, 'class_wrapper') + end + + # Validates required comment syntax methods + # @return [void] + def validate_comment_syntax + required = %i[single multi_start multi_end] + validate_methods(@config[:comment_syntax], required, 'comment_syntax') + end + + # Validates required indentation rules + # @return [void] + def validate_indentation + required = %i[indent_after unindent_before] + validate_methods(@config[:indentation], required, 'indentation') + end + + # Validates required cleanup handler methods + # @return [void] + def validate_cleanup_handlers + return unless @config[:cleanup_handlers] + + required = %i[setup] + validate_methods(@config[:cleanup_handlers], required, 'cleanup_handlers') + end + + # Validates required literal cast methods + # @return [void] + def validate_literal_cast + required = %i[unsigned_int float double] + validate_methods(@config[:literal_cast], required, 'literal_cast') + end + + # Validates required terminal handler methods + # @return [void] + def validate_terminal_handlers + required = %i[message] + validate_methods(@config[:terminal_handlers], required, 'terminal_handlers') + end + + # Validates required list handler methods + # @return [void] + def validate_list_handlers + required = %i[prefix suffix separator] + validate_methods(@config[:list_handlers], required, 'list_handlers') + end + + # Validates required class handler methods + # @return [void] + def validate_class_handlers + required = %i[prefix suffix separator] + validate_methods(@config[:class_handlers], required, 'class_handlers') + end + + # Validates required method handler methods + # @return [void] + def validate_method_handlers + required = %i[prefix suffix separator] + validate_methods(@config[:method_handlers], required, 'method_handlers') + end + + # Validates required array handler methods + # @return [void] + def validate_array_handlers + required = %i[prefix suffix separator] + validate_methods(@config[:array_handlers], required, 'array_handlers') + end + + # Validates required enum handler methods + # @return [void] + def validate_enum_handlers + required = %i[separator] + validate_methods(@config[:enum_handlers], required, 'enum_handlers') + end + + # Validates required numeric constant methods + # @return [void] + def validate_numeric_constants + required = %i[infinity negative_infinity max_value] + validate_methods(@config[:numeric_constants], required, 'numeric_constants') + end + + # Validates required identifier case methods + # @return [void] + def validate_identifier_cases + required = %i[cleanup functions variables fields constants] + validate_methods(@config[:identifier_cases], required, 'identifier_cases') + end + + # Validates that a handler has all required methods + # @param handler [Object] The handler to validate + # @param required_methods [Array] List of required method names + # @param handler_name [String] Name of the handler for error messages + # @raise [StandardError] If handler is invalid or missing required methods + def validate_methods(handler, required_methods, handler_name) + raise "Invalid or missing handler: #{handler_name}" if handler.nil? || !handler.respond_to?(:keys) + + missing = required_methods - handler.keys + return unless missing.any? + + error_msg = "Missing required methods in #{handler_name} for #{@config[:language]}: #{missing.join(', ')}" + MessageHandler.log_error(error_msg) + raise error_msg + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_generator/validators/source_validator.rb b/coresdk/src/test/splashkit-test-generator/test_generator/validators/source_validator.rb new file mode 100644 index 00000000..46e053df --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_generator/validators/source_validator.rb @@ -0,0 +1,54 @@ +module TestGenerator + # Validates the existence and state of required source files and tools + # Ensures translator and bindings are properly set up before test generation + class SourceValidator + # Main validation method that checks for bindings and translator + # Provides guidance on setup and running the translator when needed + # @return [void] + def self.validate + if bindings_exist? + MessageHandler.log_warning( + "Important:\n" \ + "1. Run translator after any source code changes\n" \ + "2. Re-run test generator to apply updates" + ) + return + end + + if translator_exists? + MessageHandler.log_error( + "Generated bindings are missing.\n" \ + "Please run the translator to generate language bindings.\n" \ + "See Docker_README.md for instructions on running the translator." + ) + else + MessageHandler.log_error( + "Setup required:\n" \ + "1. Clone the translator repository (git submodule init && git submodule update)\n" \ + "2. See Docker_README.md for instructions on running the translator\n" \ + "3. Keep running translator after source code changes\n" \ + "4. Re-run the test generator to apply changes" + ) + end + exit 1 + end + + private + + # Checks if all required language bindings exist in the generated directory + # @return [Boolean] true if all required language bindings exist + def self.bindings_exist? + DirectoryManager::REQUIRED_LANGUAGES.all? do |lang| + Dir.exist?(File.join(DirectoryManager::GENERATED_DIR, lang)) + end + end + + # Verifies that the translator directory exists and contains files + # @return [Boolean] true if translator is properly installed + def self.translator_exists? + translator_dir = DirectoryManager::TRANSLATOR_DIR + puts "Translator dir: #{translator_dir}" + Dir.exist?(translator_dir) && !Dir.empty?(translator_dir) + end + end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/config/test_config.rb b/coresdk/src/test/splashkit-test-generator/test_runner/config/test_config.rb new file mode 100644 index 00000000..0f967300 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/config/test_config.rb @@ -0,0 +1,43 @@ +module TestConfig + def self.setup + config = TestRunnerConfig.new + + # Sequential test groups + config.mark_as_sequential('audio') + config.mark_as_sequential('animations') + config.mark_as_skip('networking') + config.mark_as_sequential('windows') + config.mark_as_sequential('utilities') + config.mark_as_sequential('camera') + config.mark_as_sequential('graphics') + config.mark_as_sequential('geometry') + config.mark_as_sequential('sprites') + config.mark_as_sequential('physics') + config.mark_as_sequential('resource_bundles') + config.mark_as_sequential('resources') + config.mark_as_sequential('timers') + config.mark_as_sequential('json') + + # Manual test groups + config.mark_as_sequential('input') + config.mark_as_sequential('interface') + config.mark_as_sequential('terminal') + config.mark_as_sequential('logging') + config.mark_as_manual('input') + config.mark_as_manual('interface') + config.mark_as_manual('terminal') + config.mark_as_manual('logging') + + @runners = { + cpp: CppTestRunner.new(config), + python: PythonTestRunner.new(config), + pascal: PascalTestRunner.new(config), + rust: RustTestRunner.new(config), + csharp: CSharpTestRunner.new(config) + } + end + + def self.runners + @runners + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/config/test_runner_config.rb b/coresdk/src/test/splashkit-test-generator/test_runner/config/test_runner_config.rb new file mode 100644 index 00000000..8ca97c54 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/config/test_runner_config.rb @@ -0,0 +1,31 @@ +class TestRunnerConfig + def initialize + @manual_tests = [] + @sequential_tests = [] + @skip_tests = [] + end + + def mark_as_manual(test_name) + @manual_tests << test_name + end + + def mark_as_sequential(test_name) + @sequential_tests << test_name + end + + def mark_as_skip(test_name) + @skip_tests << test_name + end + + def is_manual?(test_name) + @manual_tests.include?(test_name) + end + + def is_sequential?(test_name) + @sequential_tests.include?(test_name) + end + + def should_skip?(test_name) + @skip_tests.include?(test_name) + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/errors/test_runner_errors.rb b/coresdk/src/test/splashkit-test-generator/test_runner/errors/test_runner_errors.rb new file mode 100644 index 00000000..53b62380 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/errors/test_runner_errors.rb @@ -0,0 +1,6 @@ +module TestRunner + class TestRunnerError < StandardError; end + class ConfigurationError < TestRunnerError; end + class ExecutionError < TestRunnerError; end + class LanguageError < TestRunnerError; end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/lib.rb b/coresdk/src/test/splashkit-test-generator/test_runner/lib.rb new file mode 100644 index 00000000..4c897200 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/lib.rb @@ -0,0 +1,15 @@ +# Test runner core +require_relative 'config/test_config' +require_relative 'config/test_runner_config' +require_relative 'errors/test_runner_errors' +require_relative 'utils/prompt' +require_relative 'validators/capability_validator' +require_relative 'validators/installation_validator' + +# Test runners +require_relative 'test_runners/base_test_runner' +require_relative 'test_runners/cpp_test_runner' +require_relative 'test_runners/python_test_runner' +require_relative 'test_runners/pascal_test_runner' +require_relative 'test_runners/rust_test_runner' +require_relative 'test_runners/csharp_test_runner' diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/test_runner.rb b/coresdk/src/test/splashkit-test-generator/test_runner/test_runner.rb new file mode 100644 index 00000000..bed8810f --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/test_runner.rb @@ -0,0 +1,69 @@ +require_relative 'lib' + +# Module for executing tests across different programming languages +module TestRunner + # Executes all tests for a specified programming language + # @param language [String] The programming language to run tests for + # @raise [TestRunnerError] If there's an error during test execution + # @raise [StandardError] If there's an unexpected error + def self.run_all_tests(language) + TestConfig.setup unless TestConfig.runners + InstallationValidator.validate_language(language) + runner = TestConfig.runners[language] + MessageHandler.log_test("Starting all tests for #{language}") + runner.run_tests(find_test_groups(language)) + rescue TestRunner::TestRunnerError => e + MessageHandler.log_error("Test runner error: #{e.message}") + raise + rescue StandardError => e + MessageHandler.log_error("Unexpected error running tests for #{language}: #{e.message}") + raise + end + + # Executes a specific test within a test group + # @param language [String] The programming language to run the test in + # @param group [String] The test group containing the test + # @param test_name [String] The specific test to run + # @raise [TestRunnerError] If there's an error during test execution + # @raise [StandardError] If there's an unexpected error + def self.run_specific_test(language, group, test_name) + TestConfig.setup unless TestConfig.runners + InstallationValidator.validate_language(language) + runner = TestConfig.runners[language] + MessageHandler.log_test("Starting test #{test_name} in #{group} for #{language}") + runner.run_single_test(group, test_name) + rescue TestRunner::TestRunnerError => e + MessageHandler.log_error("Test runner error: #{e.message}") + raise + rescue StandardError => e + MessageHandler.log_error("Unexpected error running specific test #{test_name} for #{language}: #{e.message}") + raise + end + + # Executes all tests in a specific file + # @param language [String] The programming language to run the test in + # @param file_name [String] The name of the test file to run + # @raise [TestRunnerError] If there's an error during test execution + # @raise [StandardError] If there's an unexpected error + def self.run_single_file(language, file_name) + TestConfig.setup unless TestConfig.runners + InstallationValidator.validate_language(language) + runner = TestConfig.runners[language] + MessageHandler.log_test("Starting tests for #{file_name} in #{language}") + runner.run_tests([file_name]) + rescue TestRunner::TestRunnerError => e + MessageHandler.log_error("Test runner error: #{e.message}") + raise + rescue StandardError => e + MessageHandler.log_error("Unexpected error running file #{file_name} for #{language}: #{e.message}") + raise + end + + # Finds all test groups for a given language + # @param language [String] The programming language to find test groups for + # @return [Array] List of test group names + def self.find_test_groups(language) + test_files = Dir.glob("data/tests/*.*") + test_files.map { |f| File.basename(f, '.*') } + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/base_test_runner.rb b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/base_test_runner.rb new file mode 100644 index 00000000..580d9352 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/base_test_runner.rb @@ -0,0 +1,116 @@ +# Base class for language-specific test runners +class BaseTestRunner + def initialize(config) + @config = config + # Extract language name from class name (e.g., 'PascalTestRunner' -> 'pascal') + @language = self.class.name.downcase.sub('testrunner', '') + end + + # Executes test groups, handling both sequential and parallel test execution + # @param groups [Array] List of test groups to run + def run_tests(groups) + sequential_tests = [] + parallel_tests = [] + + groups.each do |group| + next if @config.should_skip?(group) + next unless CapabilityValidator.validate_group(group) + + if @config.is_sequential?(group) + sequential_tests << group + else + parallel_tests << group + end + end + + # Run sequential tests first, then parallel tests + run_sequential_tests(sequential_tests) unless sequential_tests.empty? + run_parallel_tests(parallel_tests) unless parallel_tests.empty? + end + + # Runs a specific test within a group + # @param group [String] The test group name + # @param test_name [String] The specific test to run + # @raise [RuntimeError] If the specified test cannot be found + def run_single_test(group, test_name) + test_method = get_test_method_name(test_name) + test_files = Dir.glob("generated_tests/#{@language}/tests/#{group}_tests.*") + test_file = test_files.find { |f| File.read(f).include?(test_method) } + raise "No test found for function #{test_name}" unless test_file + + MessageHandler.log_test("Running specific test: #{group}.#{test_method}") + run_specific_test(group, test_method) + end + + protected + + # Executes tests that must run sequentially + # @param groups [Array] List of sequential test groups + def run_sequential_tests(groups) + groups.each do |group| + next if @config.is_manual?(group) && !Prompt.confirm_manual_test(group) + + MessageHandler.log_test("Running sequential test: #{group}") + run_sequential_group(group) + end + end + + # Executes tests that can run in parallel + # @param groups [Array] List of parallel test groups + def run_parallel_tests(groups) + groups.each do |group| + next if @config.is_manual?(group) && !Prompt.confirm_manual_test(group) + + MessageHandler.log_test("Running parallel test: #{group}") + run_parallel_group(group) + end + end + + # Template method to be implemented by subclasses for sequential test execution + # @param group [String] The test group to run + # @raise [NotImplementedError] Must be implemented by subclasses + def run_sequential_group(group) + raise NotImplementedError + end + + # Template method to be implemented by subclasses for parallel test execution + # @param group [String] The test group to run + # @raise [NotImplementedError] Must be implemented by subclasses + def run_parallel_group(group) + raise NotImplementedError + end + + # Template method to be implemented by subclasses for specific test execution + # @param group [String] The test group containing the test + # @param test_method [String] The specific test method to run + # @raise [NotImplementedError] Must be implemented by subclasses + def run_specific_test(group, test_method) + raise NotImplementedError + end + + # Template method to be implemented by subclasses for test method name formatting + # @param test_name [String] The raw test name + # @return [String] The formatted test method name + # @raise [NotImplementedError] Must be implemented by subclasses + def get_test_method_name(test_name) + raise NotImplementedError + end + + private + + def run_in_dir(lang, command) + system("export #{lib_path} && cd generated_tests/#{lang} && #{command}") + end + + def lib_path + lib_path = LibProcessor.test_library_dir + case RbConfig::CONFIG['host_os'] + when /mswin|mingw|windows/i + "PATH=#{lib_path};#{ENV['PATH']}" + when /darwin|mac os/i + "DYLD_LIBRARY_PATH=#{lib_path}" + else # Linux + "LD_LIBRARY_PATH=#{lib_path}:#{ENV['LD_LIBRARY_PATH']}" + end + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/cpp_test_runner.rb b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/cpp_test_runner.rb new file mode 100644 index 00000000..291f6a66 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/cpp_test_runner.rb @@ -0,0 +1,40 @@ +require_relative 'base_test_runner' + +class CppTestRunner < BaseTestRunner + def run_sequential_group(group) + test_files = "test_main.cpp tests/#{group}_tests.cpp" + cmd = "#{compile_command(test_files)} -l Catch2 -o test && ./test -r console -d yes" + run_in_dir('cpp', cmd) + end + + def run_parallel_group(group) + test_files = "test_main.cpp tests/#{group}_tests.cpp" + cmd = "#{compile_command(test_files)} -l Catch2 -o test && ./test -r console -d yes" + run_in_dir('cpp', cmd) + end + + def run_specific_test(group, test_method) + test_files = "test_main.cpp tests/#{group}_tests.cpp" + cmd = "#{compile_command(test_files)} -l Catch2 -o test && ./test \"#{test_method}\" -r console -d yes" + run_in_dir('cpp', cmd) + end + + def get_test_method_name(test_name) + "test_#{test_name}_integration" + end + + private + + def compile_command(test_files) + base_cmd = "g++" + lib_dir = LibProcessor.test_library_dir + case RbConfig::CONFIG['host_os'] + when /mswin|mingw|windows/i + "#{base_cmd} #{test_files} -L#{lib_dir} -lSplashKitBackend" + when /darwin|mac os/i + "#{base_cmd} #{test_files} -L#{lib_dir} -lSplashKitBackend -rpath @loader_path" + else + "#{base_cmd} #{test_files} -L#{lib_dir} -Wl,-rpath=\\$ORIGIN -lSplashKitBackend" + end + end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/csharp_test_runner.rb b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/csharp_test_runner.rb new file mode 100644 index 00000000..ecc6dce6 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/csharp_test_runner.rb @@ -0,0 +1,22 @@ +require_relative 'base_test_runner' + +class CSharpTestRunner < BaseTestRunner + def run_sequential_group(group) + group_name = group.to_pascal_case + run_in_dir('csharp', "dotnet test --nologo --filter \"FullyQualifiedName~SplashKitTests.Test#{group_name}\" --logger \"console;verbosity=detailed\"") + end + + def run_parallel_group(group) + group_name = group.to_pascal_case + run_in_dir('csharp', "dotnet test --nologo --filter \"FullyQualifiedName~SplashKitTests.Test#{group_name}\" --logger \"console;verbosity=detailed\"") + end + + def run_specific_test(group, test_method) + group_name = group.to_pascal_case + run_in_dir('csharp', "dotnet test --nologo --filter \"FullyQualifiedName~SplashKitTests.Test#{group_name}.#{test_method}\" --logger \"console;verbosity=detailed\"") + end + + def get_test_method_name(test_name) + "Test#{test_name.to_pascal_case}Integration" + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/pascal_test_runner.rb b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/pascal_test_runner.rb new file mode 100644 index 00000000..e8f7e03f --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/pascal_test_runner.rb @@ -0,0 +1,40 @@ +require_relative 'base_test_runner' + +class PascalTestRunner < BaseTestRunner + def run_sequential_group(group) + group_name = group.to_pascal_case + run_in_dir('pascal', "#{compile_command(group_name)} && ./test_main --group=#{group_name}") + end + + def run_parallel_group(group) + group_name = group.to_pascal_case + output_name = "test_main_#{Process.pid}" + run_in_dir('pascal', "#{compile_command(group_name, output_name)} && ./#{output_name} --group=#{group_name}") + end + + def run_specific_test(group, test_method) + group_name = group.to_pascal_case + run_in_dir('pascal', "#{compile_command(group_name)} && ./test_main --group=#{group_name} --test=#{test_method}") + end + + private + + def get_test_method_name(test_name) + "Test#{test_name.to_pascal_case}Integration" + end + + def compile_command(group_name, output_name = 'test_main') + lib_dir = LibProcessor.test_library_dir + base_cmd = case RbConfig::CONFIG['host_os'] + when /mswin|mingw|windows/i + "fpc -S2 -Sh -Cg -dTEST_#{group_name.upcase} -Fu'.' -Fu'tests' -k\"-L#{lib_dir}\" -k\"-lSplashKitBackend.dll\"" + when /darwin|mac os/i + "ppcx64 -Tdarwin -S2 -Sh -XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -WM10.11 -Cg -dTEST_#{group_name.upcase} -Fu'.' -Fu'tests' " \ + "-k\"-L#{lib_dir}\" -k\"-lSplashKitBackend\" -k\"-rpath @loader_path -rpath #{lib_dir}\"" + else # Linux + "ppcx64 -S2 -Sh -Cg -dTEST_#{group_name.upcase} -Fu'.' -Fu'tests' -k\"-L#{lib_dir}\" -k\"-lSplashKitBackend\" " \ + "-k\"-rpath=\\$ORIGIN -rpath='#{lib_dir}'\"" + end + "#{base_cmd} test_main.pas -o#{output_name}" + end +end \ No newline at end of file diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/python_test_runner.rb b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/python_test_runner.rb new file mode 100644 index 00000000..2a84919a --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/python_test_runner.rb @@ -0,0 +1,19 @@ +require_relative 'base_test_runner' + +class PythonTestRunner < BaseTestRunner + def run_sequential_group(group) + run_in_dir('python', "python3 -s -m pytest tests/#{group}_tests.py -vv -l --tb=long --capture=no -p no:parallel") + end + + def run_parallel_group(group) + run_in_dir('python', "python3 -s -m pytest tests/#{group}_tests.py -vv -l --tb=long --capture=no") + end + + def run_specific_test(group, test_method) + run_in_dir('python', "python3 -s -m pytest tests/#{group}_tests.py::Test#{group.to_pascal_case}::#{test_method} -vv -l --tb=long --capture=no") + end + + def get_test_method_name(test_name) + "test_#{test_name}_integration" + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/rust_test_runner.rb b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/rust_test_runner.rb new file mode 100644 index 00000000..41872f43 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/test_runners/rust_test_runner.rb @@ -0,0 +1,19 @@ +require_relative 'base_test_runner' + +class RustTestRunner < BaseTestRunner + def run_sequential_group(group) + run_in_dir('rust', "cargo test --test #{group}_tests -- --test-threads=1 --nocapture") + end + + def run_parallel_group(group) + run_in_dir('rust', "cargo test --test #{group}_tests") + end + + def run_specific_test(group, test_class, test_method) + run_in_dir('rust', "cargo test --test #{group}_tests #{test_class}::#{test_method} -- --test-threads=1 --nocapture") + end + + def get_test_method_name(test_name) + "test_#{test_name}_integration" + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/utils/prompt.rb b/coresdk/src/test/splashkit-test-generator/test_runner/utils/prompt.rb new file mode 100644 index 00000000..5673d210 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/utils/prompt.rb @@ -0,0 +1,9 @@ +# Prompts user for confirmation before running interactive tests +class Prompt + def self.confirm_manual_test(group) + print "\nWarning: '#{group}' requires manual interaction. Continue (y), skip (n)? (y/n): " + confirmed = gets.chomp.downcase == 'y' + puts "\nSkipping '#{group}'" unless confirmed + confirmed + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/validators/capability_validator.rb b/coresdk/src/test/splashkit-test-generator/test_runner/validators/capability_validator.rb new file mode 100644 index 00000000..8e4cb432 --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/validators/capability_validator.rb @@ -0,0 +1,27 @@ +# Validates hardware capabilities +class CapabilityValidator + def self.validate_group(group) + return true unless %w[raspberry].include?(group) + + unless raspberry_pi? + puts "\nSkipping 'raspberry' - Raspberry Pi capability not detected" + return false + end + true + end + + def self.raspberry_pi? + # Method 1: Check for Raspberry Pi specific file + if File.exist?('/proc/device-tree/model') + device_model = File.read('/proc/device-tree/model') + return true if device_model.include?('Raspberry Pi') + end + # Method 2: Check for ARM architecture and Broadcom chip + if %w[arm aarch64].include?(RbConfig::CONFIG['target_cpu']) && + File.exist?('/proc/cpuinfo') && File.read('/proc/cpuinfo') =~ /BCM\d+/ + return true + end + + false + end +end diff --git a/coresdk/src/test/splashkit-test-generator/test_runner/validators/installation_validator.rb b/coresdk/src/test/splashkit-test-generator/test_runner/validators/installation_validator.rb new file mode 100644 index 00000000..e2f3821d --- /dev/null +++ b/coresdk/src/test/splashkit-test-generator/test_runner/validators/installation_validator.rb @@ -0,0 +1,181 @@ +module TestRunner + # Validates that required development tools are installed for each supported language + class InstallationValidator + def self.validate_language(language) + validator_class = VALIDATORS[language] or + raise TestRunner::LanguageError, "Unsupported language: #{language}" + validator_class.new.validate + end + end + + # Base validator class that provides common validation functionality for all language validators + class BaseValidator + INSTALLATION_INSTRUCTIONS = { + 'cargo' => 'Install Rust from https://rustup.rs', + 'rustc' => 'Install Rust from https://rustup.rs', + 'python3' => 'Download Python from https://www.python.org/downloads', + 'pytest' => 'Install pytest using: pip install pytest', + 'fpc' => 'Install Free Pascal:\n' \ + 'If you get "cannot execute: required file not found" with test_main,\n' \ + 'this is likely a loader issue. Try a different version of fpc:\n' \ + '1. Remove current fpc: sudo apt remove fpc\n' \ + '2. Download from https://sourceforge.net/projects/freepascal/\n' \ + '3. Or try an older/newer version from your package manager', + 'g++' => 'Install g++ using your system package manager (sudo apt install g++, brew install gcc, etc.)', + 'dotnet' => 'Install .NET SDK from https://dotnet.microsoft.com/download', + 'catch2' => 'Install Catch2 using your package manager (sudo apt install catch2, brew install catch2)', + 'dunit' => 'Install FPCUnit using:\n' \ + ' sudo apt install fp-units-fcl fp-units-base' + }.freeze + + def validate + missing = required_tools.reject { |cmd| command_exists?(cmd) } + unless missing.empty? + instructions = missing.map do |tool| + "\n- #{tool}: #{INSTALLATION_INSTRUCTIONS[tool] || 'No installation instructions available'}" + end + raise TestRunner::ConfigurationError, "Missing required tools: #{instructions.join}" + end + + true + end + + private + + def command_exists?(cmd) + case platform + when :windows + system("where #{cmd} > NUL 2>&1") + when :wsl, :unix + system("which #{cmd} > /dev/null 2>&1") + end + end + + def platform + @platform ||= detect_platform + end + + def detect_platform + return :windows if RUBY_PLATFORM =~ /mswin|mingw|cygwin/ + return :wsl if wsl? + + :unix + end + + def wsl? + @wsl ||= system('uname -r | grep -q "WSL"') + end + + def required_tools + raise NotImplementedError + end + end + + # Validates installation requirements for Rust development tools + class RustValidator < BaseValidator + private + + def required_tools + %w[cargo rustc] + end + end + + # Validates installation requirements for Python development tools + class PythonValidator < BaseValidator + private + + def required_tools + %w[python3 pytest] + end + end + + # Validates installation requirements for Pascal development tools + class PascalValidator < BaseValidator + def validate + super + check_fpcunit + end + + private + + def required_tools + %w[fpc] + end + + def check_fpcunit + fpcunit_paths = [ + # Linux paths + '/usr/lib/fpc/*/units/*/fcl-fpcunit/fpcunit.ppu', + '/usr/lib/fpc/3.2.2/units/x86_64-linux/fcl-fpcunit/fpcunit.ppu', + '/usr/share/fpcsrc/*/packages/fcl-fpcunit/src/fpcunit.pp', + '/usr/lib/fpc/*/units/*/fcl-base/fpcunit.ppu', + '/usr/share/fpcsrc/*/fcl-fpcunit/src/fpcunit.pp', + '/usr/share/fpcsrc/*/packages/fcl-base/src/fpcunit.pp', + '/usr/lib/fpc/*/units/*/rtl/fpcunit.ppu', + # macOS paths + '/usr/local/lib/fpc/*/units/*/fcl-fpcunit/fpcunit.ppu', + '/usr/local/share/fpcsrc/*/packages/fcl-fpcunit/src/fpcunit.pp', + '/opt/homebrew/lib/fpc/*/units/*/fcl-fpcunit/fpcunit.ppu', + '/opt/homebrew/share/fpcsrc/*/packages/fcl-fpcunit/src/fpcunit.pp' + ] + + found = Dir.glob(fpcunit_paths).any? + unless found + raise TestRunner::ConfigurationError, + "FPCUnit not found. Try these steps:\n\n" \ + "1. On Linux:\n" \ + " sudo apt install fp-units-fcl fp-units-base\n\n" \ + " If the error persists:\n" \ + " sudo apt install fpc-source\n" \ + " sudo apt install fp-units-rtl\n\n" \ + "2. On macOS:\n" \ + " brew install fpc\n" \ + " brew install fpc-units-fcl fpc-units-base" + end + end + end + + # Validates installation requirements for C++ development tools + class CppValidator < BaseValidator + def validate + super + check_catch2_headers + end + + private + + def required_tools + %w[g++] + end + + def check_catch2_headers + catch2_paths = [ + '/usr/include/catch2/catch_all.hpp', + '/usr/local/include/catch2/catch_all.hpp' + ] + + return if catch2_paths.any? { |path| File.exist?(path) } + + raise TestRunner::ConfigurationError, + 'Catch2 headers not found. Install using: sudo apt install catch2' + end + end + + # Validates installation requirements for C# development tools + class CSharpValidator < BaseValidator + private + + def required_tools + %w[dotnet] + end + end + + # Move VALIDATORS to the end of the file, after all classes are defined + InstallationValidator::VALIDATORS = { + rust: RustValidator, + python: PythonValidator, + pascal: PascalValidator, + cpp: CppValidator, + csharp: CSharpValidator + }.freeze +end