KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_database.cpp File Reference
#include <filesystem>
#include <random>
#include <fmt/format.h>
#include <boost/test/unit_test.hpp>
#include <nanodbc/nanodbc.h>
#include <database/database_connection.h>

Go to the source code of this file.

Classes

struct  SCRATCH_DATABASE
 A throwaway SQLite database whose tables are created by the test. More...
 

Functions

 BOOST_AUTO_TEST_CASE (Connect)
 
 BOOST_AUTO_TEST_CASE (GeneratedColumns)
 Test that generated columns in SQLite are properly handled.
 
 BOOST_AUTO_TEST_CASE (QuoteCharactersInIdentifiers)
 
 BOOST_AUTO_TEST_CASE (PatternCharactersInTableNames)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/4]

◆ BOOST_AUTO_TEST_CASE() [2/4]

BOOST_AUTO_TEST_CASE ( GeneratedColumns )

Test that generated columns in SQLite are properly handled.

SQLite ODBC drivers use PRAGMA table_info to implement SQLColumns, which doesn't return generated columns. This test verifies that KiCad can still query tables with generated columns by trusting user-configured column names.

See https://gitlab.com/kicad/code/kicad/-/issues/16952

Definition at line 88 of file test_database.cpp.

References BOOST_CHECK_EQUAL(), DATABASE_CONNECTION::CacheTableInfo(), DATABASE_CONNECTION::IsConnected(), result, and DATABASE_CONNECTION::SelectOne().

◆ BOOST_AUTO_TEST_CASE() [3/4]

◆ BOOST_AUTO_TEST_CASE() [4/4]