From c93e5edb814a864400f45b2baf0f6e47f309c508 Mon Sep 17 00:00:00 2001 From: Brandon Schaefer Date: Tue, 10 Jul 2012 16:28:01 -0700 Subject: * Adds a gtest (bzr r2487.2.2) --- tests/CMakeLists.txt | 2 ++ tests/data/no-icon.desktop | 7 +++++++ tests/test_bamflaunchericon.cpp | 13 +++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 tests/data/no-icon.desktop (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0cea996e3..347f99312 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,6 +11,8 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/update-manager.desktop ${CMAKE_BINARY_DIR}/tests/data/update-manager.desktop) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/bzr-handle-patch.desktop ${CMAKE_BINARY_DIR}/tests/data/bzr-handle-patch.desktop) +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/no-icon.desktop + ${CMAKE_BINARY_DIR}/tests/data/no-icon.desktop) # # Unit tests # diff --git a/tests/data/no-icon.desktop b/tests/data/no-icon.desktop new file mode 100644 index 000000000..4f2902fe2 --- /dev/null +++ b/tests/data/no-icon.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Default +Comment=Interactive viewer for a Default icon! +Exec=gedit +Terminal=false +Type=Application +Categories=GTK;Science;Graphics; diff --git a/tests/test_bamflaunchericon.cpp b/tests/test_bamflaunchericon.cpp index 9719e9a5f..f896ac6c4 100644 --- a/tests/test_bamflaunchericon.cpp +++ b/tests/test_bamflaunchericon.cpp @@ -62,4 +62,17 @@ TEST_F(TestBamfLauncherIcon, TestCustomBackgroundColor) EXPECT_EQ(color.alpha, 0xff / 255.0f); } +TEST_F(TestBamfLauncherIcon, TestDefaultIcon) +{ + BamfApplication* bamf_app_d; + bamf_app_d = bamf_matcher_get_application_for_desktop_file(bamf_matcher, + BUILDDIR"/tests/data/no-icon.desktop", + TRUE); + + + nux::ObjectPtr default_icon; + default_icon = new launcher::BamfLauncherIcon(bamf_app_d); + + EXPECT_EQ(default_icon->icon_name.Get(), "application-default-icon"); +} } -- cgit v1.2.3