Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
92576306
Commit
92576306
authored
5 years ago
by
Simon McVittie
Browse files
Options
Downloads
Patches
Plain Diff
tests: Avoid compiler warnings for shadowing symlink()
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
819278a8
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!81
Fix some compiler warnings
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/fake-home.c
+10
-10
10 additions, 10 deletions
tests/fake-home.c
tests/system-info.c
+24
-24
24 additions, 24 deletions
tests/system-info.c
with
34 additions
and
34 deletions
tests/fake-home.c
+
10
−
10
View file @
92576306
...
@@ -76,7 +76,7 @@ gboolean
...
@@ -76,7 +76,7 @@ gboolean
fake_home_create_structure
(
FakeHome
*
f
)
fake_home_create_structure
(
FakeHome
*
f
)
{
{
gboolean
ret
=
FALSE
;
gboolean
ret
=
FALSE
;
GFile
*
symlink
=
NULL
;
GFile
*
symlink
_gfile
=
NULL
;
gchar
*
dot_steam
=
NULL
;
gchar
*
dot_steam
=
NULL
;
gchar
*
scripts
=
NULL
;
gchar
*
scripts
=
NULL
;
gchar
*
run
=
NULL
;
gchar
*
run
=
NULL
;
...
@@ -198,18 +198,18 @@ fake_home_create_structure (FakeHome *f)
...
@@ -198,18 +198,18 @@ fake_home_create_structure (FakeHome *f)
{
{
if
(
dot_steam_root
==
NULL
)
if
(
dot_steam_root
==
NULL
)
dot_steam_root
=
g_build_filename
(
dot_steam
,
"root"
,
NULL
);
dot_steam_root
=
g_build_filename
(
dot_steam
,
"root"
,
NULL
);
symlink
=
g_file_new_for_path
(
dot_steam_root
);
symlink
_gfile
=
g_file_new_for_path
(
dot_steam_root
);
g_file_make_symbolic_link
(
symlink
,
f
->
steam_install
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
f
->
steam_install
,
NULL
,
&
error
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
dot_steam_bin32
=
g_build_filename
(
dot_steam
,
"bin32"
,
NULL
);
dot_steam_bin32
=
g_build_filename
(
dot_steam
,
"bin32"
,
NULL
);
symlink
=
g_file_new_for_path
(
dot_steam_bin32
);
symlink
_gfile
=
g_file_new_for_path
(
dot_steam_bin32
);
ubuntu12_32
=
g_build_filename
(
f
->
steam_install
,
"ubuntu12_32"
,
NULL
);
ubuntu12_32
=
g_build_filename
(
f
->
steam_install
,
"ubuntu12_32"
,
NULL
);
g_file_make_symbolic_link
(
symlink
,
ubuntu12_32
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
ubuntu12_32
,
NULL
,
&
error
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
}
}
...
@@ -217,10 +217,10 @@ fake_home_create_structure (FakeHome *f)
...
@@ -217,10 +217,10 @@ fake_home_create_structure (FakeHome *f)
{
{
if
(
dot_steam_steam
==
NULL
)
if
(
dot_steam_steam
==
NULL
)
dot_steam_steam
=
g_build_filename
(
dot_steam
,
"steam"
,
NULL
);
dot_steam_steam
=
g_build_filename
(
dot_steam
,
"steam"
,
NULL
);
symlink
=
g_file_new_for_path
(
dot_steam_steam
);
symlink
_gfile
=
g_file_new_for_path
(
dot_steam_steam
);
g_file_make_symbolic_link
(
symlink
,
f
->
steam_data
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
f
->
steam_data
,
NULL
,
&
error
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
if
(
f
->
has_debian_bug_916303
)
if
(
f
->
has_debian_bug_916303
)
{
{
g_error_free
(
error
);
g_error_free
(
error
);
...
...
This diff is collapsed.
Click to expand it.
tests/system-info.c
+
24
−
24
View file @
92576306
...
@@ -1054,7 +1054,7 @@ runtime_unexpected_location (Fixture *f,
...
@@ -1054,7 +1054,7 @@ runtime_unexpected_location (Fixture *f,
gchar
*
ld_path
=
NULL
;
gchar
*
ld_path
=
NULL
;
gchar
*
env_path
=
NULL
;
gchar
*
env_path
=
NULL
;
gchar
**
parts
=
NULL
;
gchar
**
parts
=
NULL
;
GFile
*
symlink
=
NULL
;
GFile
*
symlink
_gfile
=
NULL
;
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
FakeHome
*
fake_home
;
FakeHome
*
fake_home
;
...
@@ -1071,13 +1071,13 @@ runtime_unexpected_location (Fixture *f,
...
@@ -1071,13 +1071,13 @@ runtime_unexpected_location (Fixture *f,
/* Create a new homedir/.steam/steam symlink that doesn't point to
/* Create a new homedir/.steam/steam symlink that doesn't point to
* the expected steam runtime path. */
* the expected steam runtime path. */
symlink
=
g_file_new_for_path
(
dot_steam_root
);
symlink
_gfile
=
g_file_new_for_path
(
dot_steam_root
);
g_file_make_symbolic_link
(
symlink
,
fake_home
->
pinned_64
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
fake_home
->
pinned_64
,
NULL
,
&
error
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
srt_system_info_set_environ
(
info
,
fake_home
->
env
);
srt_system_info_set_environ
(
info
,
fake_home
->
env
);
issues
=
srt_system_info_get_runtime_issues
(
info
);
issues
=
srt_system_info_get_runtime_issues
(
info
);
g_assert_cmpint
(
issues
,
==
,
SRT_RUNTIME_ISSUES_UNEXPECTED_LOCATION
);
g_assert_cmpint
(
issues
,
==
,
SRT_RUNTIME_ISSUES_UNEXPECTED_LOCATION
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
/* Move the steam-runtime to another location called "my-runtime" and
/* Move the steam-runtime to another location called "my-runtime" and
* adjust all the environment variables accordingly. */
* adjust all the environment variables accordingly. */
...
@@ -1094,8 +1094,8 @@ runtime_unexpected_location (Fixture *f,
...
@@ -1094,8 +1094,8 @@ runtime_unexpected_location (Fixture *f,
g_rename
(
fake_home
->
runtime
,
my_runtime
);
g_rename
(
fake_home
->
runtime
,
my_runtime
);
g_remove
(
dot_steam_root
);
g_remove
(
dot_steam_root
);
symlink
=
g_file_new_for_path
(
dot_steam_root
);
symlink
_gfile
=
g_file_new_for_path
(
dot_steam_root
);
g_file_make_symbolic_link
(
symlink
,
my_runtime
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
my_runtime
,
NULL
,
&
error
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
fake_home
->
env
=
g_environ_setenv
(
fake_home
->
env
,
"LD_LIBRARY_PATH"
,
ld_path
,
TRUE
);
fake_home
->
env
=
g_environ_setenv
(
fake_home
->
env
,
"LD_LIBRARY_PATH"
,
ld_path
,
TRUE
);
fake_home
->
env
=
g_environ_setenv
(
fake_home
->
env
,
"STEAM_RUNTIME"
,
my_runtime
,
TRUE
);
fake_home
->
env
=
g_environ_setenv
(
fake_home
->
env
,
"STEAM_RUNTIME"
,
my_runtime
,
TRUE
);
...
@@ -1106,7 +1106,7 @@ runtime_unexpected_location (Fixture *f,
...
@@ -1106,7 +1106,7 @@ runtime_unexpected_location (Fixture *f,
g_assert_cmpint
(
issues
,
==
,
SRT_RUNTIME_ISSUES_UNEXPECTED_LOCATION
);
g_assert_cmpint
(
issues
,
==
,
SRT_RUNTIME_ISSUES_UNEXPECTED_LOCATION
);
fake_home_clean_up
(
fake_home
);
fake_home_clean_up
(
fake_home
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
g_object_unref
(
info
);
g_object_unref
(
info
);
g_free
(
dot_steam_root
);
g_free
(
dot_steam_root
);
g_free
(
my_runtime
);
g_free
(
my_runtime
);
...
@@ -1127,7 +1127,7 @@ steam_symlink (Fixture *f,
...
@@ -1127,7 +1127,7 @@ steam_symlink (Fixture *f,
gchar
*
dot_steam_bin32
=
NULL
;
gchar
*
dot_steam_bin32
=
NULL
;
gchar
*
installation_path
=
NULL
;
gchar
*
installation_path
=
NULL
;
gchar
*
ubuntu12_32
=
NULL
;
gchar
*
ubuntu12_32
=
NULL
;
GFile
*
symlink
=
NULL
;
GFile
*
symlink
_gfile
=
NULL
;
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
FakeHome
*
fake_home
;
FakeHome
*
fake_home
;
...
@@ -1150,8 +1150,8 @@ steam_symlink (Fixture *f,
...
@@ -1150,8 +1150,8 @@ steam_symlink (Fixture *f,
/* Remove homedir/.steam/root symlink and create homedir/.steam/bin32 symlink. */
/* Remove homedir/.steam/root symlink and create homedir/.steam/bin32 symlink. */
g_remove
(
dot_steam_root
);
g_remove
(
dot_steam_root
);
g_remove
(
dot_steam_bin32
);
g_remove
(
dot_steam_bin32
);
symlink
=
g_file_new_for_path
(
dot_steam_bin32
);
symlink
_gfile
=
g_file_new_for_path
(
dot_steam_bin32
);
g_file_make_symbolic_link
(
symlink
,
ubuntu12_32
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
ubuntu12_32
,
NULL
,
&
error
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
srt_system_info_set_environ
(
info
,
fake_home
->
env
);
srt_system_info_set_environ
(
info
,
fake_home
->
env
);
issues
=
srt_system_info_get_steam_issues
(
info
);
issues
=
srt_system_info_get_steam_issues
(
info
);
...
@@ -1177,7 +1177,7 @@ steam_symlink (Fixture *f,
...
@@ -1177,7 +1177,7 @@ steam_symlink (Fixture *f,
g_assert_cmpstr
(
installation_path
,
==
,
NULL
);
g_assert_cmpstr
(
installation_path
,
==
,
NULL
);
fake_home_clean_up
(
fake_home
);
fake_home_clean_up
(
fake_home
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
g_object_unref
(
info
);
g_object_unref
(
info
);
g_free
(
data_home
);
g_free
(
data_home
);
g_free
(
dot_steam_steam
);
g_free
(
dot_steam_steam
);
...
@@ -1871,7 +1871,7 @@ pinned_libraries (Fixture *f,
...
@@ -1871,7 +1871,7 @@ pinned_libraries (Fixture *f,
gchar
*
has_pins
=
NULL
;
gchar
*
has_pins
=
NULL
;
gchar
**
values
=
NULL
;
gchar
**
values
=
NULL
;
gchar
**
messages
=
NULL
;
gchar
**
messages
=
NULL
;
GFile
*
symlink
=
NULL
;
GFile
*
symlink
_gfile
=
NULL
;
gboolean
seen_pins
;
gboolean
seen_pins
;
gsize
i
;
gsize
i
;
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
...
@@ -1884,18 +1884,18 @@ pinned_libraries (Fixture *f,
...
@@ -1884,18 +1884,18 @@ pinned_libraries (Fixture *f,
start
=
g_build_filename
(
fake_home
->
pinned_32
,
"libcurl.so.3"
,
NULL
);
start
=
g_build_filename
(
fake_home
->
pinned_32
,
"libcurl.so.3"
,
NULL
);
target1
=
g_build_filename
(
fake_home
->
pinned_32
,
"libcurl.so.4"
,
NULL
);
target1
=
g_build_filename
(
fake_home
->
pinned_32
,
"libcurl.so.4"
,
NULL
);
symlink
=
g_file_new_for_path
(
start
);
symlink
_gfile
=
g_file_new_for_path
(
start
);
g_file_make_symbolic_link
(
symlink
,
target1
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
target1
,
NULL
,
&
error
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
target2
=
g_build_filename
(
fake_home
->
i386_usr_lib_i386
,
"libcurl.so.4.2.0"
,
NULL
);
target2
=
g_build_filename
(
fake_home
->
i386_usr_lib_i386
,
"libcurl.so.4.2.0"
,
NULL
);
g_assert_cmpint
(
g_creat
(
target2
,
0755
),
>
,
-
1
);
g_assert_cmpint
(
g_creat
(
target2
,
0755
),
>
,
-
1
);
symlink
=
g_file_new_for_path
(
target1
);
symlink
_gfile
=
g_file_new_for_path
(
target1
);
g_file_make_symbolic_link
(
symlink
,
target2
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
target2
,
NULL
,
&
error
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
has_pins
=
g_build_filename
(
fake_home
->
pinned_32
,
"has_pins"
,
NULL
);
has_pins
=
g_build_filename
(
fake_home
->
pinned_32
,
"has_pins"
,
NULL
);
...
@@ -1950,18 +1950,18 @@ pinned_libraries (Fixture *f,
...
@@ -1950,18 +1950,18 @@ pinned_libraries (Fixture *f,
srt_system_info_set_environ
(
info
,
fake_home
->
env
);
srt_system_info_set_environ
(
info
,
fake_home
->
env
);
start
=
g_build_filename
(
fake_home
->
pinned_64
,
"libcurl.so.3"
,
NULL
);
start
=
g_build_filename
(
fake_home
->
pinned_64
,
"libcurl.so.3"
,
NULL
);
target1
=
g_build_filename
(
fake_home
->
pinned_64
,
"libcurl.so.4"
,
NULL
);
target1
=
g_build_filename
(
fake_home
->
pinned_64
,
"libcurl.so.4"
,
NULL
);
symlink
=
g_file_new_for_path
(
start
);
symlink
_gfile
=
g_file_new_for_path
(
start
);
g_file_make_symbolic_link
(
symlink
,
target1
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
target1
,
NULL
,
&
error
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
target2
=
g_build_filename
(
fake_home
->
amd64_usr_lib_64
,
"libcurl.so.4.2.0"
,
NULL
);
target2
=
g_build_filename
(
fake_home
->
amd64_usr_lib_64
,
"libcurl.so.4.2.0"
,
NULL
);
g_assert_cmpint
(
g_creat
(
target2
,
0755
),
>
,
-
1
);
g_assert_cmpint
(
g_creat
(
target2
,
0755
),
>
,
-
1
);
symlink
=
g_file_new_for_path
(
target1
);
symlink
_gfile
=
g_file_new_for_path
(
target1
);
g_file_make_symbolic_link
(
symlink
,
target2
,
NULL
,
&
error
);
g_file_make_symbolic_link
(
symlink
_gfile
,
target2
,
NULL
,
&
error
);
g_object_unref
(
symlink
);
g_object_unref
(
symlink
_gfile
);
g_assert_no_error
(
error
);
g_assert_no_error
(
error
);
has_pins
=
g_build_filename
(
fake_home
->
pinned_64
,
"has_pins"
,
NULL
);
has_pins
=
g_build_filename
(
fake_home
->
pinned_64
,
"has_pins"
,
NULL
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment