Artifact ccb8cb8682484b95afe0cb9df569469a0d4c43d0a654280f32942da02093317d:
- File
tests/OFNumberTests.m
— part of check-in
[25c985fec1]
at
2020-08-25 00:11:24
on branch trunk
— OFNumber: Remove (u)int{8,16,32,64} methods
Since C guarantees minimum sizes for char, short, int, long and long
long, these can be used instead. (user: js, size: 1189) [annotate] [blame] [check-ins using] [more...]
/* * 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 numberWithLong: 123456789]]) TEST(@"-[hash]", num.hash == 0x82D8BC42) TEST(@"-[charValue]", num.charValue == 21) TEST(@"-[doubleValue]", num.doubleValue == 123456789.L) objc_autoreleasePoolPop(pool); } @end