Skip to content

Commit

Permalink
Removed deps from test coverage, fixed bench that was throwing an err…
Browse files Browse the repository at this point in the history
…or, removed some code from coverage, added tests to getData around gzip compression. [republish binary]
  • Loading branch information
flippmoke committed Sep 2, 2015
1 parent 119cc41 commit bb6c13c
Show file tree
Hide file tree
Showing 4 changed files with 354 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -87,7 +87,7 @@ before_script:
fi

script:
- if [[ ${COVERAGE} == true ]]; then ./mason_packages/.link/bin/cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude tools --exclude docs --exclude sdk --exclude build/Release/obj/gen --exclude src/mapnik_featureset.hpp --exclude src/mapnik_logger.hpp --exclude src/mapnik_image_view.hpp --exclude src/mapnik_geometry.hpp > /dev/null; fi;
- if [[ ${COVERAGE} == true ]]; then ./mason_packages/.link/bin/cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude tools --exclude docs --exclude sdk --exclude build/Release/obj/gen --exclude src/mapnik_featureset.hpp --exclude src/mapnik_logger.hpp --exclude src/mapnik_image_view.hpp --exclude src/mapnik_geometry.hpp --exclude deps > /dev/null; fi;
- node --expose-gc bench/error/test_vt_abort2.js
# ugh: always killed by travis
#- nice -n 19 node --expose-gc bench/error/test_vt_abort.js
2 changes: 1 addition & 1 deletion bench/error/test_vt_abort2.js
Expand Up @@ -36,7 +36,7 @@ Error: could not merge buffer as protobuf


if (error) {
assert.equal(error.message,'could not merge buffer as protobuf');
assert.equal(error.message,'could not parse buffer as protobuf');
console.log('Test success! (ran ' + count + ' iterations)');
process.exit(0)
} else {
Expand Down
15 changes: 13 additions & 2 deletions src/mapnik_vector_tile.cpp
Expand Up @@ -2514,7 +2514,7 @@ void VectorTile::EIO_AfterSetData(uv_work_t* req)
* Get the data in this vector tile as a buffer
*
* @memberof mapnik.VectorTile
* @name getData
* @name getDataSync
* @instance
* @returns {Buffer} raw data
*/
Expand Down Expand Up @@ -2779,18 +2779,29 @@ void VectorTile::get_data(uv_work_t* req)
}
catch (std::exception const& ex)
{
// As all exception throwing paths are not easily testable or no way can be
// found to test with repeatability this exception path is not included
// in test coverage.
// LCOV_EXCL_START
closure->error = true;
closure->error_name = ex.what();
// LCOV_EXCL_END
}
}

void VectorTile::after_get_data(uv_work_t* req)
{
NanScope();
vector_tile_get_data_baton_t *closure = static_cast<vector_tile_get_data_baton_t *>(req->data);
if (closure->error) {
if (closure->error)
{
// As all exception throwing paths are not easily testable or no way can be
// found to test with repeatability this exception path is not included
// in test coverage.
// LCOV_EXCL_START
Local<Value> argv[1] = { NanError(closure->error_name.c_str()) };
NanMakeCallback(NanGetCurrentContext()->Global(), NanNew(closure->cb), 1, argv);
// LCOV_EXCL_END
}
else if (!closure->data.empty())
{
Expand Down

0 comments on commit bb6c13c

Please sign in to comment.