diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-06-11 12:35:58 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-06-11 12:35:58 +0000 |
commit | 705c343c1eb2283fe6de82127347146c2a66b818 (patch) | |
tree | 815b73d07410af48e294b08babab2cf817415251 /tests/test-timezone-file.cpp | |
parent | 4008e0a91ebdc1cf5c5715a122fed318124c8802 (diff) | |
parent | 2b112ebfadb6b6d19553722eca91b797ad60f303 (diff) | |
download | ayatana-indicator-datetime-705c343c1eb2283fe6de82127347146c2a66b818.tar.gz ayatana-indicator-datetime-705c343c1eb2283fe6de82127347146c2a66b818.tar.bz2 ayatana-indicator-datetime-705c343c1eb2283fe6de82127347146c2a66b818.zip |
when src/timezone-file.c reads the contents of a file, skip lines that begin with '#' Fixes: 1312775
Diffstat (limited to 'tests/test-timezone-file.cpp')
-rw-r--r-- | tests/test-timezone-file.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test-timezone-file.cpp b/tests/test-timezone-file.cpp index 453b353..aec597c 100644 --- a/tests/test-timezone-file.cpp +++ b/tests/test-timezone-file.cpp @@ -131,3 +131,16 @@ TEST_F(TimezoneFixture, ChangedValue) ASSERT_TRUE(changed); ASSERT_EQ(changed_timezone, tz.timezone.get()); } + + +/** + * Test that timezone-file picks up the initial value + */ +TEST_F(TimezoneFixture, IgnoreComments) +{ + const std::string comment = "# Created by cloud-init v. 0.7.5 on Thu, 24 Apr 2014 14:03:29 +0000"; + const std::string expected_timezone = "Europe/Berlin"; + set_file(comment + "\n" + expected_timezone); + FileTimezone tz(TIMEZONE_FILE); + ASSERT_EQ(expected_timezone, tz.timezone.get()); +} |