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
Merged

Conversation

@siddharthab
Copy link
Contributor

@siddharthab siddharthab commented May 21, 2018

As requested in #39 and discussed in #40.

siddharthab added 2 commits May 21, 2018
Add proto files within two projects with bidirectional dependencies
@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented May 21, 2018

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!

@@ -101,6 +101,12 @@ readProtoFiles2 <- function(files,
invisible(NULL)
}

resetDescriptorPool <- function(){
.Call( "resetDescriptorPool_cpp" )

This comment has been minimized.

@eddelbuettel

eddelbuettel May 21, 2018
Owner

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() ...

This comment has been minimized.

@siddharthab

siddharthab May 21, 2018
Author Contributor

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

@@ -102,7 +102,7 @@ readProtoFiles2 <- function(files,
}

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

This comment has been minimized.

@eddelbuettel

eddelbuettel May 21, 2018
Owner

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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented May 22, 2018

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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.