summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStewart Miles <smiles@google.com>2017-10-13 17:55:51 -0700
committerGitHub <noreply@github.com>2017-10-13 17:55:51 -0700
commita1b5f565d977c88e6e119499e0bf8cf9ebf0f380 (patch)
tree776e067de2d9fc6fc599cb0eb91ba2898e4ef36d
parent6d9a226f75f61683c3bc33d8512f99b7809a975d (diff)
parent0780a7db2463a1a4f30b01f2fac1c49e35641364 (diff)
downloadflatbuffers-a1b5f565d977c88e6e119499e0bf8cf9ebf0f380.tar.gz
flatbuffers-a1b5f565d977c88e6e119499e0bf8cf9ebf0f380.tar.bz2
flatbuffers-a1b5f565d977c88e6e119499e0bf8cf9ebf0f380.zip
Merge pull request #4459 from stewartmiles/master
Report a build failure when any Android build fails.
-rw-r--r--.travis.yml2
-rw-r--r--tests/test.cpp30
2 files changed, 20 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml
index 297c406b..71847f29 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -55,4 +55,4 @@ matrix:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which g++-$GCC_VERSION) /usr/bin/g++; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which gcc-$GCC_VERSION) /usr/bin/gcc; fi
script:
- - for build_gradle in $(git ls-files | grep build.gradle); do ( cd "$(dirname "${build_gradle}")" && ./gradlew build ); done
+ - failed=0; for build_gradle in $(git ls-files | grep build.gradle); do ( cd "$(dirname "${build_gradle}")" && ./gradlew build ) || failed=1; done; exit $((failed))
diff --git a/tests/test.cpp b/tests/test.cpp
index fb20d75e..e4145bd2 100644
--- a/tests/test.cpp
+++ b/tests/test.cpp
@@ -1754,21 +1754,29 @@ void TypeAliasesTest()
{
flatbuffers::FlatBufferBuilder builder;
- builder.Finish(CreateTypeAliases(builder,
- INT8_MIN, UINT8_MAX, INT16_MIN, UINT16_MAX,
- INT32_MIN, UINT32_MAX, INT64_MIN, UINT64_MAX, 2.3f, 2.3));
+ builder.Finish(CreateTypeAliases(
+ builder,
+ flatbuffers::numeric_limits<int8_t>::min(),
+ flatbuffers::numeric_limits<uint8_t>::max(),
+ flatbuffers::numeric_limits<int16_t>::min(),
+ flatbuffers::numeric_limits<uint16_t>::max(),
+ flatbuffers::numeric_limits<int32_t>::min(),
+ flatbuffers::numeric_limits<uint32_t>::max(),
+ flatbuffers::numeric_limits<int64_t>::min(),
+ flatbuffers::numeric_limits<uint64_t>::max(),
+ 2.3f, 2.3));
auto p = builder.GetBufferPointer();
auto ta = flatbuffers::GetRoot<TypeAliases>(p);
- TEST_EQ(ta->i8(), INT8_MIN);
- TEST_EQ(ta->u8(), UINT8_MAX);
- TEST_EQ(ta->i16(), INT16_MIN);
- TEST_EQ(ta->u16(), UINT16_MAX);
- TEST_EQ(ta->i32(), INT32_MIN);
- TEST_EQ(ta->u32(), UINT32_MAX);
- TEST_EQ(ta->i64(), INT64_MIN);
- TEST_EQ(ta->u64(), UINT64_MAX);
+ TEST_EQ(ta->i8(), flatbuffers::numeric_limits<int8_t>::min());
+ TEST_EQ(ta->u8(), flatbuffers::numeric_limits<uint8_t>::max());
+ TEST_EQ(ta->i16(), flatbuffers::numeric_limits<int16_t>::min());
+ TEST_EQ(ta->u16(), flatbuffers::numeric_limits<uint16_t>::max());
+ TEST_EQ(ta->i32(), flatbuffers::numeric_limits<int32_t>::min());
+ TEST_EQ(ta->u32(), flatbuffers::numeric_limits<uint32_t>::max());
+ TEST_EQ(ta->i64(), flatbuffers::numeric_limits<int64_t>::min());
+ TEST_EQ(ta->u64(), flatbuffers::numeric_limits<uint64_t>::max());
TEST_EQ(ta->f32(), 2.3f);
TEST_EQ(ta->f64(), 2.3);
TEST_EQ(sizeof(ta->i8()), 1);