Permalink
Browse files

Line width select unit tests

  • Loading branch information...
feragon committed Aug 12, 2016
1 parent 8046a30 commit d98d9aa8b3aa4015b37170fae62218a490b142e9
Showing with 25 additions and 1 deletion.
  1. +2 −1 unittest/CMakeLists.txt
  2. +23 −0 unittest/ui/testlinewidthselect.cpp
View
@@ -71,7 +71,8 @@ if(WITH_QTUI)
ui/testlayers.cpp
ui/testlinepatterns.cpp
ui/testcommandline.cpp
ui/testcolorselect.cpp)
ui/testcolorselect.cpp
ui/testlinewidthselect.cpp)
include_directories("${CMAKE_SOURCE_DIR}/lcUI")
include_directories("${PROJECT_BINARY_DIR}/../lcUI") #Include ui_* files
@@ -0,0 +1,23 @@
#include <gtest/gtest.h>
#include "uitests.h"
#include <widgets/linewidthselect.h>
TEST(LineWidthSelectTest, Selection) {
QApplication app(argc, argv);
LineWidthSelect lineWidthSelect(0, false, false);
LineWidthSelect lineWidthSelect_ByBlock_ByLayer(0, true, true);
/*
* Test number of entries
*/
EXPECT_NE(0, lineWidthSelect.count()) << "Line width select doesn't contain any element";
EXPECT_EQ(lineWidthSelect.count() + 2, lineWidthSelect_ByBlock_ByLayer.count()) << "Line width select doesn't contain ByLayer or ByLayer";
/*
* Test custom width
*/
auto width = 0.13;
lineWidthSelect.setWidth(width);
EXPECT_EQ(width, lineWidthSelect.lineWidth()->width());
}

0 comments on commit d98d9aa

Please sign in to comment.