From e751e2b456dc70f7e9ea7af8a6eaf790d907652b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikkel=20Fahn=C3=B8e=20J=C3=B8rgensen?= Date: Mon, 21 Dec 2020 04:38:58 +0100 Subject: [PATCH 1/3] Fix missing struct clear in monster test --- test/monster_test/monster_test.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/monster_test/monster_test.c b/test/monster_test/monster_test.c index 688978cb..dbb8ed8c 100644 --- a/test/monster_test/monster_test.c +++ b/test/monster_test/monster_test.c @@ -720,8 +720,14 @@ int gen_monster(flatcc_builder_t *B, int with_size) test[1].a = 0x50; test[1].b = 0x60; ns(Monster_test4_push_create(B, 0x70, (int8_t)0x80)); + /* + * Zero padding within struct + * - not needed when receiving a pointer like `test` in the above. + */ + ns(Test_clear(&x)); x.a = 0x190; /* This is a short. */ x.b = (int8_t)0x91; /* This is a byte. */ + /* And x also has a hidden trailing padding byte. */ ns(Monster_test4_push(B, &x)); ns(Monster_test4_push(B, &x)); /* We can use either field mapped push or push on the type. */ @@ -1824,7 +1830,7 @@ int verify_fixed_length_array(const void *buffer, size_t size) printf("Monster buffer with fixed length arrays failed to verify, got: %s\n", flatcc_verify_error_string(ret)); return -1; } - + mon = ns(Monster_as_root(buffer)); if (ns(Monster_test_type(mon)) != ns(Any_Alt)) { printf("test field does not have Alt type"); @@ -1889,7 +1895,7 @@ int verify_fixed_length_array(const void *buffer, size_t size) return -1; } } - + ns(FooBar_copy_from_pe(&fa2, fa)); if (fa2.foo[0] != 1.0f || fa2.foo[1] != 2.0f || fa2.foo[15] != 16.0f || fa2.bar[0] != 100 || fa2.bar[9] != 1000) { From d0bbd33184918fb5324a1b5dded1892571433a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikkel=20Fahn=C3=B8e=20J=C3=B8rgensen?= Date: Mon, 21 Dec 2020 11:37:01 +0100 Subject: [PATCH 2/3] Try fix Travis build of OS-X --- .travis.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 97d45f28..1edbe9b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,14 +15,17 @@ addons: packages: - ninja-build -before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - -install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ninja; fi +# macos builds are too slow on travis, and now brew update doesn't work without additional configuration +#before_install: +# - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi +# +#install: +# - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ninja; fi script: - scripts/initbuild.sh ninja + if: "$TRAVIS_OS_NAME" != "osx" - scripts/test.sh + if: "$TRAVIS_OS_NAME" != "osx" - scripts/initbuild.sh make-concurrent - scripts/test.sh From d19775c9f9ece230e5874149908dd7095bbc6ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikkel=20Fahn=C3=B8e=20J=C3=B8rgensen?= Date: Mon, 21 Dec 2020 11:43:05 +0100 Subject: [PATCH 3/3] Try fix Travis build of OS-X --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1edbe9b1..30a45291 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,7 @@ addons: # - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ninja; fi script: - - scripts/initbuild.sh ninja - if: "$TRAVIS_OS_NAME" != "osx" - - scripts/test.sh - if: "$TRAVIS_OS_NAME" != "osx" + - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then scripts/initbuild.sh ninja; fi + - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then scripts/test.sh; fi - scripts/initbuild.sh make-concurrent - scripts/test.sh