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

Copy python tests for Modulemd.ModuleIndexMerger.merger into C #425

Merged
merged 1 commit into from Jan 23, 2020

Conversation

chenliTW
Copy link
Contributor

For issue #198

Copy link
Member

@OrionStar25 OrionStar25 left a comment

Choose a reason for hiding this comment

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

Overall a very good effort. Your CI is failing though. Please run ninja test before committing your changes. That will format the code. Then amend the patch over here.

@@ -20,6 +21,7 @@
#include "modulemd-module-index.h"
#include "private/test-utils.h"

typedef int gint;
Copy link
Member

Choose a reason for hiding this comment

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

You could also use guint64 and not use this at all. This is all defined in glib already.

* sorting issues.
*/
merger = modulemd_module_index_merger_new ();
random_low = rand()%100+1;
Copy link
Member

Choose a reason for hiding this comment

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

Please look at this on how to use random with GLib. https://developer.gnome.org/glib/stable/glib-Random-Numbers.html

Declare your variable datatypes accordingly.

@@ -12,6 +12,7 @@
*/

#include <glib.h>
#include <stdlib.h>
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming you added this for rand. This can be eliminated by using the functionality in glib

@chenliTW
Copy link
Contributor Author

chenliTW commented Jan 12, 2020

I have run ninja test and change the rand() into g_random_int_range() , The test in my machine passed

@OrionStar25
Copy link
Member

Please see the log from the failing CI. You have a bunch of warnings because of incompatible data types. Either typecast your parameters or use functions from the glib manual accordingly. We need to eliminate all the warnings.

Also, you must run ninja test right before committing. Running ninja test after committing or before making another change would only fail the CI.

@chenliTW
Copy link
Contributor Author

I have typecast all the parameters and eliminate all the warnings. But the CI test seems failing while I run ninja test right before committing . Are there something that I missed to correct?

@chenliTW
Copy link
Contributor Author

chenliTW commented Jan 13, 2020

I have typecast all the parameters and eliminate all the warnings. But the CI test seems failing while I run ninja test right before committing . Are there something that I missed to correct?

The CI test passed after I use clang-format.

Copy link
Member

@OrionStar25 OrionStar25 left a comment

Choose a reason for hiding this comment

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

Great work!

sgallagher added a commit that referenced this pull request Jan 23, 2020
Copy python tests for Modulemd.ModuleIndexMerger.merger into C

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
@sgallagher sgallagher merged commit 0f39534 into fedora-modularity:master Jan 23, 2020
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.

None yet

3 participants