Artifact 05bc33864e11b96f36632ac5a375e12569a2cda06aca2ff0a1628533d33c1c4d:
- File
tests/OFNumberTests.m
— part of check-in
[d74f244ab7]
at
2020-08-12 20:56:32
on branch trunk
— Avoid using (u)intmax_t in methods
It is not guaranteed that a type encoding for it exists. (user: js, size: 1191) [annotate] [blame] [check-ins using]
/* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, * 2018, 2019, 2020 * Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #import "TestsAppDelegate.h" static OFString *module = @"OFNumber"; @implementation TestsAppDelegate (OFNumberTests) - (void)numberTests { void *pool = objc_autoreleasePoolPush(); OFNumber *num; TEST(@"+[numberWithLongLong:]", (num = [OFNumber numberWithLongLong: 123456789])) TEST(@"-[isEqual:]", [num isEqual: [OFNumber numberWithUInt32: 123456789]]) TEST(@"-[hash]", num.hash == 0x82D8BC42) TEST(@"-[charValue]", num.charValue == 21) TEST(@"-[doubleValue]", num.doubleValue == 123456789.L) objc_autoreleasePoolPop(pool); } @end