2 * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include <libxml/tree.h>
22 #include "sstt_mock.h"
24 #define TEST_FONT_CONF_FILE "./tests/res/99-tizen.conf"
26 static bool sstm_xmlParseFile_enable = true;
28 API void sstm_xmlParseFile_setup(bool enable)
30 sstm_xmlParseFile_enable = enable;
33 API xmlDocPtr xmlParseFile(const char *filename)
35 if (false == sstm_xmlParseFile_enable)
38 xmlDocPtr (*org_fn)(const char *path);
39 if (0 == strcmp(filename, SETTING_FONT_CONF_FILE)) {
40 INFO("try xmlParseFile(%s)", TEST_FONT_CONF_FILE);
41 org_fn = dlsym(RTLD_NEXT, "xmlParseFile");
42 return org_fn(TEST_FONT_CONF_FILE);
45 org_fn = dlsym(RTLD_NEXT, "xmlParseFile");
46 return org_fn(filename);