summaryrefslogtreecommitdiff
path: root/tests
diff options
authorBrandon Schaefer <brandontschaefer@gmail.com>2012-07-10 16:28:01 -0700
committerBrandon Schaefer <brandontschaefer@gmail.com>2012-07-10 16:28:01 -0700
commitc93e5edb814a864400f45b2baf0f6e47f309c508 (patch)
tree84db095f5dded6cc2ce832015d42d39cb14611fe /tests
parent064be635cfb2e187d4c14ffe1ccacafc2cd226c5 (diff)
* Adds a gtest
(bzr r2487.2.2)
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/data/no-icon.desktop7
-rw-r--r--tests/test_bamflaunchericon.cpp13
3 files changed, 22 insertions, 0 deletions
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<launcher::BamfLauncherIcon> default_icon;
+ default_icon = new launcher::BamfLauncherIcon(bamf_app_d);
+
+ EXPECT_EQ(default_icon->icon_name.Get(), "application-default-icon");
+}
}