summaryrefslogtreecommitdiff
path: root/src/common/test/color.m
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-09 11:00:06 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-09 11:00:06 +0000
commite1cf0babff63e670e0d550b4072c22649a117fa7 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/common/test/color.m
parent49393f6f445deb37e55a81798f88242e3e99d7a0 (diff)
Re-make trunk
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@364 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'src/common/test/color.m')
-rw-r--r--src/common/test/color.m76
1 files changed, 0 insertions, 76 deletions
diff --git a/src/common/test/color.m b/src/common/test/color.m
deleted file mode 100644
index e7a80ba..0000000
--- a/src/common/test/color.m
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// color.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 <http://www.gnu.org/licenses/>.
-//
-#import "test/test.h"
-#import "ColorRGB.h"
-
-void testColor() {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- startTestBlock(@"color");
-
- ColorRGB *red = [ColorRGB colorWithRed:255 green:0 blue:0];
- ColorRGB *lime = [ColorRGB colorWithRed:0 green:255 blue:0];
- ColorRGB *green = [ColorRGB colorWithRed:0 green:128 blue:0];
- TEST(@"Recognised red",
- [red name] != nil &&
- [[red name] isEqualToString:@"Red"]);
- TEST(@"Recognised lime",
- [lime name] != nil &&
- [[lime name] isEqualToString:@"Lime"]);
- TEST(@"Recognised green",
- [green name] != nil &&
- [[green name] isEqualToString:@"Green"]);
-
- ColorRGB *floatRed = [ColorRGB colorWithFloatRed:1.0f green:0.0f blue:0.0f];
- ColorRGB *floatLime = [ColorRGB colorWithFloatRed:0.0f green:1.0f blue:0.0f];
- ColorRGB *floatGreen = [ColorRGB colorWithFloatRed:0.0f green:0.5f blue:0.0f];
-
- TEST(@"Float red equal to int red", [floatRed isEqual:red]);
- TEST(@"Float lime equal to int lime", [floatLime isEqual:lime]);
- TEST(@"Float green equal to int green", [floatGreen isEqual:green]);
-
- TEST(@"Recognised float red",
- [floatRed name] != nil &&
- [[floatRed name] isEqualToString:@"Red"]);
-
- TEST(@"Recognised float lime",
- [floatLime name] != nil &&
- [[floatLime name] isEqualToString:@"Lime"]);
-
- TEST(@"Recognised float green",
- [floatGreen name] != nil &&
- [[floatGreen name] isEqualToString:@"Green"]);
-
- [floatRed setRedFloat:0.99f];
- TEST(@"Nudged red, not recognised now", [floatRed name] == nil);
- [floatRed setToClosestHashed];
- TEST(@"Set to closest hashed, reconised again",
- [floatRed name] != nil &&
- [[floatRed name] isEqualToString:@"Red"]);
-
- TEST(@"Red has correct hex (ff0000)", [[red hexName] isEqualToString:@"hexcolor0xff0000"]);
- TEST(@"Lime has correct hex (00ff00)", [[lime hexName] isEqualToString:@"hexcolor0x00ff00"]);
- TEST(@"Green has correct hex (008000)", [[green hexName] isEqualToString:@"hexcolor0x008000"]);
-
- endTestBlock(@"color");
- [pool drain];
-} \ No newline at end of file