Update coverity branch

This commit is contained in:
vitaut 2015-10-19 08:39:47 -07:00
commit a9582bb1a2
5 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,27 @@
#!/usr/bin/env python
# Update the coverity branch from the master branch.
# It is not done automatically because Coverity Scan limits
# the number of submissions per day.
from __future__ import print_function
import shutil, tempfile
from subprocess import check_call
class Git:
def __init__(self, dir):
self.dir = dir
def __call__(self, *args):
check_call(['git'] + list(args), cwd=self.dir)
dir = tempfile.mkdtemp()
try:
git = Git(dir)
git('clone', '-b', 'coverity', 'git@github.com:cppformat/cppformat.git', dir)
git('merge', '-X', 'theirs', '--no-commit', 'origin/master')
git('reset', 'HEAD', '.travis.yml')
git('checkout', '--', '.travis.yml')
git('commit', '-m', 'Update coverity branch')
git('push')
finally:
shutil.rmtree(dir)

View File

@ -166,6 +166,7 @@ TEST(BufferedFileTest, CloseError) {
TEST(BufferedFileTest, Fileno) {
BufferedFile f;
#ifndef __COVERITY__
// fileno on a null FILE pointer either crashes or returns an error.
EXPECT_DEATH_IF_SUPPORTED({
try {
@ -174,6 +175,7 @@ TEST(BufferedFileTest, Fileno) {
std::exit(1);
}
}, "");
#endif
f = open_buffered_file();
EXPECT_TRUE(f.fileno() != -1);
File copy = File::dup(f.fileno());

View File

@ -295,7 +295,8 @@ void TestLength(const char *length_spec, U value) {
fmt::ULongLong unsigned_value = value;
// Apply integer promotion to the argument.
fmt::ULongLong max = std::numeric_limits<U>::max();
if (max <= static_cast<unsigned>(std::numeric_limits<int>::max())) {
using fmt::internal::check;
if (check(max <= static_cast<unsigned>(std::numeric_limits<int>::max()))) {
signed_value = static_cast<int>(value);
unsigned_value = static_cast<int>(value);
} else if (max <= std::numeric_limits<unsigned>::max()) {

View File

@ -52,8 +52,8 @@ int main(int argc, char **argv) {
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
testing::InitGoogleTest(&argc, argv);
try {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
} catch (...) {
// Catch all exceptions to make Coverity happy.