2010-11-14 23:47:30 +01:00
|
|
|
//
|
|
|
|
// CatchOCTestCase.mm
|
|
|
|
// OCTest
|
|
|
|
//
|
|
|
|
// Created by Phil Nash on 13/11/2010.
|
|
|
|
// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
|
|
|
|
//
|
2011-02-08 09:42:05 +01:00
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
2010-11-14 23:47:30 +01:00
|
|
|
|
|
|
|
#import "CatchOCTestCase.h"
|
|
|
|
|
|
|
|
|
|
|
|
@implementation TestFixture
|
|
|
|
|
|
|
|
|
2010-11-16 08:00:08 +01:00
|
|
|
-(void) setUp
|
2010-11-14 23:47:30 +01:00
|
|
|
{
|
2010-11-16 08:00:08 +01:00
|
|
|
obj = [[TestObj alloc] init];
|
2010-11-14 23:47:30 +01:00
|
|
|
}
|
|
|
|
|
2010-11-16 08:00:08 +01:00
|
|
|
-(void) tearDown
|
2010-11-14 23:47:30 +01:00
|
|
|
{
|
|
|
|
[obj release];
|
|
|
|
}
|
|
|
|
|
|
|
|
OC_TEST_CASE( "OCTest/test1", "This is a test case" )
|
|
|
|
{
|
2010-12-27 23:37:51 +01:00
|
|
|
REQUIRE( obj.int_val == 0 );
|
2010-11-14 23:47:30 +01:00
|
|
|
|
|
|
|
obj.int_val = 1;
|
|
|
|
|
2010-12-27 23:37:51 +01:00
|
|
|
REQUIRE( obj.int_val == 1 );
|
2010-11-14 23:47:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
OC_TEST_CASE( "OCTest/test2", "This is another test case" )
|
|
|
|
{
|
2010-12-27 23:37:51 +01:00
|
|
|
REQUIRE( obj.int_val == 0 );
|
2010-11-14 23:47:30 +01:00
|
|
|
|
|
|
|
obj.int_val = 2;
|
|
|
|
|
2010-12-27 23:37:51 +01:00
|
|
|
REQUIRE( obj.int_val == 2 );
|
2010-11-14 23:47:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|