michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * This test exercises the full, deliberately-exposed JSAPI interface to ensure michael@0: * that no internal integer typedefs leak out. Include every intentionally michael@0: * public header file (and those headers included by them, for completeness), michael@0: * even the ones tests.h itself included, to verify this. michael@0: */ michael@0: michael@0: #include "jscpucfg.h" michael@0: #include "jspubtd.h" michael@0: #include "jstypes.h" michael@0: michael@0: #include "js/Anchor.h" michael@0: #include "js/CallArgs.h" michael@0: #include "js/CallNonGenericMethod.h" michael@0: #include "js/CharacterEncoding.h" michael@0: #include "js/Class.h" michael@0: #include "js/Date.h" michael@0: #include "js/GCAPI.h" michael@0: #include "js/HashTable.h" michael@0: #include "js/HeapAPI.h" michael@0: #include "js/Id.h" michael@0: /* LegacyIntTypes.h is deliberately exempted from this requirement */ michael@0: #include "js/MemoryMetrics.h" michael@0: #include "js/OldDebugAPI.h" michael@0: #include "js/ProfilingStack.h" michael@0: #include "js/PropertyKey.h" michael@0: #include "js/RequiredDefines.h" michael@0: #include "js/RootingAPI.h" michael@0: #include "js/SliceBudget.h" michael@0: #include "js/StructuredClone.h" michael@0: #include "js/TracingAPI.h" michael@0: #include "js/TypeDecls.h" michael@0: #include "js/Utility.h" michael@0: #include "js/Value.h" michael@0: #include "js/Vector.h" michael@0: #include "js/WeakMapPtr.h" michael@0: #include "jsapi-tests/tests.h" michael@0: michael@0: /* michael@0: * Verify that our public (and intended to be public, versus being that way michael@0: * because we haven't made them private yet) headers don't define michael@0: * {u,}int{8,16,32,64} or JS{Ui,I}nt{8,16,32,64} types. If any do, they will michael@0: * assuredly conflict with a corresponding typedef below mapping to a *struct*. michael@0: * michael@0: * Note that tests.h includes a few internal headers; in order that this michael@0: * jsapi-test be writable, those internal headers must not import the legacy michael@0: * typedefs. michael@0: */ michael@0: michael@0: struct ConflictingType { michael@0: uint64_t u64; michael@0: }; michael@0: michael@0: typedef ConflictingType uint8; michael@0: typedef ConflictingType uint16; michael@0: typedef ConflictingType uint32; michael@0: typedef ConflictingType uint64; michael@0: michael@0: typedef ConflictingType int8; michael@0: typedef ConflictingType int16; michael@0: typedef ConflictingType int32; michael@0: typedef ConflictingType int64; michael@0: michael@0: typedef ConflictingType JSUint8; michael@0: typedef ConflictingType JSUint16; michael@0: typedef ConflictingType JSUint32; michael@0: typedef ConflictingType JSUint64; michael@0: michael@0: typedef ConflictingType JSInt8; michael@0: typedef ConflictingType JSInt16; michael@0: typedef ConflictingType JSInt32; michael@0: typedef ConflictingType JSInt64; michael@0: michael@0: typedef ConflictingType jsword; michael@0: typedef ConflictingType jsuword; michael@0: typedef ConflictingType JSWord; michael@0: typedef ConflictingType JSUword; michael@0: michael@0: BEGIN_TEST(testIntTypesABI) michael@0: { michael@0: /* This passes if the typedefs didn't conflict at compile time. */ michael@0: return true; michael@0: } michael@0: END_TEST(testIntTypesABI)