diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-05-24 16:50:58 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-05-24 16:50:58 -0500 |
commit | d8484ce5caf9fd5f4efb30368ccc9b70b1f38710 (patch) | |
tree | f4e80aaafadfc65baefda38972080359fd59a5c7 /tests/test-indicator.cc | |
parent | caae4241b85412d6914d6fd1e0a9bac9da35c6f3 (diff) | |
download | ayatana-indicator-power-d8484ce5caf9fd5f4efb30368ccc9b70b1f38710.tar.gz ayatana-indicator-power-d8484ce5caf9fd5f4efb30368ccc9b70b1f38710.tar.bz2 ayatana-indicator-power-d8484ce5caf9fd5f4efb30368ccc9b70b1f38710.zip |
first draft of getting GSettings working in the unit tests before the schema is installed.
Diffstat (limited to 'tests/test-indicator.cc')
-rw-r--r-- | tests/test-indicator.cc | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/tests/test-indicator.cc b/tests/test-indicator.cc index e3533e9..af494ee 100644 --- a/tests/test-indicator.cc +++ b/tests/test-indicator.cc @@ -22,6 +22,10 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "device.h" #include "indicator-power.h" +/*** +**** +***/ + namespace { void ensure_glib_initialized () @@ -40,7 +44,27 @@ namespace **** ***/ -TEST(IndicatorTest, GObjectNew) +class IndicatorTest : public ::testing::Test +{ + protected: + + virtual void SetUp() + { + ensure_glib_initialized (); + g_setenv( "GSETTINGS_SCHEMA_DIR", SCHEMA_DIR, TRUE); + g_message ("GSETTINGS_SCHEMA_DIR is %s", g_getenv("GSETTINGS_SCHEMA_DIR")); + } + + virtual void TearDown() + { + } +}; + +/*** +**** +***/ + +TEST_F(IndicatorTest, GObjectNew) { ensure_glib_initialized (); @@ -49,4 +73,3 @@ TEST(IndicatorTest, GObjectNew) ASSERT_TRUE (IS_INDICATOR_POWER(o)); g_object_unref (o); } - |