aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/test-settings.cpp22
2 files changed, 13 insertions, 13 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 26b326d..958e1cc 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -21,8 +21,8 @@ execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compil
OUTPUT_VARIABLE COMPILE_SCHEMA_EXECUTABLE
OUTPUT_STRIP_TRAILING_WHITESPACE)
add_custom_command (OUTPUT gschemas.compiled
- DEPENDS ${CMAKE_SOURCE_DIR}/data/com.canonical.indicator.datetime.gschema.xml
- COMMAND cp -f ${CMAKE_SOURCE_DIR}/data/*gschema.xml ${SCHEMA_DIR}
+ DEPENDS ${CMAKE_BINARY_DIR}/data/com.canonical.indicator.datetime.gschema.xml
+ COMMAND cp -f ${CMAKE_BINARY_DIR}/data/*gschema.xml ${SCHEMA_DIR}
COMMAND ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR})
# look for headers in our src dir, and also in the directories where we autogenerate files...
diff --git a/tests/test-settings.cpp b/tests/test-settings.cpp
index e4aeef7..44a0252 100644
--- a/tests/test-settings.cpp
+++ b/tests/test-settings.cpp
@@ -101,26 +101,26 @@ protected:
g_clear_pointer(&tmp, g_free);
}
- void TestIntProperty(core::Property<int>& property, const gchar* key)
+ void TestUIntProperty(core::Property<unsigned int>& property, const gchar* key)
{
- EXPECT_EQ(g_settings_get_int(m_gsettings, key), property.get());
+ EXPECT_EQ(g_settings_get_uint(m_gsettings, key), property.get());
- int expected_values[] = { 1, 2, 3 };
+ unsigned int expected_values[] = { 1, 2, 3 };
// modify GSettings and confirm that the new value is propagated
- for(const int& expected_value : expected_values)
+ for(const auto& expected_value : expected_values)
{
- g_settings_set_int(m_gsettings, key, expected_value);
+ g_settings_set_uint(m_gsettings, key, expected_value);
EXPECT_EQ(expected_value, property.get());
- EXPECT_EQ(expected_value, g_settings_get_int(m_gsettings, key));
+ EXPECT_EQ(expected_value, g_settings_get_uint(m_gsettings, key));
}
// modify the property and confirm that the new value is propagated
- for(const int& expected_value : expected_values)
+ for(const auto& expected_value : expected_values)
{
property.set(expected_value);
EXPECT_EQ(expected_value, property.get());
- EXPECT_EQ(expected_value, g_settings_get_int(m_gsettings, key));
+ EXPECT_EQ(expected_value, g_settings_get_uint(m_gsettings, key));
}
}
};
@@ -148,10 +148,10 @@ TEST_F(SettingsFixture, BoolProperties)
TestBoolProperty(m_settings->show_year, SETTINGS_SHOW_YEAR_S);
}
-TEST_F(SettingsFixture, IntProperties)
+TEST_F(SettingsFixture, UIntProperties)
{
- TestIntProperty(m_settings->alarm_duration, SETTINGS_ALARM_DURATION_S);
- TestIntProperty(m_settings->alarm_volume, SETTINGS_ALARM_VOLUME_S);
+ TestUIntProperty(m_settings->alarm_duration, SETTINGS_ALARM_DURATION_S);
+ TestUIntProperty(m_settings->alarm_volume, SETTINGS_ALARM_VOLUME_S);
}
TEST_F(SettingsFixture, StringProperties)