Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
d40e8cae
Commit
d40e8cae
authored
Jan 22, 2019
by
DanmeiChen
Browse files
fix compilations of some plaforms
parent
e5948ac9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
46 deletions
+47
-46
tester/message_tester.c
tester/message_tester.c
+0
-46
tester/tester.c
tester/tester.c
+47
-0
No files found.
tester/message_tester.c
View file @
d40e8cae
...
...
@@ -1426,52 +1426,6 @@ static void lime_unit(void) {
}
}
/*
* Copy file "from" to file "to".
* Destination file is truncated if existing.
* Return 0 on success, positive value on error.
*/
int
liblinphone_tester_copy_file
(
const
char
*
from
,
const
char
*
to
)
{
FILE
*
in
,
*
out
;
char
buf
[
256
];
size_t
n
;
/* Open "from" file for reading */
in
=
fopen
(
from
,
"rb"
);
if
(
in
==
NULL
)
{
ms_error
(
"Can't open %s for reading: %s
\n
"
,
from
,
strerror
(
errno
));
return
1
;
}
/* Open "to" file for writing (will truncate existing files) */
out
=
fopen
(
to
,
"wb"
);
if
(
out
==
NULL
)
{
ms_error
(
"Can't open %s for writing: %s
\n
"
,
to
,
strerror
(
errno
));
fclose
(
in
);
return
2
;
}
/* Copy data from "in" to "out" */
while
(
(
n
=
fread
(
buf
,
sizeof
(
char
),
sizeof
(
buf
),
in
))
>
0
)
{
if
(
!
fwrite
(
buf
,
1
,
n
,
out
)
)
{
ms_error
(
"Could not write in %s: %s
\n
"
,
to
,
strerror
(
errno
));
fclose
(
in
);
fclose
(
out
);
return
3
;
}
}
fclose
(
in
);
fclose
(
out
);
return
0
;
}
int
check_no_strange_time
(
void
*
data
,
int
argc
,
char
**
argv
,
char
**
cNames
)
{
BC_ASSERT_EQUAL
(
argc
,
1
,
int
,
"%d"
);
BC_ASSERT_STRING_EQUAL
(
cNames
[
0
],
"COUNT(*)"
);
// count of non updated messages should be 0
...
...
tester/tester.c
View file @
d40e8cae
...
...
@@ -1897,3 +1897,50 @@ const char *liblinphone_tester_get_empty_rc(void){
return
liblinphone_tester_empty_rc_path
;
}
/*
* Copy file "from" to file "to".
* Destination file is truncated if existing.
* Return 0 on success, positive value on error.
*/
int
liblinphone_tester_copy_file
(
const
char
*
from
,
const
char
*
to
)
{
FILE
*
in
,
*
out
;
char
buf
[
256
];
size_t
n
;
/* Open "from" file for reading */
in
=
fopen
(
from
,
"rb"
);
if
(
in
==
NULL
)
{
ms_error
(
"Can't open %s for reading: %s
\n
"
,
from
,
strerror
(
errno
));
return
1
;
}
/* Open "to" file for writing (will truncate existing files) */
out
=
fopen
(
to
,
"wb"
);
if
(
out
==
NULL
)
{
ms_error
(
"Can't open %s for writing: %s
\n
"
,
to
,
strerror
(
errno
));
fclose
(
in
);
return
2
;
}
/* Copy data from "in" to "out" */
while
(
(
n
=
fread
(
buf
,
sizeof
(
char
),
sizeof
(
buf
),
in
))
>
0
)
{
if
(
!
fwrite
(
buf
,
1
,
n
,
out
)
)
{
ms_error
(
"Could not write in %s: %s
\n
"
,
to
,
strerror
(
errno
));
fclose
(
in
);
fclose
(
out
);
return
3
;
}
}
fclose
(
in
);
fclose
(
out
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment