diff options
author | Daniel Playfair Cal <daniel.playfair.cal@gmail.com> | 2019-01-07 22:33:15 +1100 |
---|---|---|
committer | Daniel Playfair Cal <daniel.playfair.cal@gmail.com> | 2019-02-12 19:47:56 +1100 |
commit | 8cbaee1c341b97d81fc597a4571b459baaac5c11 (patch) | |
tree | 1a1d58e7110fb231f0ea04d9b8626ec283e4a3c2 /engine/dconf-engine-mockable.c | |
parent | 38e625da7f47e457d150efedc598437e2e867ef7 (diff) | |
download | dconf-8cbaee1c341b97d81fc597a4571b459baaac5c11.tar.gz |
Tests: replace usage of dlsym with separate modules containing functions that need to be mocked out
Diffstat (limited to 'engine/dconf-engine-mockable.c')
-rw-r--r-- | engine/dconf-engine-mockable.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/engine/dconf-engine-mockable.c b/engine/dconf-engine-mockable.c new file mode 100644 index 0000000..dce2f43 --- /dev/null +++ b/engine/dconf-engine-mockable.c @@ -0,0 +1,39 @@ +/* + * Copyright © 2019 Daniel Playfair Cal + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. + * + * Author: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> + */ + +/** + * This module contains the production implementations of methods used in + * dconf_shm that need to be mocked out for tests. + * + * In some cases, external methods are wrapped with a different name. This is + * done so that it is not necessary to redefine the external functions in + * unit tests in order to mock them out, and therefore easy to also call the + * non mocked versions in tests if necessary. + */ + +#include "config.h" + +#include "dconf-engine-mockable.h" + + +FILE * +dconf_engine_fopen (const char *pathname, const char *mode) +{ + return fopen (pathname, mode); +} |