Author: filipzelic
Date: Fri Aug 21 19:09:19 2015
New Revision: 38913

URL: http://svn.gna.org/viewcvs/gnustep?rev=38913&view=rev
Log:
Moving @dynamic tests to separate test program.

Change-Id: I0db3d780ec5923e569f389acbd8215a2e388dff0

Added:
    libs/quartzcore/trunk/Tests/CALayer/
    libs/quartzcore/trunk/Tests/CALayer/GNUmakefile
    libs/quartzcore/trunk/Tests/CALayer/Makefile.gs.mac
    libs/quartzcore/trunk/Tests/CALayer/Makefile.mac
    libs/quartzcore/trunk/Tests/CALayer/calayer.m
    libs/quartzcore/trunk/Tests/CALayer/run_tests.sh   (with props)
Modified:
    libs/quartzcore/trunk/ChangeLog
    libs/quartzcore/trunk/Headers/QuartzCore/CAMediaTiming.h
    libs/quartzcore/trunk/Source/CAMediaTiming.m
    libs/quartzcore/trunk/Tests/hello_animation.m

Modified: libs/quartzcore/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/ChangeLog?rev=38913&r1=38912&r2=38913&view=diff
==============================================================================
--- libs/quartzcore/trunk/ChangeLog     (original)
+++ libs/quartzcore/trunk/ChangeLog     Fri Aug 21 19:09:19 2015
@@ -1,3 +1,17 @@
+2015-08-13  Filip Zelic <[email protected]>
+
+       * Headers/QuartzCore/CAMediaTiming.h
+       * Source/CAMediaTiming.m
+       * Tests/CALayer/GNUmakefile
+       * Tests/CALayer/Makefile.gs.mac
+       * Tests/CALayer/Makefile.mac
+       * Tests/CALayer/calayer.m
+       * Tests/CALayer/run_tests.sh
+       Implemented unit tests for CALayer dynamic properties.
+
+       * Tests/hello_animation.m
+       Removed previously used tests from demo application.
+
 2015-07-28  Filip Zelic <[email protected]>
 
        * Headers/QuartzCore/CALayer.h:

Modified: libs/quartzcore/trunk/Headers/QuartzCore/CAMediaTiming.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/Headers/QuartzCore/CAMediaTiming.h?rev=38913&r1=38912&r2=38913&view=diff
==============================================================================
--- libs/quartzcore/trunk/Headers/QuartzCore/CAMediaTiming.h    (original)
+++ libs/quartzcore/trunk/Headers/QuartzCore/CAMediaTiming.h    Fri Aug 21 
19:09:19 2015
@@ -25,6 +25,7 @@
    Boston, MA 02110-1301, USA.
 */
 
+#import <Foundation/Foundation.h>
 #import "QuartzCore/CABase.h"
 
 @protocol CAMediaTiming

Modified: libs/quartzcore/trunk/Source/CAMediaTiming.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/Source/CAMediaTiming.m?rev=38913&r1=38912&r2=38913&view=diff
==============================================================================
--- libs/quartzcore/trunk/Source/CAMediaTiming.m        (original)
+++ libs/quartzcore/trunk/Source/CAMediaTiming.m        Fri Aug 21 19:09:19 2015
@@ -24,7 +24,6 @@
    Boston, MA 02110-1301, USA.
 */
 
-#import <Foundation/Foundation.h>
 #import "QuartzCore/CAMediaTiming.h"
 
 NSString *const kCAFillModeRemoved = @"kCAFillModeRemoved";

Added: libs/quartzcore/trunk/Tests/CALayer/GNUmakefile
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/Tests/CALayer/GNUmakefile?rev=38913&view=auto
==============================================================================
--- libs/quartzcore/trunk/Tests/CALayer/GNUmakefile     (added)
+++ libs/quartzcore/trunk/Tests/CALayer/GNUmakefile     Fri Aug 21 19:09:19 2015
@@ -0,0 +1,16 @@
+include $(GNUSTEP_MAKEFILES)/common.make
+
+TOOL_NAME = calayer
+
+calayer_OBJC_FILES = calayer.m
+
+ADDITIONAL_OBJCFLAGS += -Wall -g -O0 -std=gnu99
+ADDITIONAL_CFLAGS += -Wall -g -O0 -std=gnu99
+ADDITIONAL_LDFLAGS += -L../../Source/obj -L../../Source/QuartzCore.framework
+ADDITIONAL_TOOL_LIBS =  -lgnustep-gui -lGL -lGLU -lopal -lQuartzCore
+
+ADDITIONAL_INCLUDE_DIRS = -I../../Headers
+
+-include GNUmakefile.preamble
+include $(GNUSTEP_MAKEFILES)/tool.make
+-include GNUmakefile.postamble

Added: libs/quartzcore/trunk/Tests/CALayer/Makefile.gs.mac
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/Tests/CALayer/Makefile.gs.mac?rev=38913&view=auto
==============================================================================
--- libs/quartzcore/trunk/Tests/CALayer/Makefile.gs.mac (added)
+++ libs/quartzcore/trunk/Tests/CALayer/Makefile.gs.mac Fri Aug 21 19:09:19 2015
@@ -0,0 +1,14 @@
+
+CFLAGS+=-DGSIMPL_UNDER_COCOA=1 -arch i386
+CXXFLAGS+=-DGSIMPL_UNDER_COCOA=1 -arch i386
+OBJCFLAGS+=-DGSIMPL_UNDER_COCOA=1 -arch i386
+
+all: calayer
+
+calayer.o: ../Testing.h
+
+calayer: calayer.o ../Testing.h
+       $(CC) -arch i386 calayer.o -o calayer -framework GSQuartzCore && 
./calayer
+
+clean:
+       -rm calayer.o calayer

Added: libs/quartzcore/trunk/Tests/CALayer/Makefile.mac
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/Tests/CALayer/Makefile.mac?rev=38913&view=auto
==============================================================================
--- libs/quartzcore/trunk/Tests/CALayer/Makefile.mac    (added)
+++ libs/quartzcore/trunk/Tests/CALayer/Makefile.mac    Fri Aug 21 19:09:19 2015
@@ -0,0 +1,10 @@
+
+all: calayer
+
+calayer.o: ../Testing.h
+
+calayer: calayer.o ../Testing.h
+       $(CC) calayer.o -o calayer -framework QuartzCore && ./calayer
+
+clean:
+       -rm calayer.o calayer

Added: libs/quartzcore/trunk/Tests/CALayer/calayer.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/Tests/CALayer/calayer.m?rev=38913&view=auto
==============================================================================
--- libs/quartzcore/trunk/Tests/CALayer/calayer.m       (added)
+++ libs/quartzcore/trunk/Tests/CALayer/calayer.m       Fri Aug 21 19:09:19 2015
@@ -0,0 +1,108 @@
+/* Tests/CALayer/calayer.m
+
+   Copyright (C) 2015 Free Software Foundation, Inc.
+
+   Author: Filip Zelic <[email protected]>
+   Date: July 2015
+
+   This file is part of QuartzCore.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; see the file COPYING.LIB.
+   If not, see <http://www.gnu.org/licenses/> or write to the
+   Free Software Foundation, 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#if GSIMPL_UNDER_COCOA
+#import <GSQuartzCore/AppleSupport.h>
+#endif
+
+#import "QuartzCore/CALayer.h"
+#import "../Testing.h"
+
+@interface CALayerTestSubclass : CALayer
+@property (nonatomic,
+           retain,
+           getter=manualTempDynamicPropertyTestGetter,
+           setter=setDynamicPropertyDifferentName:) NSString 
*dynamicPropertyObject;
+@property (retain) NSString *dynamicPropertyStringObject;
+@property (assign) float dynamicPropertyFloat;
+@property (assign) BOOL dynamicPropertyBool;
+@property (assign) char dynamicPropertyChar;
+@property (assign) double dynamicPropertyDouble;
+@end
+@implementation CALayerTestSubclass
+@dynamic dynamicPropertyObject;
+@dynamic dynamicPropertyStringObject;
+@dynamic dynamicPropertyFloat;
+@dynamic dynamicPropertyBool;
+@dynamic dynamicPropertyChar;
+@dynamic dynamicPropertyDouble;
+@end
+
+int main(int argc, char ** argv)
+{
+  int testsFailed = 0;
+  CALayerTestSubclass *testLayer = [CALayerTestSubclass layer];
+  //////////////////////////
+
+  NSString *expectedString = @"Testing object.";
+  [testLayer setDynamicPropertyStringObject: @"Testing object."];
+  PASS([testLayer dynamicPropertyStringObject] == expectedString,
+    "Setter and getter for dynamic property object are working");
+
+  //////////////////////////
+
+  NSString *expectedStringObject = @"Testing custom getter and setter.";
+  /* TODO: Calling [GSKVOCALayerTestSubclass -setDynamicPropertyStringObject:] 
with incorrect signature.  
+            Method has v@:@"NSString", selector has v24@0:8@16 */
+  [testLayer setDynamicPropertyStringObject: @"Testing custom getter and 
setter."];
+  /* TODO: Calling [GSKVOCALayerTestSubclass -dynamicPropertyStringObject] 
with incorrect signature.  
+            Method has @"NSString"@:, selector has @16@0:8 */
+  PASS([testLayer dynamicPropertyStringObject] == expectedStringObject,
+    "Custom setter and getter for dynamic properties are working");
+
+  //////////////////////////
+
+  float expectedFloatNumber = 20.0;
+  [testLayer setDynamicPropertyFloat: 20.0];
+
+  PASS([testLayer dynamicPropertyFloat] == expectedFloatNumber,
+    "Setter and getter for dynamic property float are working");
+
+  //////////////////////////
+
+  double expectedDoubleNumber = 3.141592653589793238;
+  [testLayer setDynamicPropertyDouble: 3.141592653589793238];
+
+  PASS([testLayer dynamicPropertyDouble] == expectedDoubleNumber,
+    "Setter and getter for dynamic property double are working");
+  //////////////////////////
+
+  BOOL expectedBoolValue = YES;
+  [testLayer setDynamicPropertyBool: YES];
+
+  PASS([testLayer dynamicPropertyBool] == expectedBoolValue,
+    "Setter and getter for dynamic property bool are working");
+
+  //////////////////////////
+
+  if(testsFailed)
+    {
+      printf("\7");
+    }
+  printf("\n\n===== %d tests failed\n\n", testsFailed);
+
+  return testsFailed;
+}

Added: libs/quartzcore/trunk/Tests/CALayer/run_tests.sh
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/Tests/CALayer/run_tests.sh?rev=38913&view=auto
==============================================================================
--- libs/quartzcore/trunk/Tests/CALayer/run_tests.sh    (added)
+++ libs/quartzcore/trunk/Tests/CALayer/run_tests.sh    Fri Aug 21 19:09:19 2015
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+cd ../../
+make && sudo -E make install
+cd -
+make clean && make && ./obj/calayer
+

Propchange: libs/quartzcore/trunk/Tests/CALayer/run_tests.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: libs/quartzcore/trunk/Tests/hello_animation.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/quartzcore/trunk/Tests/hello_animation.m?rev=38913&r1=38912&r2=38913&view=diff
==============================================================================
--- libs/quartzcore/trunk/Tests/hello_animation.m       (original)
+++ libs/quartzcore/trunk/Tests/hello_animation.m       Fri Aug 21 19:09:19 2015
@@ -61,24 +61,6 @@
 
 #import "QCTestOpenGLView.h"
 
-@interface CALayerTestSubclass : CALayer
-@property (nonatomic,
-           retain,
-           getter=manualTempDynamicPropertyTestGetter,
-           setter=setDynamicPropertyDifferentName:) NSString 
*dynamicPropertyObject;
-@property (assign) float dynamicPropertyFloat;
-@property (assign) BOOL dynamicPropertyBool;
-@property (assign) char dynamicPropertyChar;
-@property (assign) double dynamicPropertyDouble;
-@end
-@implementation CALayerTestSubclass
-@dynamic dynamicPropertyObject;
-@dynamic dynamicPropertyFloat;
-@dynamic dynamicPropertyBool;
-@dynamic dynamicPropertyChar;
-@dynamic dynamicPropertyDouble;
-@end
-
 @interface HelloAnimationCustomBasicAnimation : CABasicAnimation
 @end
 @implementation HelloAnimationCustomBasicAnimation
@@ -368,31 +350,6 @@
   [layer2 setBackgroundColor: greenColor];
   [layer2 setSpeed: 2];
 
-
-  CALayerTestSubclass * testLayer = [CALayerTestSubclass layer];
-
-  testLayer.dynamicPropertyObject = @"Good news, everyone! Dynamic accessors 
work.";
-  NSLog(@"%@", testLayer.dynamicPropertyObject);
-
-  /* TODO: Calling [GSKVOCALayerTestSubclass -setDynamicPropertyDifferentName:]
-   with incorrect signature.  Method has v@:@"NSString", selector has 
v24@0:8@16 */
-  [testLayer setDynamicPropertyDifferentName: @"Custom getter/setter name for 
dynamic properties also work."];
-  /* TODO: Calling [GSKVOCALayerTestSubclass 
-manualTempDynamicPropertyTestGetter]
-   with incorrect signature.  Method has @"NSString"@:, selector has @16@0:8 */
-  NSLog(@"%@", [testLayer manualTempDynamicPropertyTestGetter]);
-
-  [testLayer setDynamicPropertyFloat: 20.0];
-  NSLog(@"%f", [testLayer dynamicPropertyFloat]);
-
-  [testLayer setDynamicPropertyBool: YES];
-  NSLog(@"%d", [testLayer dynamicPropertyBool]);
-
-  [testLayer setDynamicPropertyDouble: 3.141592653589793238];
-  NSLog(@"%f", [testLayer dynamicPropertyDouble]);
-
-
-
-
   /*
   [layer2 setDuration: __builtin_inf()];
   [layer2 setBeginTime: CACurrentMediaTime()*[layer speed]+1];


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to