• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Valloric / ycmd / 1845
94%

Build:
DEFAULT BRANCH: master
Ran 18 Apr 2016 04:08AM UTC
Jobs 1
Files 40
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1845

push

travis-ci

homu
Auto merge of #453 - micbou:letter-bitset-from-string, r=Valloric

[READY] Fix IndexError exception from C++

This PR fixes the `IndexError` exception returned by the `FilterAndCandidatesWrap` function when a candidate or the query contains non-ascii characters. Its error message depends on the OS:
 - on Windows: `invalid bitset<N> position`
 - on Linux: `bitset::set: __position (which is xxx) >= _Nb (which is 128)`
 - on OS X: `bitset set argument out of range`

It is caused by the `LetterBitsetFromString` function trying to set a bit to the `Bitset` object with a character index that is out of range. This is solved by only setting bits for character indices satisfying `0 ≤ i < 128`.

We add two tests for the `LetterBitsetFromString` function: one test to check the lower and upper character bounds and another to check that non-ascii characters are ignored. These tests are failing without this change. For example, on Windows:
```
[ RUN      ] LetterBitsetFromStringTest.Boundaries
unknown file: error: C++ exception with description "invalid bitset<N> position" thrown in the test body.
[  FAILED  ] LetterBitsetFromStringTest.Boundaries (1 ms)
[ RUN      ] LetterBitsetFromStringTest.IgnoreNonAsciiCharacters
unknown file: error: C++ exception with description "invalid bitset<N> position" thrown in the test body.
[  FAILED  ] LetterBitsetFromStringTest.IgnoreNonAsciiCharacters (0 ms)
```

Fixes #177 and Valloric/YouCompleteMe#2103.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/453)
<!-- Reviewable:end -->

2976 of 3519 relevant lines covered (84.57%)

0.85 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1845.1 (USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7 COVERAGE=true) 18 Apr 2016 04:08AM UTC 0
84.57
Travis Job 1845.1
Source Files on build 1845
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1845
  • bc323738 on github
  • Prev Build on master (#1839)
  • Next Build on master (#1851)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc