Skip to content

Feature/more nocov #1044

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

Merged
merged 3 commits into from
Feb 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inst/include/Rcpp/exceptions_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Rcpp {
#include <execinfo.h>

// Extract mangled name e.g. ./test(baz+0x14)[0x400962]
static std::string demangler_one(const char* input) {
static std::string demangler_one(const char* input) { // #nocov start
static std::string buffer;
buffer = input;
size_t last_open = buffer.find_last_of('(');
Expand Down Expand Up @@ -84,6 +84,6 @@ namespace Rcpp {
_["line" ] = -1,
_["stack"] = res);
trace.attr("class") = "Rcpp_stack_trace";
rcpp_set_stack_trace(trace);
rcpp_set_stack_trace(trace); // #nocov end
}
};
18 changes: 9 additions & 9 deletions inst/include/Rcpp/generated/Vector__create.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@
}

template <typename T1, typename T2, typename T3>
static Vector create__dispatch( traits::true_type, const T1& t1, const T2& t2, const T3& t3){
Vector res( 3 ) ;
Shield<SEXP> names( ::Rf_allocVector( STRSXP, 3 ) ) ;
int index = 0 ;
iterator it( res.begin() );
static Vector create__dispatch( traits::true_type, const T1& t1, const T2& t2, const T3& t3){ // #nocov start
Vector res( 3 ) ;
Shield<SEXP> names( ::Rf_allocVector( STRSXP, 3 ) ) ;
int index = 0 ;
iterator it( res.begin() );

////
////
replace_element( it, names, index, t1 ) ; ++it; ++index ;
replace_element( it, names, index, t2 ) ; ++it; ++index ;
replace_element( it, names, index, t3 ) ; ++it; ++index ;
////
////

res.attr("names") = names ;
res.attr("names") = names ;

return res ;
return res ; // #nocov end
}

public:
Expand Down
76 changes: 38 additions & 38 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// api.cpp: Rcpp R/C++ interface class library -- Rcpp api
//
// Copyright (C) 2012 - 2019 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2012 - 2020 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -53,7 +53,7 @@ namespace Rcpp {
}

// [[Rcpp::register]]
unsigned long beginSuspendRNGSynchronization() {// #nocov start
unsigned long beginSuspendRNGSynchronization() { // #nocov start
++rngSynchronizationSuspended;
return rngSynchronizationSuspended;
}
Expand All @@ -62,7 +62,7 @@ namespace Rcpp {
unsigned long endSuspendRNGSynchronization() {
--rngSynchronizationSuspended;
return rngSynchronizationSuspended;
} // #nocov end
} // #nocov end

// [[Rcpp::register]]
char* get_string_buffer() {
Expand All @@ -73,36 +73,36 @@ namespace Rcpp {
}

// [[Rcpp::register]]
const char * type2name(SEXP x) { // #nocov start
const char * type2name(SEXP x) { // #nocov start
switch (TYPEOF(x)) {
case NILSXP: return "NILSXP";
case SYMSXP: return "SYMSXP";
case RAWSXP: return "RAWSXP";
case LISTSXP: return "LISTSXP";
case CLOSXP: return "CLOSXP";
case ENVSXP: return "ENVSXP";
case PROMSXP: return "PROMSXP";
case LANGSXP: return "LANGSXP";
case SPECIALSXP: return "SPECIALSXP";
case BUILTINSXP: return "BUILTINSXP";
case CHARSXP: return "CHARSXP";
case LGLSXP: return "LGLSXP";
case INTSXP: return "INTSXP";
case REALSXP: return "REALSXP";
case CPLXSXP: return "CPLXSXP";
case STRSXP: return "STRSXP";
case DOTSXP: return "DOTSXP";
case ANYSXP: return "ANYSXP";
case VECSXP: return "VECSXP";
case EXPRSXP: return "EXPRSXP";
case BCODESXP: return "BCODESXP";
case EXTPTRSXP: return "EXTPTRSXP";
case WEAKREFSXP: return "WEAKREFSXP";
case S4SXP: return "S4SXP";
case NILSXP: return "NILSXP";
case SYMSXP: return "SYMSXP";
case RAWSXP: return "RAWSXP";
case LISTSXP: return "LISTSXP";
case CLOSXP: return "CLOSXP";
case ENVSXP: return "ENVSXP";
case PROMSXP: return "PROMSXP";
case LANGSXP: return "LANGSXP";
case SPECIALSXP: return "SPECIALSXP";
case BUILTINSXP: return "BUILTINSXP";
case CHARSXP: return "CHARSXP";
case LGLSXP: return "LGLSXP";
case INTSXP: return "INTSXP";
case REALSXP: return "REALSXP";
case CPLXSXP: return "CPLXSXP";
case STRSXP: return "STRSXP";
case DOTSXP: return "DOTSXP";
case ANYSXP: return "ANYSXP";
case VECSXP: return "VECSXP";
case EXPRSXP: return "EXPRSXP";
case BCODESXP: return "BCODESXP";
case EXTPTRSXP: return "EXTPTRSXP";
case WEAKREFSXP: return "WEAKREFSXP";
case S4SXP: return "S4SXP";
default:
return "<unknown>";
}
} // #nocov end
} // #nocov end


} // namespace Rcpp
Expand All @@ -127,21 +127,21 @@ std::string demangle(const std::string& name) {
}

// [[Rcpp::register]]
const char* short_file_name(const char* file) { // #nocov start
const char* short_file_name(const char* file) { // #nocov start
std::string f(file);
size_t index = f.find("/include/");
if (index != std::string::npos) {
f = f.substr(index + 9);
}
return f.c_str();
} // #nocov end
}

// [[Rcpp::internal]]
SEXP as_character_externalptr(SEXP xp) { // #nocov start
SEXP as_character_externalptr(SEXP xp) {
char buffer[20];
snprintf(buffer, 20, "%p", (void*)EXTPTR_PTR(xp));
return Rcpp::wrap((const char*)buffer);
} // #nocov end
} // #nocov end

// [[Rcpp::internal]]
SEXP rcpp_capabilities() {
Expand Down Expand Up @@ -232,29 +232,29 @@ SEXP rcpp_capabilities() {


// [[Rcpp::internal]]
SEXP rcpp_can_use_cxx0x() { // #nocov start
SEXP rcpp_can_use_cxx0x() { // #nocov start
#if defined(HAS_VARIADIC_TEMPLATES) || defined(RCPP_USING_CXX11)
return Rf_ScalarLogical(TRUE);
#else
return Rf_ScalarLogical(FALSE);
#endif
} // #nocov end
}


// [[Rcpp::internal]]
SEXP rcpp_can_use_cxx11() { // #nocov start
SEXP rcpp_can_use_cxx11() {
#if defined(RCPP_USING_CXX11)
return Rf_ScalarLogical(TRUE);
#else
return Rf_ScalarLogical(FALSE);
#endif
} // #nocov end
}


// [[Rcpp::register]]
SEXP stack_trace(const char* file, int line) {
return R_NilValue;
}
} // #nocov end


// // [ [ Rcpp::register ] ]
Expand Down