From e1cf0babff63e670e0d550b4072c22649a117fa7 Mon Sep 17 00:00:00 2001 From: randomguy3 Date: Mon, 9 Jan 2012 11:00:06 +0000 Subject: Re-make trunk git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@364 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64 --- src/common/test/test.m | 104 ------------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 src/common/test/test.m (limited to 'src/common/test/test.m') diff --git a/src/common/test/test.m b/src/common/test/test.m deleted file mode 100644 index 5e05c6e..0000000 --- a/src/common/test/test.m +++ /dev/null @@ -1,104 +0,0 @@ -// -// test.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "test/test.h" - -static int PASSES; -static int FAILS; - -static int ALLOC_INSTANCES = 0; - -static BOOL colorEnabled = YES; -static int depth = 0; - -static NSString *RED, *GREEN, *BLUE, *OFF; - -static NSString *indents[6] = - {@"", @" ", @" ", @" ", - @" ", @" "}; - -#define INDENT ((depth >= 6) ? indents[5] : indents[depth]) - - -@implementation Allocator - -+ (id)alloc { - ++ALLOC_INSTANCES; - return [super alloc]; -} - -- (void)dealloc { - --ALLOC_INSTANCES; - [super dealloc]; -} - -+ (Allocator*)allocator { - return [[[Allocator alloc] init] autorelease]; -} - -@end - -void TEST(NSString *msg, BOOL test) { - if (test) { - PUTS(@"%@[%@PASS%@] %@", INDENT, GREEN, OFF, msg); - ++PASSES; - } else { - PUTS(@"%@[%@FAIL%@] %@", INDENT, RED, OFF, msg); - ++FAILS; - } -} - -void startTests() { - PASSES = 0; - FAILS = 0; -} - -void endTests() { - PUTS(@"Done testing. %@%d%@ passed, %@%d%@ failed.", - GREEN, PASSES, OFF, - RED, FAILS, OFF); -} - -void startTestBlock(NSString *name) { - PUTS(@"%@Starting %@%@%@ tests.", INDENT, BLUE, name, OFF); - ++depth; -} - -void endTestBlock(NSString *name) { - --depth; - PUTS(@"%@Done with %@%@%@ tests.", INDENT, BLUE, name, OFF); -} - -void setColorEnabled(BOOL b) { - colorEnabled = b; - if (b) { - RED = @"\033[31;1m"; - GREEN = @"\033[32;1m"; - BLUE = @"\033[36;1m"; - OFF = @"\033[0m"; - } else { - RED = @""; - GREEN = @""; - BLUE = @""; - OFF = @""; - } -} -- cgit v1.2.3