ut framework: don't mock env functions
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
0d3f3cde14
commit
92a5ddd524
@ -137,7 +137,6 @@ static int _ocf_mngt_io_class_configure(ocf_cache_t cache,
|
|||||||
|
|
||||||
if (env_strncmp(name, OCF_IO_CLASS_NAME_MAX,
|
if (env_strncmp(name, OCF_IO_CLASS_NAME_MAX,
|
||||||
dest_part->config->name, OCF_IO_CLASS_NAME_MAX)) {
|
dest_part->config->name, OCF_IO_CLASS_NAME_MAX)) {
|
||||||
|
|
||||||
ocf_cache_log(cache, log_err,
|
ocf_cache_log(cache, log_err,
|
||||||
"Can't change classification rule of the default IO class"
|
"Can't change classification rule of the default IO class"
|
||||||
" [ ERROR ]\n");
|
" [ ERROR ]\n");
|
||||||
|
@ -146,6 +146,11 @@ class UnitTestsSourcesGenerator(object):
|
|||||||
wrap_file_path = wrap_file_path + "_generated_wraps.c"
|
wrap_file_path = wrap_file_path + "_generated_wraps.c"
|
||||||
return wrap_file_path
|
return wrap_file_path
|
||||||
|
|
||||||
|
def is_env_function(self, name):
|
||||||
|
prefixes = ["env", "bug", "memcpy", "memset", "memcmp", "strnlen", "strncmp", "strncpy"]
|
||||||
|
|
||||||
|
return list(filter(name.startswith, prefixes)) != []
|
||||||
|
|
||||||
def prepare_autowraps(self, test_file_path, preprocessed_file_path):
|
def prepare_autowraps(self, test_file_path, preprocessed_file_path):
|
||||||
functions_to_wrap = self.get_functions_calls(
|
functions_to_wrap = self.get_functions_calls(
|
||||||
self.get_sources_to_test_repo() + test_file_path)
|
self.get_sources_to_test_repo() + test_file_path)
|
||||||
@ -160,10 +165,7 @@ class UnitTestsSourcesGenerator(object):
|
|||||||
with open(preprocessed_file_path) as f:
|
with open(preprocessed_file_path) as f:
|
||||||
code = f.readlines()
|
code = f.readlines()
|
||||||
for function in functions_to_wrap:
|
for function in functions_to_wrap:
|
||||||
if function.startswith("env_") or function.startswith("bug") \
|
if self.is_env_function(function):
|
||||||
or function.startswith("memcpy"):
|
|
||||||
# added memcpy function to list of ignored functions
|
|
||||||
# because this is macro
|
|
||||||
continue
|
continue
|
||||||
for tag in tags_list:
|
for tag in tags_list:
|
||||||
if function in tag:
|
if function in tag:
|
||||||
|
Loading…
Reference in New Issue
Block a user