KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_schematic_clipboard_export.cpp File Reference

Tests for multi-format clipboard export functionality for schematic editor. More...

#include <boost/test/unit_test.hpp>
#include <sch_symbol.h>
#include <sch_line.h>
#include <sch_junction.h>
#include <sch_bus_entry.h>
#include <sch_no_connect.h>
#include <sch_text.h>
#include <sch_label.h>
#include <sch_shape.h>
#include <sch_sheet.h>
#include <lib_symbol.h>
#include <plotters/plotters_pslike.h>
#include <sch_painter.h>
#include <sch_plotter.h>
#include <locale_io.h>
#include <settings/color_settings.h>
#include <wx/ffile.h>
#include <wx/mstream.h>

Go to the source code of this file.

Classes

class  SCHEMATIC_CLIPBOARD_FIXTURE
 

Functions

 BOOST_AUTO_TEST_CASE (ElementCreation_Wires)
 Test that wires can be created for export testing.
 
 BOOST_AUTO_TEST_CASE (ElementCreation_Buses)
 Test that buses can be created for export testing.
 
 BOOST_AUTO_TEST_CASE (ElementCreation_Junctions)
 Test that junctions can be created for export testing.
 
 BOOST_AUTO_TEST_CASE (ElementCreation_NoConnect)
 Test that no-connect markers can be created for export testing.
 
 BOOST_AUTO_TEST_CASE (ElementCreation_BusEntry)
 Test that bus entries can be created for export testing.
 
 BOOST_AUTO_TEST_CASE (ElementCreation_Text)
 Test that text items can be created for export testing.
 
 BOOST_AUTO_TEST_CASE (ElementCreation_Labels)
 Test that labels can be created for export testing.
 
 BOOST_AUTO_TEST_CASE (ElementCreation_Shapes)
 Test that shapes can be created for export testing.
 
 BOOST_AUTO_TEST_CASE (Wire_Endpoints)
 Test wire endpoint calculation.
 
 BOOST_AUTO_TEST_CASE (MixedElements_Positions)
 Test mixed element positions.
 
 BOOST_AUTO_TEST_CASE (Rectangle_Dimensions)
 Test rectangle dimensions.
 
 BOOST_AUTO_TEST_CASE (Circle_Creation)
 Test circle creation.
 
 BOOST_AUTO_TEST_CASE (PngExport_AlphaComputation_Opaque)
 Test PNG alpha computation formula used in schematic export.
 
 BOOST_AUTO_TEST_CASE (PngExport_AlphaComputation_Transparent)
 Test PNG alpha computation for transparent pixel.
 
 BOOST_AUTO_TEST_CASE (ComplexSchematic_MultipleLayers)
 Test that a complex schematic selection can be created.
 

Detailed Description

Tests for multi-format clipboard export functionality for schematic editor.

These tests verify:

  1. SVG export produces valid output for schematic items
  2. Various schematic element types can be created for export testing
  3. Bounding box calculation for different element types

Definition in file test_schematic_clipboard_export.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/15]

BOOST_AUTO_TEST_CASE ( Circle_Creation )

Test circle creation.

Definition at line 341 of file test_schematic_clipboard_export.cpp.

References BOOST_CHECK_EQUAL(), circle(), radius, and schIUScale.

◆ BOOST_AUTO_TEST_CASE() [2/15]

BOOST_AUTO_TEST_CASE ( ComplexSchematic_MultipleLayers )

Test that a complex schematic selection can be created.

Definition at line 394 of file test_schematic_clipboard_export.cpp.

References BOOST_CHECK_EQUAL(), RECTANGLE, SCH_BUS_WIRE_ENTRY_T, SCH_GLOBAL_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_TEXT_T, and text.

◆ BOOST_AUTO_TEST_CASE() [3/15]

BOOST_AUTO_TEST_CASE ( ElementCreation_BusEntry )

Test that bus entries can be created for export testing.

Definition at line 232 of file test_schematic_clipboard_export.cpp.

References SCH_BUS_WIRE_ENTRY_T.

◆ BOOST_AUTO_TEST_CASE() [4/15]

BOOST_AUTO_TEST_CASE ( ElementCreation_Buses )

Test that buses can be created for export testing.

Definition at line 195 of file test_schematic_clipboard_export.cpp.

◆ BOOST_AUTO_TEST_CASE() [5/15]

BOOST_AUTO_TEST_CASE ( ElementCreation_Junctions )

Test that junctions can be created for export testing.

Definition at line 207 of file test_schematic_clipboard_export.cpp.

References BOOST_CHECK_EQUAL(), and schIUScale.

◆ BOOST_AUTO_TEST_CASE() [6/15]

BOOST_AUTO_TEST_CASE ( ElementCreation_Labels )

Test that labels can be created for export testing.

Definition at line 256 of file test_schematic_clipboard_export.cpp.

References SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, and SCH_LABEL_T.

◆ BOOST_AUTO_TEST_CASE() [7/15]

BOOST_AUTO_TEST_CASE ( ElementCreation_NoConnect )

Test that no-connect markers can be created for export testing.

Definition at line 220 of file test_schematic_clipboard_export.cpp.

References SCH_NO_CONNECT_T.

◆ BOOST_AUTO_TEST_CASE() [8/15]

BOOST_AUTO_TEST_CASE ( ElementCreation_Shapes )

Test that shapes can be created for export testing.

Definition at line 275 of file test_schematic_clipboard_export.cpp.

References CIRCLE, circle(), POLY, and RECTANGLE.

◆ BOOST_AUTO_TEST_CASE() [9/15]

BOOST_AUTO_TEST_CASE ( ElementCreation_Text )

Test that text items can be created for export testing.

Definition at line 244 of file test_schematic_clipboard_export.cpp.

References text.

◆ BOOST_AUTO_TEST_CASE() [10/15]

BOOST_AUTO_TEST_CASE ( ElementCreation_Wires )

Test that wires can be created for export testing.

Definition at line 181 of file test_schematic_clipboard_export.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), and schIUScale.

◆ BOOST_AUTO_TEST_CASE() [11/15]

BOOST_AUTO_TEST_CASE ( MixedElements_Positions )

Test mixed element positions.

Definition at line 310 of file test_schematic_clipboard_export.cpp.

References BOOST_CHECK_EQUAL(), schIUScale, and text.

◆ BOOST_AUTO_TEST_CASE() [12/15]

BOOST_AUTO_TEST_CASE ( PngExport_AlphaComputation_Opaque )

Test PNG alpha computation formula used in schematic export.

Definition at line 356 of file test_schematic_clipboard_export.cpp.

References BOOST_CHECK_EQUAL().

◆ BOOST_AUTO_TEST_CASE() [13/15]

BOOST_AUTO_TEST_CASE ( PngExport_AlphaComputation_Transparent )

Test PNG alpha computation for transparent pixel.

Definition at line 375 of file test_schematic_clipboard_export.cpp.

References BOOST_CHECK_EQUAL().

◆ BOOST_AUTO_TEST_CASE() [14/15]

BOOST_AUTO_TEST_CASE ( Rectangle_Dimensions )

Test rectangle dimensions.

Definition at line 326 of file test_schematic_clipboard_export.cpp.

References BOOST_CHECK_EQUAL(), and schIUScale.

◆ BOOST_AUTO_TEST_CASE() [15/15]

BOOST_AUTO_TEST_CASE ( Wire_Endpoints )

Test wire endpoint calculation.

Definition at line 294 of file test_schematic_clipboard_export.cpp.

References BOOST_CHECK_EQUAL(), and schIUScale.