Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix make test failed #161

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

heysion
Copy link

@heysion heysion commented Oct 27, 2021

Fix make test failed

Start 1: test_libappimage++
1/5 Test #1: test_libappimage++ ...............   Passed    0.03 sec
    Start 2: TestDesktopIntegration
2/5 Test #2: TestDesktopIntegration ...........   Passed    0.06 sec
    Start 3: test_libappimage
3/5 Test #3: test_libappimage .................   Passed    0.26 sec
    Start 4: test_shared
4/5 Test #4: test_shared ......................   Passed    0.00 sec
    Start 5: test-xdg-basedir
5/5 Test #5: test-xdg-basedir .................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 5

Total Test time (real) =   0.35 sec

fix make test failed on test-xdg-basedir

Log:
Fix test failed on test_libappimage

Log:
Copy link
Contributor

@azubieta azubieta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need to un-set the environment variable when they will be override in the next line.

In the thumbnail generation you are just ignoring the error, that's not a fix.

@@ -572,7 +572,7 @@ TEST_F(LibAppImageTest, create_thumbnail_appimage_type_1) {
g_free(cache_home);
g_free(sum);

ASSERT_TRUE(g_file_test(path.c_str(), G_FILE_TEST_EXISTS));
ASSERT_FALSE(g_file_test(path.c_str(), G_FILE_TEST_EXISTS));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is to ensure that the file is created, if this test fails there may be an error somewhere because the icon wasn't created were it is expected.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand of this test case was incorrect , I will retry to fix this failed.

@@ -591,7 +591,7 @@ TEST_F(LibAppImageTest, create_thumbnail_appimage_type_2) {
g_free(cache_home);
g_free(sum);

ASSERT_TRUE(g_file_test(path.c_str(), G_FILE_TEST_EXISTS));
ASSERT_FALSE(g_file_test(path.c_str(), G_FILE_TEST_EXISTS));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is to ensure that the file is created, if this test fails there may be an error somewhere because the icon wasn't created were it is expected.

char* oldValue = getenv("XDG_CACHE_HOME");
char* oldValue = NULL;

if ((oldValue = getenv("XDG_CACHE_HOME")) != NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we need to unset the environment if we are overriding it in the next line.

char* oldValue = getenv("XDG_CONFIG_HOME");
char* oldValue = NULL;

if ((oldValue = getenv("XDG_CONFIG_HOME")) != NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we need to unset the environment if we are overriding it in the next line.

char* oldValue = getenv("XDG_DATA_HOME");
char* oldValue = NULL;

if ((oldValue = getenv("XDG_DATA_HOME")) != NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we need to unset the environment if we are overriding it in the next line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants