/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This is a big macro mess, so let's summarize what's in here right up front: // // |TestDocumentationExample| is intended to be a copy-paste of the example // in the macro's documentation, to make sure it's correct. // // // |TestJammedWithFlags| tests using every bit of the type for bool flags. // 64-bit isn't tested due to macro limitations. // // // |TestLopsided| tests an instance with the following configuration: // // * a 1-bit boolean // * an (N-1)-bit uintN_t // // It tests both orderings of these fields. // // Hopefully these are enough to cover all the nasty boundary conditions // (that still compile).
// ==================== generate and run the tests ======================
// There's an unknown bug in clang-cl-9 (used for win64-ccov) that makes // generating these with the TIMES_N macro not work. So these are written out // explicitly to unbork CI. struct JammedWithFlags8 {
MOZ_ATOMIC_BITFIELDS(mAtomicFields, 8,
((bool, Flag1, 1), (bool, Flag2, 1), (bool, Flag3, 1),
(bool, Flag4, 1), (bool, Flag5, 1), (bool, Flag6, 1),
(bool, Flag7, 1), (bool, Flag8, 1)))
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.