summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* gvdb test: avoid infinite recursionRyan Lortie2014-02-211-4/+8
| | | | | | | | | | | | | | | | /gvdb/reader/corrupted/7% was failing when run with random seed R02S2a7b9704dbb5ea704b0d724329af0fbf. This is a fuzz test, and it turns out that this particular seed ended up producing a file that was valid, but contained a self-referential table. The testcase happily recursed though this table's subtable (itself) and so on, until it ran out of stack space, causing a crash. This bug would not impact realworld users of gvdb: these users only ever recurse through tables a finite number of times. For dconf, subtables are not used at all. For GSettings, each schema is a subtable, but from within that subtable we only lookup values.
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* tests: test the new file-db engine sourceRyan Lortie2014-01-131-1/+58
|
* portability: only link to -ldl if neededRyan Lortie2013-12-081-2/+3
| | | | | | | | | | We use -ldl in some of our testcases to mock out some system calls via interposing, using dlsym() to chain up. Make sure we only use this if we really need to. Many systems have dlsym() in the C library and no -ldl. https://bugzilla.gnome.org/show_bug.cgi?id=720072
* tests: add testcase for dconf_engine_sync()Ryan Lortie2013-11-281-0/+103
|
* tests: test engine processing of signalsRyan Lortie2013-11-271-0/+112
| | | | | | | | Add a testcase to exercise the engine's processing of signals, including its ability to reject bad data. This testcase already found several issues with the engine which have already been fixed in previous commits.
* engine: add support for WritabilityNotifyRyan Lortie2013-11-261-0/+1
| | | | | Wire through WritabilityNotify signals from the engine. This has been unimplemented for a very long time...
* tests: stop setting environment variablesRyan Lortie2013-11-261-16/+5
| | | | | | Stop setting the DCONF_PROFILE environment variable while threads are running. Leave only one case where we set it explicitly to check that the variable itself is working correctly.
* engine: add 'profile' argument to constructorRyan Lortie2013-11-261-6/+6
| | | | | | | Allow specifying a profile when calling dconf_engine_new(). This will allow us to avoid setting/unsetting the DCONF_PROFILE environment in testcases from contexts where other threads may be reading from the environment.
* tests: add more engine testsRyan Lortie2013-11-251-5/+176
| | | | And fix some leaks in an existing test.
* tests: always use expected_type from mock dbusRyan Lortie2013-11-251-2/+11
| | | | | | | Always call dconf_engine_call_handle_get_expected_type() from the mock dbus backend, even if the handle is NULL. This matches the behaviour of the real D-Bus backends and would have caught the bug fixed in the last commit.
* tests: fix ridiculous typoRyan Lortie2013-11-253-6/+6
|
* tests: fix a small lieRyan Lortie2013-11-251-2/+2
| | | | | | | | N_MAX_SOURCES is 3 but we only check up to < N_MAX_SOURCES, so we only ever checked 2. The tests work with 3, but it takes very very long to run them, so fix the comparison but at the same time, decrease the count.
* tests: add test for engine change_syncRyan Lortie2013-11-251-0/+97
|
* engine: issue warnings once per sourceRyan Lortie2013-11-251-9/+38
| | | | | | | | | | | | | | | | | On failure to open a gvdb file in /etc/dconf/db we would issue a warning once per process -- even if multiple files were missing. This was enforced using a static variable. An unfortunate side effect of this global state is that the testcases couldn't reliably know if to expect the error or not. This issue was side-stepped by running any cases that may emit the warning under a fork, but that made it difficult to debug some of the cases. Rework the backends not to use global state for the flag and instead store it per-source. Remove a use of g_test_trap_fork().
* tests: test read-through functionalityRyan Lortie2013-11-251-4/+163
| | | | | Make sure the read_through parameter to _read() and _read_user_value() is behaving as we expect it to.
* dbus mock: add some better APIRyan Lortie2013-11-253-12/+37
| | | | | | | Add API for replying to async calls in the mock dbus backend and for checking that there are no calls outstanding. Use it from the engine test.
* tests: more engine coverage improvementsRyan Lortie2013-11-251-0/+3
|
* tests: test dconf_engine_read_user_value()Ryan Lortie2013-11-251-1/+27
| | | | Make sure it's returning the value only in the cases we expect.
* Suppress GLib deprecation warningsRyan Lortie2013-11-253-0/+7
| | | | | | | | The testsuite is happily using g_test_trap_fork() and dconf only builds on POSIX anyway, so this isn't a problem. Add version macros to the top of the testcases that use this API to suppress the deprecation warnings.
* tests: add test for service dbRyan Lortie2013-11-251-0/+121
| | | | Add a test to cover the service source backend in the engine.
* tests: fix a trivial error in the engine testRyan Lortie2013-11-251-1/+1
| | | | | Instead of checking the D-Bus interface name we were checking the bus name twice.
* mock dbus: allow for NULL replies in case of errorRyan Lortie2013-11-251-1/+3
| | | | | But make sure an error is set if NULL is returned and the caller passed in an error pointer.
* tests: improve coverage of D-Bus backendsRyan Lortie2013-11-251-0/+43
| | | | Add a weird test to hit two additional obscure cases
* tests: improve changeset test coverageRyan Lortie2013-11-251-0/+115
|
* tests: work around a GLib issueRyan Lortie2013-02-111-2/+2
| | | | | | | | | | gtestutils recently changed the order in which testcases are run, by grouping cases with similar paths together. Our D-Bus test depends on one of its cases running before the others. Change the way the tests are grouped in order to ensure that this keeps happening.
* Remove calls to g_type_init()Ryan Lortie2012-11-191-3/+0
| | | | Since we now have a hard dependency on the newer GLib anyway.
* adjust to new gvdb APIsRyan Lortie2012-11-094-25/+28
|
* tests/: test new DConfChangeset APIRyan Lortie2012-11-081-0/+55
|
* tests/: test a few more profile parser error pathsRyan Lortie2012-09-261-0/+4
|
* engine: improve robustness of profile parsingRyan Lortie2012-07-193-0/+15
| | | | | | | | | Checking for 'u' or 's' is really insanely silly from a robustness standpoint. Ensure that we properly have "user-db:" or "system-db:" and that a non-empty database name is given, warning if not. This was specifically causing annoying problems with the profile file that gdm was installing, so add a copy of that file to our testcases.
* tests/: remove dbus1 and gsettings programsRyan Lortie2012-07-164-766/+1
| | | | | These old programs aren't part of the test suite and they're not very useful now that we have proper testcases.
* dbus-1/: fix transmission of byte arraysRyan Lortie2012-07-161-0/+9
| | | | Add a test case that would have caught this problem.
* tests/: fix some leaksRyan Lortie2012-07-162-1/+5
|
* tests/: test sync watch calls on the engineRyan Lortie2012-07-162-3/+73
|
* tests/: test "fast" signal subscriptionRyan Lortie2012-07-161-1/+76
| | | | Test the normal case, plus the race condition case.
* tests/: improve DBus mock interfaceRyan Lortie2012-07-163-7/+26
| | | | | Put the queue of the outstanding async calls in the header and add an interface for defining handlers for sync calls.
* tests/: test reading from various profile setupsRyan Lortie2012-07-153-6/+330
| | | | | | | | | | | Add a testcase that tests the engine by reading from an exhaustive combination of different profile types and states (missing databases, empty databases, databases with values, databases with locks, etc). Among other things, this makes sure the lockdown logic is sane. This is the testcase that caught the bug fixed in the last commit (listing with a missing database file).
* engine: bring back origin_tag logicRyan Lortie2012-07-151-0/+1
| | | | | | | | | The GSettings backend still wants to use this and it does us no harm to have it on the engine API (which is only visible internally). Adjust the various consumers of the engine to the new API. Thanks to Rui Matos for reminding me about this...
* Don't return a value from a void functionBrian Cameron2012-07-151-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=676619
* make sure to dist dconf-mock.hRyan Lortie2012-07-151-0/+1
|
* test/: finish testing of system sourceRyan Lortie2012-07-131-6/+31
| | | | | Use the invalidation capabilities of the mock gvdb backend to test that the system source handles reopening properly.
* tests/ Rework the gvdb mock codeRyan Lortie2012-07-133-45/+81
| | | | Support a table being marked as no-longer-valid.
* tests/: add test for system sourceRyan Lortie2012-07-121-0/+60
|
* DConfEngineSource: return FALSE from NULL refreshRyan Lortie2012-07-121-0/+7
| | | | | | | | | | In the case that we call dconf_engine_source_refresh() on a source that had a NULL database and the result is that we still have a NULL database, return FALSE. This will prevent the unnecessary bumping of the state counter when there was really no change. This happens in the case of a missing system database file.
* DConfEngineSource: remove the external init callRyan Lortie2012-07-121-3/+1
| | | | | Always do init as part of the process of dconf_engine_source_new() to avoid the consumer from having to call it for themselves.
* tests/: add more testing code for engineRyan Lortie2012-07-124-8/+270
| | | | | | | Add an initial implementation of the gvdb mocking support and improve the existing shm mock by adding logging. Use these new features to test the 'user' DConfEngineSource.
* tests/: implement more realistic shm mockingRyan Lortie2012-07-123-2/+82
| | | | | | | | Add an implementation of the mock shm based on a hash table. We can use this to check that all shm handles have been properly closed after each test. Soon will come support for flagging the shm regions, by name.
* tests/: test the libdbus-1 DBus backendRyan Lortie2012-07-113-1/+12
| | | | | | | | | Add a testcase for the libdbus-1 DBus backend. It uses the existing testcase code and undergoes the same tests as the two other backends. There is one exception: we do not test for failure to connect to D-Bus because the D-Bus connections are passed up-front for the libdbus-1 case, as arguments to dconf_dbus_client_new().
* dbus test: signal with strings instead of intsRyan Lortie2012-07-111-2/+2
| | | | | | We should be testing strings and arrays of strings in our signal handling code (since that's what real dconf signals have inside of them).