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

Unit tests for readProtoFiles2 #45

Merged
merged 4 commits into from
May 22, 2018

Conversation

siddharthab
Copy link
Contributor

As requested in #39 and discussed in #40.

Add proto files within two projects with bidirectional dependencies
@eddelbuettel
Copy link
Owner

Nice work. I was a little put back when I saw a change to R/zzz.R but that seems to make sense as we need the new loader to test things.

I'll let this sit here for a day or two so that @murraystokely and @jeroen can comment, but this looks good to me at first glance. Will look once more. Thanks for this!

R/internals.R Outdated
@@ -101,6 +101,12 @@ readProtoFiles2 <- function(files,
invisible(NULL)
}

resetDescriptorPool <- function(){
.Call( "resetDescriptorPool_cpp" )
Copy link
Owner

Choose a reason for hiding this comment

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

I guess .Call() used to want a PACKAGE= argument but under registration=TRUE that should not be needed. I do wonder if we should purge the .Call() for new code and eg here just call resetDescriptorPool_cpp() ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the PACKAGE argument. I think using the registered symbols instead of a string should be part of a package wide refactoring. In my understanding, we still have to use .Call; it's just that we provide a symbol instead of expecting .Call to search for the name.

https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Converting-a-package-to-use-registration

R/internals.R Outdated
@@ -102,7 +102,7 @@ readProtoFiles2 <- function(files,
}

resetDescriptorPool <- function(){
.Call( "resetDescriptorPool_cpp" )
.Call( "resetDescriptorPool_cpp", PACKAGE = "RProtoBuf" )
Copy link
Owner

Choose a reason for hiding this comment

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

I was about to say we don't need this -- but then I realized that this package is still old-school not using Rcpp Attributes. Adding this follow the code convention even though we now also register symbols so I think it is not strictly needed -- but won't harm or hurt.

@eddelbuettel eddelbuettel merged commit 3798b31 into eddelbuettel:master May 22, 2018
@eddelbuettel
Copy link
Owner

Thanks again!

eddelbuettel added a commit that referenced this pull request May 22, 2018
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