mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-23 18:29:58 +01:00
Add Test files
This commit is contained in:
33
tests/catch/src/borderproperties_test.cpp
Normal file
33
tests/catch/src/borderproperties_test.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "../../../sources/borderproperties.h"
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
TEST_CASE("BorderProperties")
|
||||
{
|
||||
BorderProperties My;
|
||||
CHECK(My.columns_count == 17);
|
||||
CHECK(My.columns_width == 60.0);
|
||||
CHECK(My.columns_header_height == 20.0);
|
||||
CHECK(My.display_columns == true);
|
||||
CHECK(My.rows_count == 8);
|
||||
CHECK(My.rows_height == 80.0);
|
||||
CHECK(My.rows_header_width == 20.0);
|
||||
CHECK(My.display_rows == true);
|
||||
|
||||
BorderProperties My2;
|
||||
|
||||
CHECK((My2 == My) == true);
|
||||
|
||||
My2 = My.defaultProperties();
|
||||
|
||||
CHECK((My2 == My) == true);
|
||||
|
||||
CHECK(My2.columns_count == 17);
|
||||
CHECK(My2.columns_width == 60.0);
|
||||
CHECK(My2.columns_header_height == 20.0);
|
||||
CHECK(My2.display_columns == true);
|
||||
CHECK(My2.rows_count == 8);
|
||||
CHECK(My2.rows_height == 80.0);
|
||||
CHECK(My2.rows_header_width == 20.0);
|
||||
CHECK(My2.display_rows == true);
|
||||
}
|
||||
15
tests/catch/src/qet_test.cpp
Normal file
15
tests/catch/src/qet_test.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "../../../sources/qet.h"
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
TEST_CASE("qet stringToFileName")
|
||||
{
|
||||
CHECK(QET::stringToFileName("test") == QString("test"));
|
||||
CHECK(QET::stringToFileName("t_est") == QString("t_est"));
|
||||
CHECK(QET::stringToFileName("t-est") == QString("t-est"));
|
||||
CHECK(QET::stringToFileName("te.st") == QString("te.st"));
|
||||
|
||||
CHECK(QET::stringToFileName("tesMt") != QString("tesMt"));
|
||||
CHECK(QET::stringToFileName("te<st") != QString("te<st"));
|
||||
CHECK(QET::stringToFileName("té<st") != QString("té<st"));
|
||||
}
|
||||
Reference in New Issue
Block a user